|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
關(guān)于STR710中斷問題,急迫,求達(dá)人相助! |
| 作者:gxl_3000 欄目:MCU技術(shù) |
我使用IAR4.4寫一個(gè)基本的UART中斷程序,禁止FIFO,將接收字節(jié)傳回,發(fā)現(xiàn)只有中斷一次后再也無(wú)法進(jìn)入,試驗(yàn)了幾天。。。。 void UART0_IRQHandler(void) { u8 bRByte; UART_ByteReceive(UART0, &bRByte, 0xFF); UART_ByteSend(UART0, &bRByte); } 是否需要在中斷服務(wù)程序里清除中斷標(biāo)志?可是找不到相應(yīng)函數(shù)? 另外,誰(shuí)有STR710 的Timer0 定時(shí)中斷產(chǎn)生程序(定時(shí)頻率200Hz)?幫忙貼一下,好像也是無(wú)法產(chǎn)生中斷 |
| 2樓: | >>參與討論 |
| 作者: starm 于 2007/1/13 11:09:00 發(fā)布:
iar4.40自帶的例子也無(wú)法通過(guò)么? C:\Program Files\IAR Systems\Embedded Workbench 4.0 EVALUATION\ARM\examples\ST\STR71x\STR71xLibrary\examples\examples.eww 有一個(gè)uart例子, 看了他的uart isr和你的一樣啊. 你可以測(cè)試一下例子看看. |
|
| 3樓: | >>參與討論 |
| 作者: seawwh 于 2007/1/13 11:12:00 發(fā)布:
估計(jì)是沒有清除中斷標(biāo)志,可以用函數(shù)清除之 這是STR912的函數(shù),估計(jì)STR710也是類似。 /******************************************************************************* * Function NAME : UART_ClearITPendingBit * DESCRIPTION : Clears the UARTx抯 interrupt pending bits. * Input : - UARTx: where x can be 0,1or 2 to SELECT the UART peripheral. * - UART_IT: specifies the interrupt pending bit to clear. * More than one interrupt can be cleared using the 搢?operator. * This parameter can be: * - UART_IT_OverrunError: Overrun Error interrupt * - UART_IT_BreakError: Break Error interrupt * - UART_IT_ParityError: Parity Error interrupt * - UART_IT_FrameError: Frame Error interrupt * - UART_IT_ReceiveTimeOut: Receive Time Out interrupt * - UART_IT_Transmit: Transmit interrupt * - UART_IT_Receive: Receive interrupt * - UART_IT_DSR: DSR interrupt * - UART_IT_DCD: DCD interrupt * - UART_IT_CTS: CTS interrupt * - UART_IT_RI: RI interrupt * OUTPUT : None * Return : None *******************************************************************************/ void UART_ClearITPendingBit(UART_TypeDef* UARTx, u16 UART_IT) { /* Clear the specified interrupt */ UARTx->ICR &= UART_IT; } |
|
| 4樓: | >>參與討論 |
| 作者: gxl_3000 于 2007/1/13 11:28:00 發(fā)布:
通不過(guò)啊。。。。 就是使用IAR的例子,無(wú)法通過(guò) 用的是mxchip的板子,UART查詢的例子,調(diào)試通過(guò)了,證明硬件和連接無(wú)問題。 另外定時(shí)中斷的例子也差不多,進(jìn)去一次就不行了 |
|
| 5樓: | >>參與討論 |
| 作者: starm 于 2007/1/13 12:31:00 發(fā)布:
UART_ByteReceive(UART0, &bRByte, 0xFF); UART_ByteReceive(UART0, &bRByte, 0xFF); 會(huì)讀取UARTx.RxBuf同時(shí)清除中斷標(biāo)志 11.3.5 Interrupt CONTROL The UART has a SINGLE interrupt request LINE, called UARTn_interrupt. The status bits in the UARTn_SR register determine the cause of the interrupt. UARTn_interrupt will go high when a status bit is 1 (high) and the corresponding bit in the UARTn_IER register is 1 (see Figure 67). Note: The UARTn_Status register is read ONLY. The UART_Status bits can ONLY be cleared by operating on the FIFOs. The RxFIFO and TxFIFO can be reset by writing to the UARTn_RxReset and UARTn_TxReset registers. * - 本貼最后修改時(shí)間:2007-1-13 12:46:56 修改者:starm |
|
|
|
| 免費(fèi)注冊(cè)為維庫(kù)電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào) |