Hello folks. I just got my ZX-1281. It looks great! I only wish there was a demo I could run on it to confirm it is alive and well (make the Led's flash, or something). The IDE sees it and properly identifies it. But I would like some confirmation. Any ideas?
Thanks,
Karl Tomecek
ZX-1281 Demo Software
The ZX-1281 Development board doesn't have any LEDs to flash but you can write a program that does some simple things. For example, if you have an oscilloscope or logic analyzer you could create a simple program that toggles an I/O pin. The code below will toggle bit 0 of Port F, for example. You could connect an LED/resistor combination between +5 and pin to get a visual effect but you'll need to put a Delay() call in the loop. This will be easier if you have a solderless breadboard and you've installed the SIP sockets in the dev board.
The program below is similar to that which is installed on the ZX-1281 prior to it being shipped. If you uncomment the external RAM configuration option you'll see that it reports a larger RAM size (assuming that the "disable" jumper is not in place).
Code: Select all
Const pin as Byte = F.0
Sub Main()
Dim state as Byte
state = 0
Do
Call PutPin(pin, state)
state = state Xor 1
Loop
End Sub
Code: Select all
'Option ExtRamConfig On
Dim b as Byte
Dim id(1 to 10) as Byte
Dim idStr as String
Sub Main()
Dim j as Integer
Call System.DeviceID(id)
For j = 1 to UBound(id)
If (id(j) = 0) Then
j = j - 1
Exit For
End if
Next j
If (j >= UBound(id)) Then
j = 6
End If
idStr = MakeString(id.DataAddress, j)
j = 0
Debug.Print "RAM Size = "; CStr(Register.RamSize)
Do
Call Hello(j)
j = (j + 1) And 1
Loop
End Sub
Sub Hello(ByVal idx as Integer)
If (idx = 0) Then
Debug.Print idStr; " says..."
Else
Debug.Print " Hello, world"
End If
Call Delay(1.0)
End Sub
- Don Kinzer
ZX-1281 Demo Code
When I attempt to run the sample code listed:
Const pin as Byte = F.0
Sub Main()
Dim state as Byte
state = 0
Do
Call PutPin(pin, state)
state = state Xor 1
Loop
End Sub
I get the following error:
myproj.bas:1: Error: reference to undefined identifier "F.0"
1 error.
Any ideas?
Const pin as Byte = F.0
Sub Main()
Dim state as Byte
state = 0
Do
Call PutPin(pin, state)
state = state Xor 1
Loop
End Sub
I get the following error:
myproj.bas:1: Error: reference to undefined identifier "F.0"
1 error.
Any ideas?
Re: ZX-1281 Demo Code
Most likely, this is because the wrong ZX device is selected as the target. The default target device is the ZX-24. It has no port F so the reference F.0 is invalid.joelmock wrote:I get the following error:Any ideas?Code: Select all
myproj.bas:1: Error: reference to undefined identifier "F.0"
If you are using the IDE, you select the target device using the dialog reached by selecting "Device Options..." from the Options menu. I suspect that if you select ZX-1281 as the target device the error no longer occur.
- Don Kinzer