BasicMicro - Forums

www.basicmicro.com
It is currently Mon May 21, 2012 12:29 am

All times are UTC - 8 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Nano18 and Interupts
PostPosted: Fri Mar 18, 2011 8:43 pm 
Offline
New User

Joined: Fri Mar 18, 2011 8:38 pm
Posts: 1
I want to use interupts with a Nano18.

The reference guide said that the Nano does not have interupts.

Is that true?

Frank G. Haymes


Top
 Profile  
 
 Post subject: Re: Nano18 and Interupts
PostPosted: Sat Mar 19, 2011 11:16 am 
Offline
Master

Joined: Sun Aug 17, 2008 5:26 pm
Posts: 798
Location: CA bay Area
Every Nano is a PIC, and therefore has interrupts. Problem is, BasicMicro has stopped supporting the BASIC's interrupt(s) commands and now wants the users to use assembly interrupt routines instead. And then fail to supply any real examples of these. The interrupt commands are still in there, probably, they just aren't talking about them. So, you can interrupt on any edge with the B0 I/O pin (P0 on their bootloading parts); interrupt on either a rising or falling edge (your choice); you have any number of timer-derived interrupts; you have event interrupts, like
1. a character entering the serial input buffer
2. a timer timing out
3. the finish of an ADC sample
4. the end of transmission of a character in the serial transmit buffer
and on and on...

You can always ask here for an example for use of any of the interrupts. That's what we're here for.
They are working on an updated manual, and we can only hope they are going to cover the subject.

Take care.
kenjj

_________________
kenjj
http://blog.basicmicro.com/
http://kjennejohn.wordpress.com/


Top
 Profile  
 
 Post subject: Re: Nano18 and Interupts
PostPosted: Sun Mar 20, 2011 1:17 pm 
Offline
Site Admin
User avatar

Joined: Thu Mar 01, 2001 11:00 am
Posts: 903
Location: Temecula, CA
Its simple enough. We never supported basic interrupts on Nano. We dropped Basic interrupts when we released the Nanos. Only AtomPro supported BasicInterrupts. The reason is simple. We can't spend hours on the phone to help people code for interrupts. AtomPro interrupts are 199 times simpler. Nano/Atom interrupts were not and had many gotchas due to memory and processing power limitations. People were expecting more from them than they could ever do and then complained when we didn't meet their expectations by doing the work for them. We can't afford that. :( So Basic interrupts were dropped. The old MBasic ISRASM interrupt system is still available, primarily for advanced (eg guru class) users. We do not do tech support on it other than the few examples we've posted. All for the same reason we dropped Basic interrupts. I wish we had infinite time to support every possible feature of the PICmicro but we don't. :(

As for the ISRASM system...

The ISRASM{} block is were you will jump to when any interrupt executes on a Nano or Atom processor. It is your job to write code to handle everything except for the entry and exit from the interrupt handler. The ISRASM automatically saves the STATUS,FSR,PCLATH and W registers and restores them on exit from the block. You use the PICmicro interrupt system just as they document it in the PICmicro datasheets. Set the GIE and in most cases the PEIE bits to enable interrupts along with the specific interrupt enable flag for the interrupt you need to use. Then in the ISRASM block you will need to clear the interrupt flag and then execute your asm code. If you are using more than one interrupt at a time you will also have to check to see which interrupt cause that particular interrupt in the ISRASM handler.

_________________
Tech Support
Basic Micro - Robotic Technology Evolved


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 8 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group

phpBB SEO