Technical discussions about Freescale Microcontrollers: M68HC11. (Freescale Semiconductor is a Subsidiary of Motorola).
|
Hi all, I just wrote two similar pieces of code to detect rising edges on IC3 and IC4/OC5. The one on IC3 works, but the one on IC4/OC5 doesn't. IC3: ldy #$1000 ldaa #$01 ; EDG3A on staa tctl2,y bclr tflg1,y $fe ; IC3F cleared brclr tflg1,y $01 * ; Loop until flag set IC4: ldy #$1000 bset pactl,y $04 ; set IC4/OC5 = 1 ldaa #$40 ; EDG4A on staa tctl2,y bclr tflg1,y $f7 ; IC4F cleared brclr tflg1,y $08 * ; Loop until flag set Can anyone tell me what is wrong? Thanks. |
|
Can you please give us the full number of your HC11 chip? Thanks, Emmett Redd Ph.D. mailto: Associate Professor (417)836-5221 Department of Physics, Astronomy, and Materials Science Southwest Missouri State University Fax (417)836-6226 901 SOUTH NATIONAL Dept (417)836-5131 SPRINGFIELD, MO 65804 USA > -----Original Message----- > From: Qu Ziguang [mailto:] > Sent: Sunday, February 06, 2005 12:41 PM > To: > Subject: [m68HC11] IC4/OC5 question > > Hi all, > > I just wrote two similar pieces of code to detect rising edges on IC3 > and IC4/OC5. The one on IC3 works, but the one on IC4/OC5 doesn't. > > IC3: > > ldy #$1000 > ldaa #$01 ; EDG3A on > staa tctl2,y > bclr tflg1,y $fe ; IC3F cleared > brclr tflg1,y $01 * ; Loop until flag set > > IC4: > > ldy #$1000 > bset pactl,y $04 ; set IC4/OC5 = 1 > ldaa #$40 ; EDG4A on > staa tctl2,y > bclr tflg1,y $f7 ; IC4F cleared > brclr tflg1,y $08 * ; Loop until flag set > > Can anyone tell me what is wrong? Thanks. |
|
I am using Axiom's CME11E9-EVBU development board. The chip number is MC68HC11E9. --- In , "Redd, Emmett R" <err557f@s...> wrote: > Can you please give us the full number of your HC11 chip? > > Thanks, > > Emmett Redd Ph.D. mailto:EmmettRedd@s... > Associate Professor (417)836-5221 > Department of Physics, Astronomy, and Materials Science > Southwest Missouri State University Fax (417)836-6226 > 901 SOUTH NATIONAL Dept (417)836-5131 > SPRINGFIELD, MO 65804 USA > > > -----Original Message----- > > From: Qu Ziguang [mailto:quziguang@g...] > > Sent: Sunday, February 06, 2005 12:41 PM > > To: > > Subject: [m68HC11] IC4/OC5 question > > > > > > > > Hi all, > > > > I just wrote two similar pieces of code to detect rising edges on IC3 > > and IC4/OC5. The one on IC3 works, but the one on IC4/OC5 doesn't. > > > > IC3: > > > > ldy #$1000 > > ldaa #$01 ; EDG3A on > > staa tctl2,y > > bclr tflg1,y $fe ; IC3F cleared > > brclr tflg1,y $01 * ; Loop until flag set > > > > IC4: > > > > ldy #$1000 > > bset pactl,y $04 ; set IC4/OC5 = 1 > > ldaa #$40 ; EDG4A on > > staa tctl2,y > > bclr tflg1,y $f7 ; IC4F cleared > > brclr tflg1,y $08 * ; Loop until flag set > > > > Can anyone tell me what is wrong? Thanks. > |