PDA

View Full Version : Packets of bytes to HERSIN again



crhomberg
- 19th April 2007, 14:00
Sorry for bugging you guys but I am going crazy.

I receive data from a camera controller which sends groups of 7 bytes every time you move the joystick or enter a command. I have to keep my program running doing other things but need to catch every packet that comes.
I got the interrupt thing working using HSERIN and also by reading RCIF directly but only with 1 byte at a time. Some good news is that the 1st byte is always $A0 and the 7th is always $AF. I need them in their respective bytes to be able to decode the command. The commands come at a rate of 4800bps and I am running a 16F877A at 20MHz.

I have used SERIN2 successfully in the form SERIN2 port,speed,[byte1,byte2, yte3 etc etc]
but using this system means that I have to continusly poll the SERIN2 command and while the PIC responds to the commands it sometimes looses another. I rather loose a response then a command.

Regards


Chris

skimask
- 19th April 2007, 14:55
Sorry for bugging you guys but I am going crazy. I receive data from a camera controller which sends groups of 7 bytes every time you move the joystick or enter a command. I have to keep my program running doing other things but need to catch every packet that comes. I got the interrupt thing working using HSERIN and also by reading RCIF directly but only with 1 byte at a time. Some good news is that the 1st byte is always $A0 and the 7th is always $AF. I need them in their respective bytes to be able to decode the command. The commands come at a rate of 4800bps and I am running a 16F877A at 20MHz. I have used SERIN2 successfully in the form SERIN2 port,speed,[byte1,byte2, yte3 etc etc] but using this system means that I have to continusly poll the SERIN2 command and while the PIC responds to the commands it sometimes looses another. I rather loose a response then a command. Regards Chris

Same topic, different thread...

sougata
- 19th April 2007, 15:53
Yeah! Same topic different thread. It is highly doable and as MisterE says learning oppertunities. Keep cool and you can solve the problem.

crhomberg
- 19th April 2007, 16:33
Thanks guys, I'm trying to keep cool.