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

UART How do you change parity or data len within program

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



Joined: 09 Feb 2005
Posts: 48

View user's profile Send private message

UART How do you change parity or data len within program
PostPosted: Thu Apr 23, 2009 8:08 am     Reply with quote

I want to adjust the following HARDWARE UART setting when pic at energized. For example; pic internal eeprom has the following values. I want to read this values from internal eeprom then I want to adjust hardware uart setting according to these read values from eeprom. This process is only active when pic at energized. After that I don't need any uart setting when pic run. Is it possible?

Uart_speed (example:9600)
Uart_parity (Example:Odd)
Stop_bit_length (Example:1,5)
Data_bit-length (Example: 7 or 8)
Code:
main()
{
int x;
  x=read_internal_eeprom(0);
  switch(x)
 {
    case 0:
              #use rs232(baud=9600,parity=E,xmit=PIN_C6,rcv=PIN_C7,bits=8)
  break;
       case 1
              #use rs232(baud=9600,parity=O,xmit=PIN_C6,rcv=PIN_C7,bits=7
  break;
       case 2
              #use rs232(baud=19200,parity=n,xmit=PIN_C6,rcv=PIN_C7,bits=9
  break; 
  }

 while(true)
{
  ...;
...;
}
}

Is it possible?
treitmey



Joined: 23 Jan 2004
Posts: 1094
Location: Appleton,WI USA

View user's profile Send private message Visit poster's website

PostPosted: Thu Apr 23, 2009 8:25 am     Reply with quote

See Neutone post (bottom)
http://www.ccsinfo.com/forum/viewtopic.php?t=22062
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