Jan 4, 2006, 7:22 AM
Post #1 of 2 (41 views) Copy Shortcut [ColdFire] Problem: user code (MCF5208 interrupt) interacting with dBUG Can't Post
I have an M5208EVB board, which has Freescale dBUG in it. The dBUG copy the vector table to 0x40000000. The user code should start from 0x40020000.
I prepared the following code (linked from 0x4002000) trying to use DTMR2 (Timer 2)reference compare interrupt. But I never see interrupt happen (the LEDS did not change). This code is modified from Freescale's sample code for MCF5206e. What is wrong? Need help.
;interrupt controller register configuration move.w #0xfffb,d0 ; initializes IMR register to enable timer2 interrupts move.w d0,IMRH ; and mask all other interrupt sources
move.b #0x05,d0 ; initializes timer2 ICR for autovectoring and sets move.b d0,ICR34 ; interrupt level to 5
;general purpose parallel port register configuration
move.b #0x00,d0 ;all timer pins are GPIO move.b d0,PAR_TIMER move.b #0xff,d0 ; sets timer port as outputs move.b d0,PDDR_TIMER ; move.b #0x02,d0;<----lit one led (comfirmed from running on M5208EVB) move.b d0,PODR_TIMER
;timer2 register configuration move.w #0x0f00,d0 ; move.w d0,TRR2 ; sets timer2 period in TRR2 register.
The DMA timer registers for the MCF5208 are slightly different than the MCF5206e. Below is my assembly code version and attached is the "C" code. Sorry for some extra code. I was playing with two methods CodeWarrior has for interrupt function declaration. I also was blinking LEDs. Hope this help. Regards, David