Hi Jozef,
I tested your code on our board and everything works fine on my side.
ComPort equ PTT
; variable/data section
MY_EXTENDED_RAM: SECTION
StartAddr ds.l 1
EndAddr ds.l 1
EndlessLoop:
LD D6, #$01234567 ;Start
ST D6, StartAddr ;Start
LD D6, #$76543210 ;End
ST D6, EndAddr ;end
; now StartAddr contains 0x01234567 and EndAddr contains 0x76543210
MOV.B ComPort,StartAddr+1
MOV.B ComPort,StartAddr+2
MOV.B ComPort,StartAddr+3
MOV.B ComPort,EndAddr+1
MOV.B ComPort,EndAddr+2
MOV.B ComPort,EndAddr+3
; since PTT has stable 0x00 value, it rewrites lowest 3 bytes from StartAddr and EndAddr addresses.
; now StartAddr contains 0x01000000 and EndAddr contains 0x76000000
LD D7,StartAddr ;Load Start
; now D7 contains 0x01000000
; when I comment out MOV.B instructions, D7 will contains 0x01234567
Could you please check whether described behavior is expected for your application?
Please check whether port T is in input mode (DDRTx=0).
Please check whether some of the pins are not affected by any externally connected circuit or whether they are not dedicated to any other function like timer (if you use output compare channels, please disconnect timer from pins by OCPD register)
The opcode for LD D7,StartAddr command is 0xB7001104 (StartAddr starts at address 0x1104).
Could you please check opcode on your side?
I hope it helps you.
Have a great day,
Radek
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------