采用STM32L151+CH432T+TP8485搭建了一個(gè)系統(tǒng)用于485通信,現(xiàn)在初始化CH432T和通過(guò)CH432T發(fā)送命令沒(méi)問(wèn)題,此時(shí)設(shè)備會(huì)回復(fù)一段數(shù)據(jù),從CH432T的RX1用示波器也能看到返回的所有數(shù)據(jù)。因?yàn)榉祷財(cái)?shù)據(jù)大于16B,我設(shè)置FIFO 14B觸發(fā),我理解會(huì)在INT#上產(chǎn)生一個(gè)觸發(fā),STM32中斷后讀取即可,但是無(wú)論是示波器看還是STM32均沒(méi)有看到這個(gè)中斷。直接讀取也能讀取到返回?cái)?shù)據(jù)的一部分...但是不全
一開(kāi)始覺(jué)得可能是INT#直接連STM32不行,之后就接了一個(gè)10kohm電阻上拉,也還是同樣的問(wèn)題。請(qǐng)教下論壇的大神,有沒(méi)有其他思路,還是我理解的這個(gè)INT#不對(duì)。
初始化配置參考了DEMO如下
//設(shè)置串口0配置 div?=?(CLK_FREQ>>4)/CH432_PRORT1_RATE; ????u8DLMValue?=?div>>8; ????u8DLLValue?=?div&0xff; writeCH432Data(?REG_LCR_ADDR,?BIT_LCR_DLAB?);????/*?設(shè)置DLAB為1?*/ ????writeCH432Data(?REG_DLL_ADDR,?u8DLLValue?);????/*?設(shè)置波特率?*/ ????writeCH432Data(?REG_DLM_ADDR,?u8DLMValue?); writeCH432Data(?REG_FCR_ADDR,?BIT_FCR_RECVTG1?|?BIT_FCR_RECVTG0?|?BIT_FCR_FIFOEN?);????/*?設(shè)置FIFO模式,觸發(fā)點(diǎn)為14?*/ ????writeCH432Data(?REG_LCR_ADDR,?BIT_LCR_WORDSZ1 ??????????????????????????????????|?BIT_LCR_WORDSZ0?);????/*?字長(zhǎng)8位,1位停止位、無(wú)校驗(yàn)?*/ ????writeCH432Data(?REG_IER_ADDR,?BIT_IER_IEMODEM?|?BIT_IER_IELINES?|?BIT_IER_IETHRE?|?BIT_IER_IERECV?);????/*?使能中斷?*/ ????writeCH432Data(?REG_MCR_ADDR,?BIT_MCR_OUT2?|?BIT_MCR_RTS?|?BIT_MCR_DTR?);????/*?允許中斷輸出,DTR,RTS為1?*/