|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
UCOS一進(jìn)T1中斷就死機(jī),大家?guī)兔纯?/h1> |
| 作者:billtian 欄目:ARM技術(shù) |
{ uint8 i,j; fp32 f; T1IR = 0x01; //清除中斷標(biāo)志 OSIntEnter(); if(Motor0Struct.uiMoveSteps) { Motor0Struct.uiMoveSteps--; if(Motor0Struct.ucMoveDirection) { Motor0Struct.ucState++; } else { Motor0Struct.ucState--; } Motor0Struct.ucState %= 4*(Motor0Struct.ucNumOfMicroStep+1); f = cos(Motor0Struct.ucState*PI/(2*(Motor0Struct.ucNumOfMicroStep+1))); i = (uint8)(0x7f*fabs(f)); if(f < 0) { i |= 0x80; } f = sin(Motor0Struct.ucState*PI/(2*(Motor0Struct.ucNumOfMicroStep+1))); j = (uint8)(0x7f*fabs(f)); if(f < 0) { j |= 0x80; } MotorDriverDAWrite(0x08,i); MotorDriverDAWrite(0x09,j); } VICVectAddr = 0x00; //通知VIC中斷處理結(jié)束 OSIntExit(); } |
| 2樓: | >>參與討論 |
| 作者: zxwwwwcom 于 2005/12/26 9:50:00 發(fā)布:
可能是你沒用 IRQ_HANDER 這個(gè)句柄。。 這個(gè)句柄在 IRQ.S里邊定義:比如:“IRQ_Handler HANDLER IRQ_Exception”這可以幫你保存現(xiàn)場。 |
|
|
|
| 免費(fèi)注冊為維庫電子開發(fā)網(wǎng)會員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號 |