Kaiser48
Joined: 04 Feb 2005 Posts: 18 Location: Berlin
|
Posted: Wed Oct 29, 2014 8:44 pm Post subject: problem with xmega xram ebi |
|
|
Hi all,
my first steps with Xmega128A1 are not very successful.
I wrote a little bit of code to write data to an external device with a databus of 8 bit and an addressbus with also 8 bits.
But what ever i am trying to config for xram, nothing happens at the Ports J, K and H ! What's going wrong?
Thank' for your help!
That's my code:
[$regfile = "xm128a1def.dat"
$crystal = 8000000 '8MHz
$hwstack = 64
$swstack = 40
$framesize = 40
$lib "xmega.lib"
$external _xmegafix_clear
$external _xmegafix_rol_r1014
Config Osc = Enabled, 32mhzosc = Enabled 'We use internal 32MHz
Config Sysclock = 32mhz , Prescalea = 4 , Prescalebc = 1_1 'Internal 32MHz, prescaler = 4
CONFIG XRAM=3PORT, MODESEL0=SRAM, ADRSIZE0=256b, BASEADR0=&h2000, ALE=ALE1, WAITSTATE0=4
$xramsize = &h8000
waitms 1
Dim B As Byte
Porth_dirset = &B1111_1111 : Porth = &B1111_0011 'WR, RD, ALE1, ALE2, CS0-3 = output : ALE1 & 2 auf 0 !!!
Portj_dirset = &B1111_1111 : Portj = &B1111_1111
Portk_dirset = &B1111_1111 : Portk = &B1111_1111
B = 0
Do
Incr B
Out &h2001 , B
Waitus 1
OUT &h2003 , B
Waitus 1
Loop
End
]
(BASCOM-AVR version : 2.0.7.7 ) |
|