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 CCS Technical Support

setup_uart

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



Joined: 19 Nov 2003
Posts: 30

View user's profile Send private message

setup_uart
PostPosted: Tue Aug 31, 2004 5:28 am     Reply with quote

I have the latest version and nothing is listed under help, but the readme file has :
SETUP_UART now accepts the following new options for chips with the EUART H/W:
UART_AUTODETECT
UART_AUTODETECT_NOWAIT
UART_WAKEUP_ON_RDA
If these are new, does this mean there are other options which can be set.
I have been having problems with the h/w uart failing after operating ok for days or weeks. The prog still runs but comms stops. I am using the f876, i2c and timer0 with prescaler.
Any ideas appreciated.
Cheers
Les
dyeatman



Joined: 06 Sep 2003
Posts: 1933
Location: Norman, OK

View user's profile Send private message

We need something to go on!!
PostPosted: Tue Aug 31, 2004 6:35 am     Reply with quote

The F876 does not have a EUART, it has a USART so those options don't apply for you.

We are not mindreaders and without posting your code and some kind of details it is a total crapshoot to guess why you are having problems.

Post the first 15 lines or so of your code first so we can see how you are setting things up. Be sure to include your #use RS232 and #use I2C lines.

Next, please give us some details about the problem you are having.

What comms stop? All of them, the RS2342, the I2C? Does the chip get into a loop at some point in the program? What is still working? We need some info here!!
Ttelmah
Guest







Re: setup_uart
PostPosted: Tue Aug 31, 2004 7:00 am     Reply with quote

ljb wrote:
I have the latest version and nothing is listed under help, but the readme file has :
SETUP_UART now accepts the following new options for chips with the EUART H/W:
UART_AUTODETECT
UART_AUTODETECT_NOWAIT
UART_WAKEUP_ON_RDA
If these are new, does this mean there are other options which can be set.
I have been having problems with the h/w uart failing after operating ok for days or weeks. The prog still runs but comms stops. I am using the f876, i2c and timer0 with prescaler.
Any ideas appreciated.
Cheers
Les

Obvious question, is whether you have 'errors' enabled. If not (and you are not clearing these yourself), it only takes one overrun error, for the UART to be completely hung...
If your system is 'mission critical', and comms are regular (a packet every few seconds perhaps), then consider using the watchdog, with an interrupt driven counter, which is set to a value, whenever data is received. In the interrupt, if the counter is non-zero, reset the watchdog, and decrement the counter. This way you can have a watchdog that will trigger after several seconds, if the comms are not being seen, and reset the chip.

Best Wishes
ljb



Joined: 19 Nov 2003
Posts: 30

View user's profile Send private message

PostPosted: Tue Aug 31, 2004 7:10 am     Reply with quote

The reason I asked about the setup_uart is that it is specified in the f876 file within the device library, as shown below :
Why, if it is not implemented?

// Constants used in setup_uart() are:
// FALSE - Turn UART off
// TRUE - Turn UART on
#define UART_ADDRESS 2
#define UART_DATA 4

Is there somethink I am missing here?
Thanks for help
Les
Ps. I think my comms prob may actually be the i2c (ram device) hanging or looping when the last address is reached.
I
Ttelmah
Guest







PostPosted: Tue Aug 31, 2004 7:25 am     Reply with quote

ljb wrote:
The reason I asked about the setup_uart is that it is specified in the f876 file within the device library, as shown below :
Why, if it is not implemented?

// Constants used in setup_uart() are:
// FALSE - Turn UART off
// TRUE - Turn UART on
#define UART_ADDRESS 2
#define UART_DATA 4

Is there somethink I am missing here?
Thanks for help
Les
Ps. I think my comms prob may actually be the i2c (ram device) hanging or looping when the last address is reached.
I

The 'point' is that the same command (setup_uart), is used on lots of different chips. On your chip, the only functions supported, are 'true', and 'false' to enable/disable the UART. On latter chips, new keywords are added (and listed in the .h file). You could in fact code your own 'errors' clearing routine, by testing the UART for any errors, and if one is found, issuing first a setup_uart(false)', then a 'setup_uart(true)', which restarts the UART, and clears the error. Adding the ERRORS flag to the RS232 declaration, does this automatically.

Best Wishes
ljb



Joined: 19 Nov 2003
Posts: 30

View user's profile Send private message

PostPosted: Tue Aug 31, 2004 7:31 am     Reply with quote

Smile Understand now, many thanks for your help.
Les
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