Forum Index
HomeZBasic Home   Forum RulesForum Rules   Forum FAQForum FAQ   MemberlistMemberlist   UsergroupsUsergroups   RSS FeedRSS Feed
Site SearchSite Search   LinksLinks   DownloadDownload   Digests and SubscriptionsDigests and Subscriptions
ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in   RegisterRegister
ZX-1281 Demo Software

 
Post new topic   Reply to topic    Forum Index -> ZX-1281
Author Message
ktomecek



Joined: 21 May 2007
Posts: 4

Posted: 21 May 2007, 19:34 PM    Post subject: ZX-1281 Demo Software Reply with quote

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
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 21 May 2007, 22:37 PM    Post subject: Reply with quote

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.

Code:
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


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:
'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
Back to top
ktomecek



Joined: 21 May 2007
Posts: 4

Posted: 21 May 2007, 23:12 PM    Post subject: Reply with quote

Don,
That was perfect! Just what the doctor ordered. Explained a lot (without you realizing it!).

Thanks for the kickstart....

Regards,
Karl
Back to top
joelmock



Joined: 23 May 2007
Posts: 3

Posted: 23 May 2007, 18:19 PM    Post subject: ZX-1281 Demo Code Reply with quote

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?
Back to top
ktomecek



Joined: 21 May 2007
Posts: 4

Posted: 23 May 2007, 18:29 PM    Post subject: Reply with quote

Joel,
I am certainly no expert on this, but the reason is you have to click on Options, then Device Options and make sure the target device is set to ZX-1281.

Regards,
Karl
Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Posts: 2499
Location: Portland, OR

Posted: 23 May 2007, 18:33 PM    Post subject: Re: ZX-1281 Demo Code Reply with quote

joelmock wrote:
I get the following error:
Code:
myproj.bas:1: Error: reference to undefined identifier "F.0"

Any ideas?

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.

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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-1281 Time synchro. with the server - Timezone/DST with your computer
Page 1 of 1

 


All content Copyright © 2005-2012 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group