13.07.2015 Views

VFD-F (CURVE).cdr

VFD-F (CURVE).cdr

VFD-F (CURVE).cdr

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>VFD</strong>-F SeriesStep 6: Repeat step 2 to 5 for the next 8-bit byte of the command message.Continue doing this until all bytes have been processed. The final contentsof the CRC register are the CRC value. When transmitting the CRC value inthe message, the upper and lower bytes of the CRC value must beswapped, i.e. the lower order byte will be transmitted first.For example, read 2 words from the to address 2102H of AMD with address 01H.The CRC register content of last byte from ADR to number of data is F76FH. Thecommand message is as following. 6FH will transmit before F7H.Command message:ADR 01HCMD 03HData starting 02Haddress 02HNumber of data 00H(word) 02HCRC CHK Low 6FHCRC CHK High F7HThe following is an example of CRC generation using C language. The functiontakes two arguments:Unsigned char* data a pointer to the message bufferUnsigned char length the quantity of bytes in the message buffer5The function returns the CRC values as a type of unsigned integer.unsigned int crc_chk(unsigned char* data, unsigned char length){int j;unsigned int reg_crc=0xFFFF;while(length--){reg_crc ^= *data++;for(j=0;j>1) ^ 0xA001;}else{reg_crc=reg_crc >>1;}}}return reg_crc;}DELTA ELECTRONICS, INC. ALL RIGHTS RESERVED 5-55

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!