2007年5月24日 星期四

How to use Interrupt

1.create SYSINTR(software interrupt)
create IRQ(hardware interrupt)




3.SYSINTR and IRQ mapping
VOID OALIntrStaticTranslate(
UINT32 sysIntr,
UINT32 irq
);


4.create Event
  • ensure the event are created successfully.
  • InterruptInitialize(), this function initializes a hardware interrupt with kernel, and allows the device driver to register an event and enable the interrupt. check it has created successfully.
  • create a thread and ensure it has created successfully


5.wait event occur
  • InterruptDone(), this function signals to the kernel that interrupt processing has been completed.
  • WaitForSingleObject(), this function checks the current state of the specified object. If the object's state is nonsignaled, the calling thread enters a wait state.

2007年5月16日 星期三

MPLAB與ICD2連結的操作

【硬體操作】
1先將ICD2與電腦連接
2再將ICD2與Target Board連接
3電源由Target Board供應
拔除:建議直接將ICD2與Target Board連接拔除

【軟體操作】

(燒錄後由電腦可以控制)
path:Debugger→Select Tool→MPLAB ICD2

步驟如下圖所示
1.Reset and connect to ICD2,確認ICD2有連接
2.Program target device,將code燒錄至IC中
3.Reset
4.Run(若有中斷點需要全部清除)



(燒錄後可以不需與電腦連接)
path:Programmer→Select programmerl→MPLAB ICD2

步驟如下圖所示
1.Reset and connect to ICD2,確認ICD2有連接
2.Program target device,將code燒錄至IC中
3.只需電源供應給Target Board即可