GetADC issue with ZX-24n

Discussion of issues related specifically to writing code for native mode devices. This includes ZBasic code as well as assembly language code and C code, both inline and standalone.
Post Reply
dkg
Posts: 3
Joined: 25 February 2013, 9:57 AM

GetADC issue with ZX-24n

Post by dkg »

Hello,

I am having a problem reading ADC values on the ZX-24n using the Compiler 4.1.3. The code below compiles fine on Ver 4.1.3 and Version 3.3.3, but only Ver 3.3.3 gives me non-zero readings for output when run.

Option TargetDevice ZX24n

Dim I20 as Integer, I19 as Integer, I18 as Integer

Sub Main()

Call PutPin(20,zxInputTriState)
Call PutPin(19,zxInputTriState)
Call PutPin(18,zxInputTriState)


Do


I20=GetADC(20)
I19=GetADC(19)
I18=GetADC(18)

Debug.Print "I20=" + Cstr(I20) + " I19=" + Cstr(I19) + " I18=" + Cstr(I18)

Sleep(1.0)

Loop


End Sub


Any idea on what is going wrong? Thanks for the help.

Don G
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: GetADC issue with ZX-24n

Post by dkinzer »

dkg wrote:I am having a problem reading ADC values on the ZX-24n using the Compiler 4.1.3. [...] Any idea on what is going wrong?
You've run into an issue, previously undetected, that was introduced very recently. We've posted a partial update with the correction for the ZX-24n, ZX-24s and other native mode devices based on the mega644P and mega1284P. Extract the contents of the archive to the ZBasic installation directory (preserving path names). The archive contains only the change history file and the library files libmega644P.a and libmega1284P.a.

A full update will follow within the next few days.
- Don Kinzer
Post Reply