我利用的eeprom是24c16,按照指南者教程进行了更改,读写没问题,但是在做其他东西上出现以下问题,主要是读和写入的数据不一致,而且读取的数据特别长,希望得到各位大神指导。
下面是串口打印结果:
需要写入的数据:
A = 0.006376
A = 0.064232
A = -0.001700
写入首地址:
W_usAddr:35
写入的字节:
W_pWriteBuf[0]=72
W_pWriteBuf[1]=50
W_pWriteBuf[2]=171
W_pWriteBuf[3]=119
W_pWriteBuf[4]=184
W_pWriteBuf[5]=29
W_pWriteBuf[6]=122
W_pWriteBuf[7]=63
W_pWriteBuf[8]=219
W_pWriteBuf[9]=78
W_pWriteBuf[10]=91
W_pWriteBuf[11]=35
W_pWriteBuf[12]=130
W_usAddr:48
W_pWriteBuf[13]=113
W_pWriteBuf[14]=176
W_pWriteBuf[15]=63
W_pWriteBuf[16]=95
W_pWriteBuf[17]=7
W_pWriteBuf[18]=206
W_pWriteBuf[19]=25
W_pWriteBuf[20]=81
W_pWriteBuf[21]=218
W_pWriteBuf[22]=91
W_pWriteBuf[23]=191
读取首地址
R_usAddr:35
读取字节:
_pReadBuf[0]=89
_pReadBuf[1]=18
_pReadBuf[2]=191
_pReadBuf[3]=210
_pReadBuf[4]=251
_pReadBuf[5]=1
_pReadBuf[6]=1
_pReadBuf[7]=224
_pReadBuf[8]=7
_pReadBuf[9]=1
_pReadBuf[10]=1
_pReadBuf[11]=23
_pReadBuf[12]=39
_pReadBuf[13]=218
_pReadBuf[14]=91
_pReadBuf[15]=191
_pReadBuf[16]=95
_pReadBuf[17]=7
_pReadBuf[18]=206
_pReadBuf[19]=25
_pReadBuf[20]=81
_pReadBuf[21]=1
_pReadBuf[22]=1
_pReadBuf[23]=0
读取的结果:
A =-28504578599448948000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.000000
A = -0.001700
A = 0.000000 |