328n PulseOut

Discussion specific to the DIP and TQFP packaged ZX devices like the ZX-40, ZX-44, ZX-32 and ZX-328 series. The differences between these devices is primarily the packaging and pinout so most issues will apply to all devices.
Post Reply
kurakaira
Posts: 77
Joined: 21 March 2007, 1:21 AM
Location: Finland

328n PulseOut

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

Re: 328n PulseOut

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

Post 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.
- Don Kinzer
kurakaira
Posts: 77
Joined: 21 March 2007, 1:21 AM
Location: Finland

Post by kurakaira »

Thank You !
This is what makes ZX the best , someone cares about it and really want's to make it better .
FFMan
Posts: 502
Joined: 09 January 2010, 12:52 PM

Post by FFMan »

couldn't agree more

great devices and top level support
Post Reply