AnsweredAssumed Answered

lcd control in assembly

Question asked by Maska Maska on Mar 6, 2007
Latest reply on Mar 11, 2007 by bigmac
Hello!

I'm writing a code on assembly which will display on LCD, model HD44780 something, but I've faced the problem which I can't solve...
I am writing to program MC68HC908QB8, version of CodeWarrior IDE: 5.7.0.
When I debug it CW displays the error:

L1119: Vector allocated at absolute address 0xFFFE overlaps with sections placed in segment .absSeg1"


Ok, the code:

main.asm file:
INCLUDE 'derivative.inc'
INCLUDE 'lcd1.inc'

; export symbols
XDEF _Startup, main

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
main:
_Startup:
LDHX #__SEG_END_SSTACK ; initialize the stack pointer
TXS
CLI ; enable interrupts

mainLoop:

LCD: EQU PTB

org $F800

START MOV #$3B, CONFIG1
JSR LCD4SET
LDHX #TEXT1
JSR LINIA14
BRA $

TEXT1: dc.b "SOMETHING"

org $FFFE
DC.W START

NOP

feed_watchdog
BRA mainLoop



lcd1.inc file:
E: equ 6
RS: equ 4
RW: equ 5

ImpulsE: macro
BSET E,LCD
BCLR E,LCD
endm

LCD4SET: BCLR E,LCD
MOV #$7F, LCD+4
LDA #150
JSR L_CZEKA
MOV #$03, LCD
ImpulsE
LDA #41
JSR L_CZEKA
ImpulsE
LDA #1
JSR L_CZEKA
ImpulsE
MOV #$02,LCD
ImpulsE
LDA #$28
JSR LCD4WRR
LDA #$0C
JSR LCD4WRR
LDA #$06
JSR LCD4WRR
RTS

LINIA14 LDA #$80
BRA LINIA_4
LINIA_4 JSR LCD4WRR

LCD4WRD JSR LCD4BF
PSHA
NSA
AND #$0F
STA LCD
BSET RS,LCD
ImpulsE
PULA
AND #$0F
STA LCD
BSET RS,LCD
ImpulsE
RTS

LCD4WRR JSR LCD4BF
PSHA
NSA
AND #$0F
STA LCD
ImpulsE
PULA
AND #$0F
STA LCD
ImpulsE
RTS

LCD4BF MOV #$70,LCD+4
BSET RW,LCD
BCLR RS,LCD
BSET E,LCD
BRSET 3,LCD,* ////////!!!! originally it should be BRSET 3,LCD,$ but the debugger
///////!!!! wrote that there's the error at the end of expression so I've changed it...
BCLR E,LCD
ImpulsE
MOV #$7F, LCD+4
RTS

L_CZEKA AIS #-2
STA 1,SP


Anyone know whats the problem and can explain me how it should be written? Thx in advance!

Outcomes