CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Serial port and sleep

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Eugeneo



Joined: 30 Aug 2005
Posts: 155
Location: Calgary, AB

View user's profile Send private message

Serial port and sleep
PostPosted: Mon Jun 26, 2006 3:19 pm     Reply with quote

How do you turn off the serial usart during sleep. Will this work, the cpu seems to keep resetting.

Sleep code
Code:

temp=input(pin_B2);
temp=input(pin_B5);
VCC_OFF;
PORT_B_PULLUPS(0x01);            // one pull up enabled on port B0 ext int for wake
disable_interrupts(INT_TBE);     // keep off all serial ports until wake up
disable_interrupts(INT_RDA);     // keep off all serial ports until wake up



Wake code
Code:

output_float(pin_B2);            //release RX pin form low state
output_float(pin_B5);            //release TX pin form low state
PORT_B_PULLUPS(0x01);            // one pull up enabled on port B0
enable_interrupts(INT_RDA);     // Turn on serial port
enable_interrupts(INT_TBE);     // Turn on serial port
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jun 26, 2006 3:38 pm     Reply with quote

Quote:
How do you turn off the serial usart during sleep ?

Do this:
Code:
setup_uart(FALSE);


To turn it back on:
Code:
setup_uart(TRUE);


This is in the manual.
Note that this only works with the hardware UART.
Eugeneo



Joined: 30 Aug 2005
Posts: 155
Location: Calgary, AB

View user's profile Send private message

PostPosted: Mon Jun 26, 2006 3:39 pm     Reply with quote

Thank-you
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group