2010-01-17 06:20 PM
AN971 sub address modification for 16bit. st72F264
2010-01-17 06:20 PM
We have been using AN971 I2c_eepr.asm code on a ST72F One of our I2C peripherals has changed from having an 8 bit sub_add to having 16 bit. Would you make suggestions on how to modify I2c_eepr.asm to work with a 16 bit sub_add. Attached are details of our code. Reg 0x12 and 0x77 will have to become of the form 0xXXXX with our new peripheral.
I'm thinking that if we had an extra register, i.e. variable called Z, placed right after line 323 with the following instructions: 323a ld A, Z 323b call I2Cm_TxData we might then be able to transmit a total of 16 bits as a sub_address. Of course, I would also have to add the following kind of instructions also to accomodate the extra 8 bits of a 16 bit subaddress: 254a ld Z,#$XX 317a ld Z,#$XX Comments are welcomed. [ This message was edited by: angelo1 on 19-01-2010 08:53 ] ________________ Attachments : Code_for_I2C_Email.doc : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006Hzna&d=%2Fa%2F0X0000000bWb%2FI.1CCOHhRsnrhyso2kIjROEnDTQObqeMylFy_g7ecJ8&asPdf=false