I hoped that my problem its solved, but is still here.
When i debug and run my program, i cant see changes .(led no light) but when i stop and sart just step prgram evryhting is OK. (mean that LED start lighting. )
;*******************************************************************
;* This stationery serves as the framework for a user application. *
;* For a more comprehensive program that demonstrates the more *
;* advanced functionality of this processor, please see the *
;* demonstration applications, located in the examples *
;* subdirectory of the "Freescale CodeWarrior for HC08" program *
;* directory. *
;*******************************************************************
; Include derivative-specific definitions
INCLUDE 'derivative.inc'
; export symbols
XDEF _Startup, main
XDEF tlacidlo_ISR, main
; XDEF hodiny,main
; we export both '_Startup' and 'main' as symbols. Either can
; be referenced in the linker .prm file or from C/C++ later on
XREF __SEG_END_SSTACK ; symbol defined by the linker for the end of the stack
; variable/data section
MY_ZEROPAGE: SECTION SHORT ; Insert here your data definition
; code section
MyCode: SECTION
;prerusenie tlacidlom zmena lediek .... na konci naspet povoli prerusenie myslim overit
tlacidlo_ISR: BRSET 5,PTBD,L2
BCLR 7,PTBD
BSET 5,PTBD
BSET 2,IRQSC
RTI
L2: BCLR 5,PTBD
BSET 7,PTBD
BSET 2,IRQSC
RTI
; zacoatok hlavneho programu
main:
_Startup:
; inicializacia
LDHX #__SEG_END_SSTACK ; initialize the stack pointer
TXS
CLI
LDA #$13
STA SOPT1 ; enable interrupts
; nastavenie portu B3-7 ako vystup
LDA #$F8 ; ak dam iba $Fo tak mi do A zapise hodnotu z pamet miesta F0
STA PTBDD
LDA #$E0
STA PTADD
; nastavenie prerusenia tlacidla
BCLR 5,IRQSC ; PADAJUCA HRANA
BSET 4,IRQSC ; IRQ pin enable
BSET 1,IRQSC ; IRQ hardware interrupt request whenever IRQF = 1
; NASTAVENIE HODIN INTERNE HODINY POTREBNE K AD PREVODNIKU NA NASTAVENIE RYCHLISTI PREVODU
Hodiny:
; nahranie toho NVI... nieco treba to odlozit ICGTRM,NVICGTRM
LDA $FFBE
STA $3E
LDA #$28
STA ICGC1
LDA #$51
STA ICGC2
BRCLR 3,ICGS1,Hodiny
; nastavenie ad prevodnika
LDA #$60 ;60
STA ADCCFG ;mo, bez clock divide, short sample, 8 bit , bus clock
LDA #$00
STA ADCSC2
;LDA #$01
;STA APCTL1
mainLoop:
; Insert your code here
LDA #$20 ; set AC convertor
STA ADCSC1
BRCLR 7,ADCSC1,mainLoop ; wait until conversion is complete
LDA $13 ; load Data results low register
STA ,X
AND #$E0
STA $00 ;set data results register like outputs for PTAD
LDA ,X
AND #$F8
STA $02 ; set data results register like outputs for PTBD
feed_watchdog
BRA mainLoop
Thx