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

RS-232 Interrupt

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



Joined: 27 Mar 2005
Posts: 30

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

RS-232 Interrupt
PostPosted: Thu Feb 16, 2006 12:51 pm     Reply with quote

Is it possible for the interrupt routine to interrupt off of pins other than the uart. I am finishing a job that soeone else started and on the circuit board they used pin b3 for recieve and b4 for transmit. I can use the timer and lookat it every so often but I was wondering if this was possible. The Micro is 18f452

Thanks
treitmey



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

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

PostPosted: Thu Feb 16, 2006 1:13 pm     Reply with quote

YES.
Look up port B on page 94
http://ww1.microchip.com/downloads/en/devicedoc/39564b.pdf

It shows int on change. An external interupt. one for capture compair...

You must read the spec sheet.


Last edited by treitmey on Thu Feb 16, 2006 1:18 pm; edited 1 time in total
newguy



Joined: 24 Jun 2004
Posts: 1911

View user's profile Send private message

PostPosted: Thu Feb 16, 2006 1:14 pm     Reply with quote

You can't use the RDA interrupt unless you use the built-in USART. If you use other pins, the RDA interrupt can't be used.

I think you're out of luck there. RX is on B3, and TX on B4. If RX was on B0, B1 or B2 you could use one of the external interrupts to generate a quasi-RDA-like receive interrupt. If you're able to swap RX to B4 and TX to B3, then you could use the interrupt on change (RB) to implement a quasi-RDA-like receive interrupt.
treitmey



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

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

PostPosted: Thu Feb 16, 2006 1:24 pm     Reply with quote

I see what you mean newguy. Can he use the B3 CCP2 in caputure to IRQ when data is recieved. TX should'nt be a problem at low speeds.


Remember. If you don't use the hardware USART pins you don't get a usart.

This is going to be a software serial port.
newguy



Joined: 24 Jun 2004
Posts: 1911

View user's profile Send private message

PostPosted: Thu Feb 16, 2006 1:34 pm     Reply with quote

I never thought of the CCP2 input on B3. I suppose he could bodge together another receive-like interrupt using that too.

We need a "who's going to take this one?" button - we posted within seconds of each other that first time. Very Happy
Mattr0



Joined: 27 Mar 2005
Posts: 30

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

PostPosted: Thu Feb 16, 2006 1:38 pm     Reply with quote

well thanks guys but I think I will just use a timer to look at it eery so often.
treitmey



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

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

PostPosted: Thu Feb 16, 2006 1:45 pm     Reply with quote

I bet you'll miss data. I would just run a PCB repair wire to the hardware usart pins you want. It won't look pretty. But it will work.
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