Download Evaluation Board User Guide

Transcript
Evaluation Board User Guide
UG-356
MANAGING THE COMMUNICATION PROTOCOL BETWEEN THE MICROCONTROLLER AND
THE ADE7880
This section lists the protocol commands that have been
implemented to manage the ADE7880 from the PC using the
microcontroller.
command, and sends an answer to the PC. The PC should wait
for the answer before sending a new command to the microcontroller.
The microcontroller is a pure slave during the communication
process. It receives a command from the PC, executes the
Table 3. Echo Command—Message from the PC to the Microcontroller
Byte
0
1
2
3
4
…
N
N+1
Description
A = 0x41
N = number of bytes transmitted after this byte
Data Byte N − 1 (MSB)
Data Byte N − 2
Data Byte N − 3
…
Data Byte 1
Data Byte 0 (LSB)
Table 4. Echo Command—Answer from the Microcontroller to the PC
Byte
0
1
2
3
4
…
N+1
N+2
Description
R = 0x52
A = 0x41
N = number of bytes transmitted after this byte
Data Byte N − 1 (MSB)
Data Byte N − 2
…
Data Byte 1
Data Byte 0 (LSB)
Table 5. Power Mode Select—Message from the PC to the Microcontroller
Byte
0
1
2
Description
B = 0x42, change PSM mode
N=1
Data Byte 0:
0x00 = PSM0
0x01 = PSM1
0x02 = PSM2
0x03 = PSM3
Table 6. Power Mode Select—Answer from the Microcontroller to the PC
Byte
0
1
Description
R = 0x52
~ = 0x7E, to acknowledge that the operation was successful
Table 7. Reset—Message from the PC to the Microcontroller
Byte
0
1
2
Description
C = 0x43, toggle the RESET pin and keep it low for at least 10 ms
N=1
Data Byte 0: this byte can have any value
Rev. 0 | Page 25 of 56