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

RS485 general questions

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



Joined: 21 Dec 2007
Posts: 41

View user's profile Send private message

RS485 general questions
PostPosted: Fri Dec 21, 2007 10:56 am     Reply with quote

Hello folks,

I looked over the rs485.c file in the picc/drivers folder to get some ideas on how I want to design my software. I had a few questions that I would like some answers to help me get a grasp on the CCS SCI.

The RS485.c has the following lines for non-external:
Code:
   --removed per the guidelines on the forums.--


The above directives are creating two streams that will be used later. One question that first pops in my mind is, why? If you only used the first one (the h/w uart), would you not have the collision detection that the 'multi_master' gives you? A quote from the CCS help about MULTI_MASTER:
Quote:
Uses the RETURN pin to determine if another master on the bus is transmitting at the same time. If a collision is detected bit 6 is set in RS232_ERRORS and all future PUTC's are ignored until bit 6 is cleared. The signal is checked at the start and end of a bit time. May not be used with the UART.


I played around with the code a little bit to see what would work. I first used both directives, in part, like so:
Code:
   #use rs232(baud=9600, xmit=RS485_TX_PIN, rcv=RS485_RX_PIN, enable=RS485_ENABLE_PIN, errors, stream=RS485)
   #use rs232(baud=9600, xmit=RS485_TX_PIN, rcv=RS485_RX_PIN, enable=RS485_ENABLE_PIN, errors, stream=RS485_CD)


I was able to send data out of the PIC to my PC.

Then, I changed the second directive to use the s/w uart. (shown in the first code block) I was not able to transmit any data though. Why would this be?

I'm on a PIC18F6526.

Thanks for the information. Merry Christmas!
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