Page 1 of 1

328n PulseOut

Posted: 05 April 2012, 1:14 AM
by kurakaira
i can't get PulseOut to work on my 328n . ( v. 3.3.5 )

If i remove the OpenCom , then the PulseOut works ...
Why is this ?

Code: Select all

Option TargetDevice ZX328n

Dim lcd_out(1 to 150) as byte
Dim lcd_in(1 to 14) as byte  

Sub Main()

  Call PutPin(13, 0)

  Call OpenQueue(lcd_out, 150)
  Call OpenQueue(lcd_in, 14)
  Call DefineCom(3, 0, 17, &H88) 
  Call OpenCom(3, 19200, lcd_in, lcd_out)
  Call Delay(0.2)

  Do
    Call PulseOut(13, 0.0015, 1)  ' 1.5ms
    Call Delay(0.02)
  Loop
End Sub

Re: 328n PulseOut

Posted: 05 April 2012, 7:55 AM
by dkinzer
kurakaira wrote:Why is this ?
There appears to be a problem, of as yet known origin, that causes the TimerBusy semaphores to be set incorrectly. Because Register.Timer1Busy is erroneously set to True, the PulseOut() code, which needs to use Timer1, returns immediately without doing anything. You can work around the problem by adding the line of code below after the OpenCom(3,...) call and before the PulseOut() call.

Code: Select all

	Register.Timer1Busy = False

Posted: 05 April 2012, 13:56 PM
by dkinzer
The source of the problem was relatively simple to locate and correct. A new version of the ZBasic System Library, v3.3.6, was generated to incorporate the change. You can install just the updated ZBasic System Library or you can download and run the latest installer. Both can be found on the Downloads Page.

Posted: 09 April 2012, 0:10 AM
by kurakaira
Thank You !
This is what makes ZX the best , someone cares about it and really want's to make it better .

Posted: 11 April 2012, 3:56 AM
by FFMan
couldn't agree more

great devices and top level support