i am not sure how 2 use the interupt and how 2 access the interupt. any guild line on where should i start?
thank you
i am not sure how 2 use the interupt and how 2 access the interupt. any guild line on where should i start?
thank you
Is the problem serial or interrupt?
Dave
Always wear safety glasses while programming.
both...
this is what i want to do.
from pc, i'll sent a txt file using hyper link. then, on my 16f877a side, it will auto recieve with it's uart capability. then, my controller will constantly scan the buffer. if there is something in the buffer, it will halt the program and start recieving the data.
the problem is that i dono how 2 enable that rs232 interupt, how 2 chk the buffer and how 2 read the buffer.
I know a little about interrupts but I have not triggered one with a serial input yet. Sorry .
Dave
Always wear safety glasses while programming.
As for the interrupts, the best place to start is with Darrel Taylor's Instant Interrupts. These allow for simplified creation of interrupts for PBP programs. Do a search on the forum for more on using these. Here is the "Mother Thread" for Darrel's work. There is a lot of good info in that thread alone.
Next, read up on the 16F877A data sheet for the USART so you can understand exactly how it recieves the incoming bytes, and how they are accessed (read). Page 117 (10.2.2) as a basic discription for receiving data. Page 118 gives step-by-step instructions.
Here is a simplified, basic idea of what needs to happen: As bytes are recieved, they trigger the interrupt (when set up appropriately). The program flow branches to an interrupt handler subroutine (also known as Interrupt Service Routine, ISR), which reads the incoming byte. At this point it can save the byte in a buffer, or deal with it in any number of ways, depending our you requirements. After this is done, the interrupt routine is exited and program flow returns to where it was.
Not a whole lot of detail (I haven't found the need to use 16F chips, so don't have any specific code for you), I know, but they are some "guide line[s] on where [to] start"
SteveB
Last edited by SteveB; - 29th September 2007 at 22:11. Reason: added a Datasheet reference for the USART
thanks. i'll go study abit about that.
Bookmarks