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

same RS232 (hardware) at different speed

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



Joined: 17 Mar 2008
Posts: 2
Location: ITALY

View user's profile Send private message

same RS232 (hardware) at different speed
PostPosted: Mon Mar 17, 2008 6:22 am     Reply with quote

Kindly ask help to use the same RS232 at different speed Sad

this code:

while(1)
{
#use rs232(baud=19200,xmit=TXSER_A,rcv=RXSER_A,parity=N,bits=8)
putc(0x0f);
delay_ms(2);
#use rs232(baud=9600,xmit=TXSER_A,rcv=RXSER_A,parity=N,bits=8)
putc(0xf0);
delay_ms(2);
}


seems don't switch the speed like I need

I've also tryed to define 2 different function:

#use rs232(baud=19200,xmit=TXSER_A,rcv=RXSER_A,parity=N,bits=8)
writeHigh()
{
putc(0xf0);
}
---
#use rs232(baud=9600,xmit=TXSER_A,rcv=RXSER_A,parity=N,bits=8)
writeSlow()
{
putc(0xf0);
}


and then call them... but I'm always not able to switch the speed

working condition:
PIC16F916
TXSER_A= PIN_C6
RXSER_A= PIN_C7
hardware rs232

THANKS in advance for the help !
Have a nice day !
Enrico


Last edited by enrico on Mon Mar 17, 2008 7:45 am; edited 2 times in total
Ttelmah
Guest







PostPosted: Mon Mar 17, 2008 6:26 am     Reply with quote

Just use the set_uart_speed function...

Best Wishes
Matro
Guest







PostPosted: Mon Mar 17, 2008 6:32 am     Reply with quote

All instructions beginning by # are for prepocessor so will never do any hardware changes.

Just use SET_UART_SPEED() as said by Ttelmah or SETUP_UART() for a complete setup.

Regards,
Matro
enrico



Joined: 17 Mar 2008
Posts: 2
Location: ITALY

View user's profile Send private message

THANKS !
PostPosted: Mon Mar 17, 2008 7:40 am     Reply with quote

Simply, BIG thanks ! Very Happy

it works perfetcly

Have a nice day !
Enrico
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