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




Bookmarks