how to decode serial data with 8051

Status
Not open for further replies.

phtsai

Newbie level 1
Joined
Feb 9, 2006
Messages
1
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,290
I try to using the 8051 to decode the serial data send from a PTZ keyboard (using Pelco D / P protocol)

The data transmitted from the keyboard will be something like this:

ff 01 00 04 20 00 25 (This will make the camera to pan left at moderate speed)

"synch byte" - ff
"address byte" - 01
command 1 byte - 00 (no action)
command 2 byte - 04 (pan camera to the left)
data 1 byte - 20 (pan at moderate speed)
data 2 byte - 00 (no additional data)
checksum - 25 (add contents of bytes 2 through 6)


Can anyone provide me information on how to use 8051 to decode the serial data.
 

The best option would be to use RI&TI interrupt with Rx buffer and define special bit for each byte as it was suggested in this example:

If you find it suitable come back ..

Regards,
IanP
 

i think u can have base value for just compare the values so that u can manuplate the camera.It is berret to use serial interrupts for getting the data
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…