Hi,
I'm trying to use the USART module in my PIC16F876. I have built a pan/tilt camera stand using stepper motors, and controlled by 2 5804 stepper crivers. The idea is to use 2 PIC's as interfaces to the PC. I tell the PIC's what speed/direction I want over the serial link, and they set the neccesary control lines and output a pulse train to run the motors.
I was planning to use USART interruts on receive - when serial data arrived, the ISR would be called, read the data, and then get back to running the motors. The prblem is that if
I am outputting a pulse chain at a low frequency, it may be a while before the ISR is serviced, by which time the data has already arrived. As I understand it, this is not a problem as long as the size of the data is not > the size of the buffer?
Another option is to send one 'garbage' byte to trigger the interrupt, wait a second, then proceed. In thisapplication, quick response is not that important - but getting the correct data is!
There is also the issue of how to address 2 PIC's seperately, although I suspect this will be easier than solving the above. Does anyone have any ideas / experience?
Sorry for the enourmous post....
Cheers,
Ben
Bookmarks