Why do I get the this error - "Read from unprogrammed EEPROM address"

Mu Code for HC12 is given below :

USER_STACKTOP equ $0a00 ;just above RAM area PORTA equ $0000 ;Port A register PORTB equ $0001 ;Port B register PORTP equ $0056 ;Port P register DDRA equ $0002 ;Port A Data Direction Register DDRB equ $0003 ;Port B Data Direction Register DDRP equ $0057 ;Port P Data Direction Register INTCR equ $001e ;Interrupt Control Register COPCTL equ $0016 ;COP Control Register TIOS equ $0080 ;Timer Input Capture/Output Compare Select TSCR equ $0086 ;Timer System Control Register TCTL1 equ $0088 ;Timer Control Register 1 TMSK1 equ $008c ;Timer Interrupt Mask 1 TMSK2 equ $008d ;Timer Interrupt Mask 2 TCNT equ $0084 ;Timer Counter TC7 equ $009e ;Timer Input Capture/Output Compare Register 7 TFLG1 equ $008e ;Timer Interrupt Flag 1

org $0800 start clr COPCTL lds #USER_STACKTOP movb #$00,DDRA ;make Port A all inputs movb #$ff,DDRB ;make Port B all outputs movb #$00,DDRP ;make Port P all inputs movb #$00,PORTB ;clear Port B movb #$80,TIOS ;Set Timer 7 to output compare movb #$05,TMSK2 ;Prescalar = /32 = 250KHz clock movb #$40,TCTL1 ;Set Timer 7 output to toggle movb #$80,TMSK1 ;Enable interrupt for Timer 7 output compare

;Set up Timer counter to output at 50ms intervals ldd TCNT ;Load Timer Counter into D addd T7RATE ;Add T7RATE to D std TC7 ;Store D to TC7H movb #$80,TSCR ;Enables timers movb #$C0,INTCR ;enables IRQ interrupt

cli ;clear interrupt mask - enable interrupts

backgnd nop bra backgnd

Timer7IRQ: ldab TFLG1 ;just to read it ldab #$80 ;clear C7F in TFLG1 stab TFLG1 ldd TCNT ;get entire TCNT at time of ;external hi-to-low pulse staa PORTB ;display hi-order TCNT

ldd TCNT ;Load Timer Counter into D addd T7RATE ;Add T7RATE to D std TC7 ;Store D to TC7H

rti

IRQ_ISR: ldab INT_COUNT ;load data incb ;increment data stab INT_COUNT ;store data rti ;return from interrupt

org $0900 flags dc.b $ff INT_COUNT dc.b $00 ;Data element to increment in interrupt T7RATE dc.w $30D4 ;Rate of T7 Interrupts org $0b20 dc.w Timer7IRQ

org $0b32 dc.w IRQ_ISR

--------------------------------------- This message was sent using the comp.arch.embedded web interface on

formatting link

Reply to
alex99
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.