Forum Index
ZX24N Demo program for timer interrupt driven stepper motor

 
Author Message
spamiam



Joined: 13 Nov 2005

Posted: 14 August 2008, 2:41 AM    Post subject: ZX24N Demo program for timer interrupt driven stepper motor

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!!!



Steper_Nat_Int.zip
 Description:
ZIP file with the necessary program elements

Download
 Filename:  Steper_Nat_Int.zip
 Filesize:  3.48 KB
 Downloaded:  1301 Time(s)

Back to top
dkinzer
Site Admin


Joined: 03 Sep 2005
Location: Portland, OR

Posted: 15 August 2008, 2:22 AM    Post subject: Re: ZX24N Demo program for timer interrupt driven stepper mo

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?
Back to top
spamiam



Joined: 13 Nov 2005

Posted: 15 August 2008, 3:21 AM    Post subject: Re: ZX24N Demo program for timer interrupt driven stepper mo

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
Back to top
Display posts from previous:   
Page 1 of 1

 



ZBasic Microcontrollers Home
All content Copyright © 2005, 2006, 2007, 2008, 2009, 2010 Elba Corp. All Rights Reserved.
Opinions expressed in posts are those of the author and not necessarily those of Elba Corp.
Powered by phpBB © 2001, 2005 phpBB Group