ZX-1280 Devlopment board external RAM

Discussion specific to the ZX-1281 and ZX-1280 microcontrollers as well as the ZX-1281 and ZX-1280 Dev Boards.
Post Reply
jay
Posts: 37
Joined: 08 July 2006, 13:58 PM
Location: Vermont, USA

ZX-1280 Devlopment board external RAM

Post by jay »

Morning,
Received my ZX-1280 Dev Board yesterday and am having problem accessing the external RAM. J30-J33 are installed, J16 removed.

Code: Select all

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
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ZX-1280 Devlopment board external RAM

Post by dkinzer »

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: Select all

#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
- Don Kinzer
jay
Posts: 37
Joined: 08 July 2006, 13:58 PM
Location: Vermont, USA

ZX-1280 Devlopment board external RAM

Post by jay »

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

Code: Select all

...
Verification complete.
ZBasic v2.6.3
RAM Size is 7552 bytes
ZX1280 says...
        Hello, world
...
...
..jay
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ZX-1280 Devlopment board external RAM

Post by dkinzer »

jay wrote:Just finished loading your test program.
I assume that you modified it to enable external RAM thusly:

Code: Select all

Option ExtRamConfig On
- Don Kinzer
jay
Posts: 37
Joined: 08 July 2006, 13:58 PM
Location: Vermont, USA

Post by jay »

I did.
..jay
jay
Posts: 37
Joined: 08 July 2006, 13:58 PM
Location: Vermont, USA

ZX-1280 Devlopment board external RAM

Post by jay »

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

Code: Select all

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
Post Reply