Mark 32 Mhz:
Setup:
[code:1:66b66bdb52]
$regfile = "xm128a3def.dat"
$crystal = 32000000
$hwstack = 800
$swstack = 800
$framesize = 600
'include the following lib and code, the routines will be replaced since they are a workaround
$lib "xmega.lib"
$external _xmegafix_clear
$external _xmegafix_rol_r1014
'Config Priority = Static , Vector = Application , Lo = Enabled
Config Priority = Static , Vector = Application , Lo = Enabled , Med = Enabled , hi = enabled
''$timeout = 8000000 ''TIMEOUT WILL WORK FOR ALL UARTS
'first enable the osc of your choice
Config Osc = Enabled , 32mhzosc = Enabled
'configure the systemclock
Config Sysclock = 32mhz , Prescalea = 1 , Prescalebc = 1_1
[/code:1:66b66bdb52]
Using the same setup the assembler based code does it in 24 uS.
So everything is the same compared to the bas file uploaded in earlier post (only the 400 subroutine is modified with the BASIC loop).
I already tried what MWS is saying after Marks's first post regarding the excessive NOPs and concluded that the waitus in not going to work.
FYI: I inserted a waitus 1 instead of the many NOPs (in original assembler code), the created delay was still too long, the dataframe wil go above 30 uS
Jim
↧