Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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.
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,311
Reputation
4,624
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
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
 

vijaya_narayana

Full Member level 3
Joined
Jun 12, 2007
Messages
179
Helped
11
Reputation
22
Reaction score
1
Trophy points
1,298
Location
India
Activity points
2,194
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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top