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
Hardware SPI hangs on ZX-24x

 
Post new topic   Reply to topic    Forum Index -> ZX-24
Author Message
coopecb1



Joined: 18 May 2011
Posts: 8

Posted: 27 May 2011, 22:00 PM    Post subject: Hardware SPI hangs on ZX-24x Reply with quote

Using software SPI works fine:

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

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


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

Posted: 28 May 2011, 16:10 PM    Post subject: Re: Hardware SPI hangs on ZX-24x Reply with quote

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.

http://www.zbasic.net/download/zlib/3.3/zlib_3-3-2_xmega.zip
Back to top
coopecb1



Joined: 18 May 2011
Posts: 8

Posted: 31 May 2011, 20:31 PM    Post subject: Reply with quote

Once again, thanks for getting to this so quickly, and on a holiday weekend at that!

I have to wonder, am I the first user of the 24x? At least for these functions?
Back to top
dkinzer
Site Admin


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

Posted: 31 May 2011, 21:17 PM    Post subject: Reply with quote

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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Forum Index -> ZX-24 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