Hi, straight to the point, i'm working on my digital clock project using Flite 68k microprocessor. About a week now thinking what is wrong with my coding. The problem is as i run the coding it will state *** ADDRESS ERROR - ACCESS = 00400587 . Im a newbie,so did i miss something basic here? Tq.

8 Years
Discussion Span
Last Post by Colin Mac

Are you trying to move a word or a long value to that address?

A number of modern processors do not allow you to store multi-byte values (such as a 32-bit int) on an odd address.


yes.. i try to move $18, for seven segment display. Did not have any address error when i move $3F. I'm very confused.


So $3F was stored at 00400586 ?

Did you do a mov.b ?

Perhaps you should also look at your documentation to see which addresses are actually valid for your 7-seg display.

It's not necessarily guaranteed that consecutive segments of your display are mapped to consecutive memory addresses.


Yes,it stored in that address.
I use move.b for both $3F and $18
I actually tested each segment for that very reason.


move.b #$18,PBDR

the seven segment will display 0
but as I write the value in the display table it state address error


I think the only thing to do at the moment is check the definitions of things like PBDR with the actual hardware.

Another reason for address errors is that there is no memory at the given address.

Another possible reason is that all the segments are at the same address, and it takes several writes (possibly with delays between writes) to the same address to set each digit in turn.

Does the hardware you're using (complete with 7-seg displays) have a specification / data sheet on the web somewhere?

Without specific hardware details (and more than 1 line of code), I can't say much else.


Owh.. sorry.. here i attach the programming and hardware schematic. I think there is no problem with the hardware but take a look at it.

Org	$400400


PGCR	equ   	$800001
PBDDR    equ	PGCR+$6
PADR	equ	PGCR+$10
PBDR	equ	PGCR+$12

****Initialize PI/T****

Init	Move.b		#$00,PGCR
	Move.b		#$80,PACR ;setting submode 1X for Port A
	Move.b		#$80,PBCR  ;setting submode 1X for Port B
	Move.b		#$3F,PADDR ;declare Port A, bit 0 until bit 5 outputs, others are inputs
	Move.b		#$FF,PBDDR ;declare Port B, all are outputs
	movea.l		Second1,A0
	Movea.l		Second2,A1
	Movea.l		Minute1,A2
	Movea.l		Minute2,A3
	Movea.l		Hour1,A4
	Movea.l		Hour2,A5
	Move.b		#00,D0
	Move.b		#00,D1
	Move.b		#00,D2
	Move.b		#00,D3
	Move.b		#00,D4
	Move.b		#00,D5
	Move.b		#00,D6
	Move.b		#00,D7

Clock   add.b  #01,D0           
           cmpi.b #10,D0
           Bne    Display            

           add.b  #1,D1
           move.b #00,D0
           cmpi.b #6,d1
           Bne    Display

           add.b  #1,D2
           move.b #00,D1
           cmpi.b #10,d2
           Bne    Display

           add.b  #1,D3
           move.b #0,D2
           cmpi.b #6,D3
           bne    Display

           add.b  #1,D4
           move.b #00,D3
           cmpi.b #12,D4
           bne     Display
           add.b  #1,D5
           move.b #00,D4

           Bra     Display

****Digit Display****

Head    	Move.l  #555556,D7 
Display   	Sub.b	#1,D7
	Move.b	#$20,PADR
	Move.b	0(A0,D0),PBDR
	bsr	Delays
	Move.b	#$10,PADR
	Move.b	0(A1,D1),PBDR
	bsr	Delays
	Move.b	#$08,PADR
	Move.b	0(A2,D2),PBDR
	bsr	Delays
	Move.b	#$04,PADR
	Move.b	0(A3,D3),PBDR
	Move.b	#$02,PADR
	Move.b	0(A4,D4),PBDR
	bsr	Delays
	Move.b	#$01,PADR
	Move.b	0(A5,D5),PBDR

	bsr	Delays
	cmpi.b  #0,D7
	bne	Display
        	bra	Clock	


Delays	move.l		#500,D6
Subt	Sub.b		#1,D6
	Bne		Subt

****Digits Table****

Second1   DC.b	$18,$7B,$2C,$29,$4B,$89,$88,$3B,$08,$09
Second2   DC.b	$18,$7B,$2C,$29,$4B,$89
Minute1   DC.b        $18,$7B,$2C,$29,$4B,$89,$88,$3B,$08,$09
Minute2   DC.b  	$18,$7B,$2C,$29,$4B,$89
Hour1     DC.b  	$18,$7B,$2C,$29,$4B,$89,$88,$3B,$08,$09,$18,$7B,$2C
Hour2     DC.b  	$18,$7B,$2C
	end		$400400

Several things you need to check

Move.b	    #$04,PADR
	Move.b	    0(A3,D3),PBDR

	Move.b	    #$02,PADR
	Move.b	    0(A4,D4),PBDR

This is missing bsr Delays

> Head Move.l #555556,D7
As far as I can tell, this is never called.

> bsr Delays
Did you set the stack pointer to point to some usable memory?
Without a meaningful stack pointer, you can't call functions.

> cmpi.b #12,D4
12 seems a rather large number for a single digit.


Oh and I forgot to mention, when you get to 10, you need to reset back to 0 (say, for seconds).
And obviously, when you get to 6 for centi-seconds (and so forth).


Your circuit is wrong. You've no current limiting resistors at the base of the transistors, which causes the chip to drive them at it's maximum output high current, which will cause it to overheat.
BJTs are current controllled, not voltage controlled.

Also, the 68000 output high drops to 2.4V when it's only sourcing 400uA.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.