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 question for PIC16F877A

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



Joined: 11 Sep 2008
Posts: 44

View user's profile Send private message

UART question for PIC16F877A
PostPosted: Thu Oct 02, 2008 6:24 pm     Reply with quote

I am adding new code to a PIC16F877A that has already been placed on board that can not be changed so I am forced to write my code to the way the hardware has been done (I did not do the hardware either).

Lets say I need for right now read the data coming in from a RS485 chip and be able to transmit a packet back out.

That would not be a problem except the current hardware Tx UART pin is already wired to something else. According to the board layout I have to make C5 the Tx and C7 the Rx with B2 as the enable pin. Is there a way that I can setup the hardware UART so i can use INT_RDA and just use a software UART for the tx?

If you had this problem how would you go about doing it in software? I am not too familiar with bitbanging communication links but looks like it will need to be done. Also FYI the data out from the RS485 chip comes into a digital switch IC that is controlled by pin C1 from the microcontroller, so in other words, as long as C1 is high the data should pass on to pin C7.

The system has a 18.432 MHz clock and a baud rate of 38400. Currently i will not be sending large amounts of data, probably rx 4 bytes and tx 4 bytes. Eventually after this is working it will need to rx about 4 bytes and tx up to 50 bytes.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Oct 02, 2008 8:25 pm     Reply with quote

Some threads by Ttelmah about using only the Rx pin (and not the
Tx pin) of the hardware UART:
http://www.ccsinfo.com/forum/viewtopic.php?t=35139
http://www.ccsinfo.com/forum/viewtopic.php?t=33676
http://www.ccsinfo.com/forum/viewtopic.php?t=33352
http://www.ccsinfo.com/forum/viewtopic.php?t=31576
Guest








PostPosted: Fri Oct 03, 2008 6:35 am     Reply with quote

Thanks those posts look interesting, I will look into it today.
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