Reaonable to generate a 20ms interrupt with Basic Atom?

I have been wondering if this is possible or even feasible with the Basic ATOM (not Pro). I am hoping to get an SSC-32 next month, but in the meantime I would still like to be able to write and test some code for my new pan/tilt turret using just the Basic ATOM.

I’m not sure if it’s reasonable to expect the Basic ATOM to answer an interrupt every 20ms and still be able to do other stuff in the meantime.

My code has many different paths in the main loop. It would not be reasonable to do this in a timed loop, since the timing can change frequently.

Thoughts? Ideas?

8-Dale

BasicAtom interrupts are more limited than BasicAtomPro interrupts. They can only be processed between commands(basicatompro doesn’t have this limitation) so if you have any command longer than 20ms(eg pause 100) the interrupt will not be processed until it finishes. If you code your program right(no long delays) it’s possible but not easy. If you just want to update your servos for testing you don’t absolutely have to do it every 20ms. If it’s something else you are trying to do that requires an absolute timing of 20ms I’d recomend moving to the AtomPro. Give us a call and we may be able to do a straight trade out for a PRO module.

Durn, not good. This may foil another project I am planning to do next month.

I don’t really want to mess with having to tune my code to suit the way my microcontroller does things or needs things done. If my microcontroller can’t handle what I need it to do, it may be time to step up to something more capable.

Actually, there is more than one timing sensitive project I am planning. in fact, I’m planning to get the Nubotics Wheel Watcher 01 and Wheel Commander for closed loop navigation. I may not be able to handle counting the transitions for the Wheel Watchers (by themselves) with the Basic ATOM. I have been planning to use the capture hardware to capture the interrupts for two Wheel Watchers. After I see how the Wheel Watchers work by themselves, I’d add in the Wheel Commander.

If I go with an Atom PRO, I will most likely just purchase another Atom Bot Board from Jim and get an Atom Pro Starter Kit. Not that I don’t appreciate your potential kind offer, because I do. :smiley: There is more I can do with the Basic ATOM, and I think I have already done some pretty nice stuff with it.

I’d also want to compare code between the Basic ATOM and the Atom PRO, so there is good reason (besides having a brain for another robot), to have both microcontrollers. :smiley:

I’ll be starting another robot build in January or February of next year, so having a faster brain for that will be a good thing. :wink: How soon I start that depends on how soon I get bored with my little rover and/or stop having fun with it. I didn’t think a little rover could be so much fun and be so interesting to work with.

8-Dale

Curious, are you asking about 20mS interupts because of servo pulse generation? It should be easy to limit the programming loop to be < 20mS. If you setup the program correctly and none of the devices take longer than 20mS to respond…

main:

do stuff

pulsout

pause (20mS - how long “do stuff” takes)

goto main…

Sorry if this is not helpful. :stuck_out_tongue:

Yes, that’s why I was asking.

Unfortunately, there are different paths that can be taken through my code and it may take differing amounts of time to get through different paths. I never liked having to figure out how long it takes to get through a loop.

I’ll just take the easy way out and get an SSC-32 next month. :smiley: I want to get one anyway and need to get familiar with how it works for when I start building my Walk 'N Roll bot. :slight_smile: Besides, it means I get to get a new toy… :smiley:

8-Dale

To be honest, it sounds like you’ve hit the point where you’ll want to find a cheaper (but much less user friendly) set of micros.
I’d recomend PICs (which just so happen to be what the ATOMs are built from).
The initial cost of the programmer (I recomend SparkFun’s Tiny-ICD2), the miniscule expense of a micro quickly returns the investment.
The ability to just throw a ton of micros at any given problem is rather nice.
:stuck_out_tongue:

I just got a board layout done and etched for a JDM style pic programmer, whadda you want me to do with a pic, i’ll need a program, i’ll drown in the pic programming language, so unless you’ve got a written up code and a pcb layout for the pic to control my servos, my bank has been exhausted, and i would be too embarrassed to ask my uncle for any more generousity. I am really upset that i didn’t get the right stuff in the first place.
Again, a pic programand a board layout, would help me out immensely

Naw, I have not done everything I want to do with this Basic ATOM yet. It just needs a little help in certain areas, which I can provide by accessorizing it appropriately. :slight_smile: I am adding an SSC-32 next month, and getting some additional stuff I need.

I still need to activate the PING sensor I bought this month, and just need to get a cable for it. When that is active, I will have all the current sensors working (IRPD, 3 IR Rangers, and the PING). After I feel I have pushed the Basic ATOM as far as I can, there is the ATOM PRO to check out. :slight_smile:

I do have plans to get into PIC and Atmel programming because there are a lot of resources available for them. When I go into PICs, it will be with one of Pete’s (sapian59) dual PIC boards. I really like the idea of having two powerful PICs on board. I am running out of I/O fast on this Basic ATOM, and I have two pins that do not work (AX1 and P6). I’ll start another thread when I am ready to troubleshoot those pins.

I have my eye on this PIC Programmer from Sparkfun. It looks like it would serve me well for pretty much anything to do with PICs.

Yes, indeed, that is one of the real attractions of PICs. There are many inexpensive ones with all kinds of combinations of I/O.

8-Dale

Just wanted to point out that the BasicAtom now allows inline PIC assembly. :slight_smile:

Also, You could use a timer interrupt(recommend an ISRASM interrupt instead of a basic interrupt) and the external clock input on the Atom to count input pulses over some period of time.

Basically the rule of thumb I go by when choosing between PIC, Atom or AtomPro(yes even I have to choose sometimes) is if I only need a few and don’t have to do interrrupts I’ll choose an Atom. If I need interrupts AtomPro period. It’s just a lot more powerfull than even a PIC programmed in pure assembly(yes it even blows away 18Fs running at 40mhz in most applications). If I need a lot of processors and cheaply I’ll go PIC.

Is the MBASIC manual the correct reference for the newer IDEs?? Now that I have gotten the latest release of my bot software done, I can invest the time to learn the newer IDE.

8-Dale

For AtomPro use the new AtomPro manual. It was updated before we release the new AtomPro software(though there are still some typos in it). Our document writer has been sick for a while now and is currently undergoing cancer treatment. He’s in Canada and he’s not having much luck with their health system so we may never get him back. We are hopefull though. He was in the process of updating the Atom manual when this all started. The best resource currently for the new Atom ide is the Jack Smith book on MBasic. I know it sucks that you have to buy a book to get the most out of the new Atom compiler but until we get the new Atom manual done(we are looking for a temp to fill in doing the documentation) it is the best source. Jacks book was written with this compiler in mind(though there are some changes since the book was released, eg subroutine arguments and return values).

The primary changes from the old software to the new stuff are the timing arguments. MOst timing arguments are now in usec instead of msec(except of course pause which is still in msecs).

FLoating point changed. We added the float variable type. the old Float and Int commands are now ToFloat and ToInt. FADD,FSUB,FMUL,FDIV are all gone. Just use the normal math functions with a float type variable.

eg:
temp var float
temp2 var float
temp = 1.1234
temp2 = temp * 1.5

Other than that the command set is basicly the same as the old compiler. If you run into specific commands not functioning as you remember you can ask us(BasicMicro).