Option TargetDevice ZX24x
Sub Main()
Dim odata(1 to 2) as Byte
Dim idata(1 to 2) as Byte
Dim SPIMode as Integer
SPIMode = 16
Call DefineSPI(9,10,11)
Call OpenSPI(1,SPIMode,12)
do
odata(1) = &HA5
odata(2) = &H77
Debug.Print "Got to here 1"
Call SPICmd(1,2,odata,0,idata)
Debug.Print "Got to here 2"
Call Sleep(0.1)
loop
End Sub
The following hangs at SPICmd. CS goes low once and stays there:
Option TargetDevice ZX24x
Sub Main()
Dim odata(1 to 2) as Byte
Dim idata(1 to 2) as Byte
Dim SPIMode as Integer
SPIMode = 0
Call OpenSPI(1,SPIMode,12)
do
odata(1) = &HA5
odata(2) = &H77
Debug.Print "Got to here 1"
Call SPICmd(1,2,odata,0,idata)
Debug.Print "Got to here 2"
Call Sleep(0.1)
loop
End Sub
This is using ZBasic with the patch you sent me (3.3.1) that has the ADC fix for the 24x.
coopecb1 wrote:The following hangs at SPICmd. CS goes low once and stays there:
The source of the problem has been found and corrected; it only affects xmega-based ZX devices. You can download an updated partial set of ZBasic Library files via the link below. The contents of the downloaded archive should be extracted (preserving path prefixes) to the zlib subdirectory of the ZBasic installation directory. When you're finished you should find two files with today's date in the zlib\avr\lib subdirectory. Re-compiling your code should then produce the correct result.
coopecb1 wrote:I have to wonder, am I the first user of the 24x?
Of course, not everyone uses the same set of System Library routines. As much as we try to test thoroughly, we don't test every possible program so problems are bound to arise. We don't promise to deliver perfect code (no one can, of course). We do, however, endeavor to correct problems that do arise as quickly as possible.