I used two Options, TargetDevice and ClockFrequency
It worked
I deleted 90% of the program to look at a simple LED Chaser.
I retained the two Options above.
The compiler now gives me a SetBits Error, and after closer scrutiny it appears that it is trying to compile for the ZX-24, not for the Xmega64A1.
I'm not sure why it doesn't capture the target device from the Options Instruction.
Guidance appreciated, as always!
I am getting an Error Message using SetBits():
Extracted from a slightly longer program:
Code: Select all
option TargetDevice ATXmega64A1 'Define the micros
option DeviceParameter ClockFrequency 2000000 'Xmega Clock Freq, Default 2 MHz
Dim J As Byte
Dim D As Byte 'LCD Chaser LED Counter
Dim Lc As Byte 'LED Chaser Counter
Sub called from Main:
Code: Select all
Sub Ledflash2()
'LED Chaser for the Eight Port F LEDs.
'Uses Exponential for Bit Chaser.
J = 0 'Init bit pattern
For Lc = 1 To 10 'Do 10 LED Chases
For D = 0 To 7 'Loop Counter for 1 Chase
J = 2 ^ D 'Single bit riples high
Call SetBits(Register.PortF, &HFF, J)
Call Delay(0.05)
Next D
Next Lc
End Sub
>"C:\Program Files (x86)\ZBasic\zbasic.exe" --target-device=ZX24 --directory="C:\Users\Jay\Desktop\ZBasic Compiler Beta\ZBasic Progs\Char LCD Driver/" "ZBasic XMega Test SetBits V1.bas"
ZBasic XMega Test SetBits V1.bas:218: Error: reference to undefined identifier "Register.PortF"
1 error.
>Exit code: 1
JC