如題,CH438Q,讀寫數(shù)據(jù)時(shí)序問題,時(shí)鐘無法使INI#拉低
讀寫寄存器代碼如下:
UINT8?ReadCH438Data(?UINT8?addr?) { ????u8?value; ????CH438_DATA_PORT->ODR?=?(CH438_DATA_PORT->ODR&0XFF00)|addr; ????CH438_ALE_HIGH; ????CH438_CS_LOW; ????CH438_ALE_HIGH; ????CH438_ALE_LOW; ????CH438_DataPin_IN(); ????CH438_RD_LOW; ????CH438_RD_LOW; ????value?=?(uint8_t)CH438_DATA_PORT->IDR; ????CH438_RD_HIGH; ????CH438_ALE_HIGH; ????CH438_CS_HIGH; ????CH438_DataPin_OUT(); ????return?value; }
void?WriteCH438Data(?UINT8?addr,?UINT8?dat) { ????CH438_DATA_PORT->ODR?=?(CH438_DATA_PORT->ODR&0XFF00)?|?addr;? ????CH438_ALE_HIGH; ????CH438_CS_LOW; ????CH438_ALE_HIGH; ????CH438_ALE_LOW; ????CH438_DATA_PORT->ODR?=?(CH438_DATA_PORT->ODR&0XFF00)?|?dat;?//?????? ????delay_us(1); ????CH438_WR_LOW; ????CH438_WR_HIGH; ????CH438_ALE_HIGH; ????CH438_CS_HIGH; ????CH438_DataPin_OUT(); }
熱門產(chǎn)品 :
CH585: 集成高速USB和NFC的藍(lán)牙MCU