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

Software int RDA with 12f675

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



Joined: 01 Jan 2017
Posts: 12

View user's profile Send private message

Software int RDA with 12f675
PostPosted: Tue Jun 06, 2017 12:06 pm     Reply with quote

Hi everyone, I'm working on a simple rf example. I want to design it as cheap as possible. rs232 communication is ok. But it looks like 12f675 doesn't support an rda interrupt. Because compiler didn't compile it.

"Error: invalid pre-processor directive" that's the error message that i got.

Is it possible to create a kind of software rda interrupt with ordinary interrupt function ? Would it work like rda ? Baud rate will be 1200 or 2400. I will just control 2 LEDs which are on the receiver by two buttons which are on the transmitter.
Can anybody help me to find a solution, please?
temtronic



Joined: 01 Jul 2010
Posts: 9134
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Tue Jun 06, 2017 1:09 pm     Reply with quote

Yes, you can use any I/O pin of the 12F675 as a software UART input as it has selectable Interrupt on change for all the pins, usually you'd use GP2 the 'external interrupt' pin though.
You need to remember, if using the internal oscilator , it's not too accurate, though at 1200 or 2400 baud, it should be fine.
Also software UARTs have NO HW buffering, so it's up to YOU, the programmer to handle the 'details'.
You may want to see about prices for small PICs that have a HW UART. It may be possible to find one with HW UART and more memory for less than the 12F675 !

Jay
jeremiah



Joined: 20 Jul 2010
Posts: 1320

View user's profile Send private message

PostPosted: Tue Jun 06, 2017 1:23 pm     Reply with quote

You can also use a timer interrupt if you are able to run your PIC much faster than the baud rate.

Here is a post from TTelmah with an example. Temtronic's comments about oscillator accuracy also apply.

https://www.ccsinfo.com/forum/viewtopic.php?t=51403&highlight=uart
Ttelmah



Joined: 11 Mar 2010
Posts: 19260

View user's profile Send private message

PostPosted: Tue Jun 06, 2017 1:30 pm     Reply with quote

Get the 12F1822.

This has a hardware UART. RX on RA5 movable to RA1.

Cheaper. About 2/3rd the price. (Microchip want to sell the newer chips rather than the older ones...).

Faster.

2* the RAM, 2* the ROM.
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