ZX24N Demo program for timer interrupt driven stepper motor

Here you can share completed projects or parts of projects that may be useful to others. You may post files relevant to ZBasic - source code, schematics, etc.
Post Reply
spamiam
Posts: 739
Joined: 13 November 2005, 6:39 AM

ZX24N Demo program for timer interrupt driven stepper motor

Post by spamiam »

I have written a simple, demonstration program showing how to set up a timer and use the timer interrupt. The application of this technique is a crude stepper motor driver.

The program uses several programming techniques to access the ZX hardware directly. This topic was discussed in some depth in AppNote AN-216, although on different hardware. So the specifics of what bits get set and where they are set will be different for the ATMega644P. The technique will be applicable to ALL native mode devices.

Actually, the technique is applicable to all ZX devices in total, but the timer interrupt is only accessible in the native mode devices.

-Tony

P.S. ZBasic makes accessing the interrupts UNBELIEVABLY easy compared to C!!!
Attachments
Steper_Nat_Int.zip
ZIP file with the necessary program elements
(3.48 KiB) Downloaded 3460 times
dkinzer
Site Admin
Posts: 3120
Joined: 03 September 2005, 13:53 PM
Location: Portland, OR

Re: ZX24N Demo program for timer interrupt driven stepper mo

Post by dkinzer »

spamiam wrote:ZBasic makes accessing the interrupts UNBELIEVABLY easy compared to C!!!
I thought that they were fairly comparable. In what ways do you consider it being easier?
- Don Kinzer
spamiam
Posts: 739
Joined: 13 November 2005, 6:39 AM

Re: ZX24N Demo program for timer interrupt driven stepper mo

Post by spamiam »

dkinzer wrote:
spamiam wrote:ZBasic makes accessing the interrupts UNBELIEVABLY easy compared to C!!!
I thought that they were fairly comparable. In what ways do you consider it being easier?
Well, when you know what you are doing, it is not all that bad to do in C, but the name for each interrupt is cryptic, and not very intuitive (although it has improved), and it is hard to find a document to get the name of the interrupts. Or maybe I just don't know where to look. I usually have to find it in the IOM file for the specific device, which is not easily found either.

In earlier incarnations there were two types of interrupt handlers, one of them called "INTERRUPT" was not actually the one you should routinely use!

Anyway, it can't get easier than the ZBasic method, methinks.

-Tony
Post Reply