First time programming error

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

First time programming error

4,819 Views
Fraz
Contributor I
hi all,
 
im doing this for the first time so take it easy on me, but i am programming a HC08QY1CP chip using PE micro software ( as this is what we used in uni ).  When i am trying to burn the program to chip i get the error "error at address $FFDE , byte in module is $FE and should be $F8"  i think it must have something to do with where i have declared Ram and Rom etc.  It is just a very simple progrom just to see it working then i can advance with it. 
 
i do not know what this error means ill include my wee simple program and if anythign jumps out as being wrong could you let me know thanks.
 

 

 

 

$include "qtqy_registers.inc"

 

RamStart           EQU $0080

RomStart           EQU $F800

VectorStart        EQU $FFDE

 

       org RamStart

 

; define variables in RAM - none needed here

 

       org RomStart

 

start: ; execution starts here

 

 

 mov #%00110001,CONFIG1 ; disable low-voltage interrupt,

; watchdog timer and STOP instruction

 mov #%00000000,CONFIG2 ; select internal oscillator,

; disable _IRQ and _RST pins

; configure ports

; port A inputs by default

 mov #%01111111,DDRB ; set bits 0-6 of port B to outputs

 

       mov #%01010101,PORTB ; light alternate LEDs

infLoop:

       bra infLoop ; infinite loop, does nothing

 

  org VectorStart ; reset and interrupt vectors

 

  dw Start ; keyboard interrupt

  dw Start

 

  org $FFF2

 

  dw Start ; timer overflow interrupt

  dw Start ; timer channel 1

  dw Start ; timer channel 0

 

  org $FFFA

 

  dw Start ; interrupt request (_IRQ pin)

  dw Start ; software interrupt (SWI instruction)

  dw Start ; reset (power-on or _RST pin)

 

 

 
Labels (1)
0 Kudos
4 Replies

496 Views
rocco
Senior Contributor II
And also check that the clock rate is right for programming.

The error that you received is a program-verify error. I believe that it programmed address $FFDE to an $F8, but read back an $FE when it tried to verify.
0 Kudos

496 Views
Fraz
Contributor I

sorry i completly scrwed up and chose the wrong chip...doh ! got it wokring now but whilst im here ill show you my next problem see if you can tell me wot be wrong !  The program is supposed to display a different led for each button pressed and the led will stay on until another button is pressed, i cant see any problem with it but then again im a bit of a noob.  Any ideas? cant get any leds to light up at all.

cheers Fraser

 

Message Edited by Fraz on 03-24-200604:55 PM

Message Edited by Fraz on 03-24-200604:55 PM

Message Edited by Fraz on 03-24-200604:58 PM

0 Kudos

496 Views
rocco
Senior Contributor II
Hi, Fraser:

OK, but where's the schematic? ;8)

If the other end of the LEDs are wired to +5v (the historic way), than you need to BCLR in order to make an LED come on.

Also, once an LED is on, nothing ever turns it off. Rather than a BCLR 3,PORTB (if that's what it needs), maybe a MOV #%11110111 (but in symbolic form) would be more appropriate.

Another also, all except the last "bra InfLoop" are unnecessary, and prevent the loop from testing other buttons once it finds one that is down.

Hope that helps

Message Edited by rocco on 03-24-200605:01 PM

0 Kudos

496 Views
joerg
Contributor II
Hi
what programmer do you use?
For trying to programm the device have a look at the attacement. Simply change the ROM Adress (it is written (and prooved) with a QY4 device.

Saluti joe rg
0 Kudos