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-1280 Devlopment board external RAM

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



Joined: 08 Jul 2006
Posts: 25
Location: Vermont, USA

Posted: 13 December 2008, 15:29 PM    Post subject: ZX-1280 Devlopment board external RAM Reply with quote

Morning,
Received my ZX-1280 Dev Board yesterday and am having problem accessing the external RAM. J30-J33 are installed, J16 removed.
Code:
Option TargetDevice zx1280
Option ExtRamConfig On
Option RAMSize 65536 - Register.RamStart
Sum Main()
Debug.Print "RAMSize=";CStr(Register.RAMSize)
Debug.Print "ExtRAM = "; Cstr(Register.ExtRamConfig)
End Sub

Returns:
ZBasic v2.6.3
RAM Size = 7552
ExtRAM = 128
Allocating and 'filling' an array larger than 7500 bytes causes the ZX-1280 to hang.
Can't see any solder bridges and from the schematic J16 looks OK.
Didn't see anything in the forum or in the docs .. appreciate a pointer to what I might have missed..
Thanks,
..jay
Back to top
dkinzer
Site Admin


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

Posted: 15 December 2008, 2:35 AM    Post subject: Re: ZX-1280 Devlopment board external RAM Reply with quote

jay wrote:
Didn't see anything in the forum or in the docs .. appreciate a pointer to what I might have missed.
The test program should work as you've described the situation. It is possible that there was a failure after the manufacturing test the verifies the RAM circuitry or it could have been a failure of the testing process itself.

The program below is the one that we use to build the two versions of the test code. As written, it produces the final test program. Change the "Option ExtRamConfig" to On for the RAM-enabled version.

If it still is not working, the best course is to send out another one and get that one back so that we can examine it.

Code:
#if Option.ExtRamAble
Option ExtRamConfig Off
#endif

Private msg as StringVectorData({ " says...", "    Hello, world" })
Private device as String

Private Const cmdChar as Byte = &H04

#if Option.TargetCode = "Native"
    Private Const stackSize as Integer = 200
#else
    Private Const stackSize as Integer = 50
#endif

Private taskStack(1 to stackSize) as Byte

Sub Main()
    Dim j as Integer

#if Option.ExtRamAble
    Debug.Print "RAM Size is "; Register.RamSize; " bytes"
#endif

    ' launch the ATN detection task
    CallTask cmdTask, taskStack

    ' get the device identification string
    device = getDeviceID()

    ' loop forever displaying the hello world message
    j = 1
    Do
        Call Hello(j)
    Loop
End Sub

'
'' Hello
'
' This subroutine displays one of two strings depending on the
' passed index (of which only the least significant bit is used).
'
Private Sub Hello(ByRef idx as Integer)
    ' advance the string index and limit its value
    idx = (idx + 1) And 1

    ' display the indexed string, for string 0, add the device identifier prefix
    If (idx = 0) Then
        Debug.Print device;
    End if
    Debug.Print msg(idx + 1)

#if defined(Pin.RedLED) And defined(Pin.GreenLED)
    ' for devices with LEDs, flash the red and green LEDs for a half second each
    Call PutPin(Pin.RedLED, zxOutputLow)
    Call Delay(0.5)
    Call PutPin(Pin.RedLED, zxOutputHigh)
    Call PutPin(Pin.GreenLED, zxOutputLow)
    Call Delay(0.5)
    Call PutPin(Pin.GreenLED, zxOutputHigh)
#else
    ' for devices without LEDs, simply delay for a second
    Call Delay(1.0)
#endif
End Sub

'
'' getDeviceID
'
' Retrieve the device identifer and return it as a string.
'
Private Function getDeviceID() as String
    Dim idLen as Integer
    Dim i as Integer
    Dim id(1 to 10) as Byte

    ' note that the 'id' array will be null terminated
    Call System.DeviceID(id)

    ' determine the length of the identification string
    idLen = 0
    For i = 1 to UBound(id)
        If (id(i) = 0) Then
            Exit For
        End If
        idLen = idLen + 1
    Next i

    ' create a string containing the identification string
    getDeviceID = MakeString(id.DataAddress, idLen)
End Function

'
'' cmdTask
'
' The sole purpose of this task is to check the input queue for the ATN
' character and, when found, invoke the ZX command mode.
'
Sub cmdTask()
    Do
        If (StatusQueue(CByteArray(Register.RxQueue))) Then
            Dim c as Byte
            Call GetQueue(CByteArray(Register.RxQueue), c, 1)
            If (c = cmdChar) Then
                Call ZXCmdMode(False)
            End If
        End If
        Call Sleep(0)
    Loop
End Sub
Back to top
jay



Joined: 08 Jul 2006
Posts: 25
Location: Vermont, USA

Posted: 15 December 2008, 14:57 PM    Post subject: ZX-1280 Devlopment board external RAM Reply with quote

Morning Don,
Just finished loading your test program.
.. it returns:
Code:

...
Verification complete.
ZBasic v2.6.3
RAM Size is 7552 bytes
ZX1280 says...
        Hello, world
...
...


..jay
Back to top
dkinzer
Site Admin


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

Posted: 15 December 2008, 15:22 PM    Post subject: Re: ZX-1280 Devlopment board external RAM Reply with quote

jay wrote:
Just finished loading your test program.
I assume that you modified it to enable external RAM thusly:
Code:
Option ExtRamConfig On
Back to top
jay



Joined: 08 Jul 2006
Posts: 25
Location: Vermont, USA

Posted: 15 December 2008, 16:12 PM    Post subject: Reply with quote

I did.
..jay
Back to top
jay



Joined: 08 Jul 2006
Posts: 25
Location: Vermont, USA

Posted: 18 December 2008, 22:32 PM    Post subject: ZX-1280 Devlopment board external RAM Reply with quote

Don - replacement arrived today. Ran the code you posted on the 14th and everything ran as expected:

Code:
ZX1280 v2.6.3 012e,5516
Downloading file "C:\zbasic\New Folder\zx1280test.zxb":
........................
Download complete.
Verifying download:
........................
Verification complete.
ZBasic v2.6.3
RAM Size is 64384 bytes
ZX1280 says...
    Hello, world

Thanks for your super support,
jay
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-2013 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