Matrix Keypad Interfacing

Discussion specific to the 24-pin ZX microcontrollers, e.g. ZX-24r, ZX-24s and ZX-24t.
sselver
Posts: 14
Joined: 26 April 2010, 19:41 PM

zxfastPWM

Post by sselver »

Don,

Indeed, I was using zxfastpwm simply because that setting was used in the tutorial. I'll give the zxcorrectpwm setting a try this evening. Thanks again for the kind (and timely) help!

Sincerely,

Steve Selverston
spamiam
Posts: 739
Joined: 13 November 2005, 6:39 AM

Post by spamiam »

check out the appnote I wrote a few years ago about PWM and related topics. It is a little outdated because ZBasic now will do PWM through its own built-in functions. This appnote tells how to do it manually, but it also details some of the theory and practical aspects of using PWM. For instance, under what circumstances you might not be able to get to 100.00% or 0.00%.

-Tony
sselver
Posts: 14
Joined: 26 April 2010, 19:41 PM

Post by sselver »

Hi Don,

I'm still seeing the same issue with the zxcorrectpwm. I was able to get it working by looping the putdac command, but I'd still prefer to go with the pwm command if possible. Any other tips or suggestions? Thanks again,

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

Post by dkinzer »

sselver wrote:Any other tips or suggestions?
You might look at the output with an oscilloscope, if you have one, to see if there is actually a pulse generated when the value passed calls for zero duty cycle. You could also add code to output the timer register values and check them against what they should be. Tony's application note will be helpful for this purpose.

I'll be able to look into the issue myself early next week.
- Don Kinzer
sselver
Posts: 14
Joined: 26 April 2010, 19:41 PM

3.0 Versus 3.0.1

Post by sselver »

Hello,

I've got a nice working project using the zx24 with a keypad and an lcd. Here's on question though: are there any changes between zbasic 3.0 and zbasic 3.0.1 that involve serial communications? For some reason, the program works fine with a newer chip (3.0.1), but when I try to compile it on a slighly older chip (with 3.0) it won't work. Any ideas?

Thanks

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

Re: 3.0 Versus 3.0.1

Post by dkinzer »

sselver wrote:For some reason, the program works fine with a newer chip (3.0.1), but when I try to compile it on a slighly older chip (with 3.0) it won't work.
The compiler has a version number that is different from but similar to the ZX Library version number (used on native mode devices) and the Virtual Machine version number (used on VM mode devices). I suspect that you're referring to either ZX Library version numbers or VM version numbers. Where do you see the version numbers to which you referred? Also, it may be helpful if you indicate precisely which specific chip you're using (e.g. ZX-24, ZX-24p, ZX-24n, etc.).

The Downloads Page has links to the "recent changes" files for the various components.
- Don Kinzer
sselver
Posts: 14
Joined: 26 April 2010, 19:41 PM

Post by sselver »

Hey Don,

Sorry- both are zx-24p chips. The version number I'm referring to is the one that appears in the debug window immediately after compiling (ex: ZBasic 3.0 and Zbasic 3.0.1. Thanks for the info

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

Post by dkinzer »

sselver wrote:The version number I'm referring to is the one that appears in the debug window immediately after compiling
OK. That is the version number of the VM. In the recent changes, you'll see that there was a problem introduced in v3.0.0 related to the "software UARTs", i.e. channels 3-6. However, I believe that it wasn't fixed until v3.0.4 (the current release).

You can update the VM firmware in the older chip by downloading the .zvm file (see the downloads page) and then using the ZX Firmware Update on the Device Options dialog (accessible via the Options menu). The process is fairly simple but you must be certain that you don't accidentally de-power the device while it is updating or reset it or do anything else that interferes with the communication process. If that does happen, you'll have to perform the emergency update procedure (described in the documentation).
- Don Kinzer
sselver
Posts: 14
Joined: 26 April 2010, 19:41 PM

Post by sselver »

Perfect! That did the trick. Thanks

Steve
Post Reply