index addressing

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

index addressing

377 Views
lucostiguy
Contributor I

hi i wrote a little program to generate a square wave at around 5khz. using codewarior 5.9 and indexed addressing, everything is working ok. But when i program my 68hc908qt4 the frequency is around 113hz. The only way i can have 5khz is to use extended addressing. Why ???

1 Reply

319 Views
kef2
Senior Contributor IV

Looks like you put constants to .. RAM:

                org $00d0
 
pulse_cnt       dc.w  $3e7f,$1f3f,$14d5,$0f9f,$0c80,$0a6a,$08ed,$07cf,$06f1,$0640
                dc.w  $042a,$0320,$0280,$0215,$01c9,$0190,$0163
pulse_cnt_max   dc.w  $0140

Who do you think will initialize them when powered up standalone? Random values in RAM could easily produce 113Hz

Edward