View Full Version : Datalogger
Hello I'm looking to build a datalogger for my road racing bike. I would like to have:
8 A/D channels
8 Digital inputs
3 Freq counters
I would like to have a software adjustable sample rate and also be able to enable and disable channels. I would like to have a sample rate between 10-100hz. After the data has been acquired to would be sent to a Stamp drive for storage. I have some programming experience with Visual Basic. I have an OOPicII and have tried to do this project using it but it is way too slow to accomplish it. After some quick reading that language doesn't seem to hard to learn and I think my app would be fairly simple to write. I see that the Counter/Timer lines can be used as a PWM input so this would be able to be used as a freq counter. I'm just guessing that the ISOPod can be used in a standalone app. Any input on possible problems or if someone has done something like this before and would be willing to share so info would be greatly appreciated
nmitech
11-01-02, 01:21 PM
Spike,
IsoPod is a perfect microcontroller for your standalone application. It has all the features that you are looking for. I think you are fine with IsoMax, since you are already had experience with microcontroller's programming in the past. Beside, You can always get technical support from NMI's team and other IsoPod's customers as well.
RMDumse
11-01-02, 10:43 PM
The IsoPod(TM) is extremely rich in features, and those counter timers have to be the most awesome timers I've ever used.
When you say road racing bike, do you mean, motorcycle or human powered? If there is one draw back to IsoPod(TM) that 80MHz operations with 40 MIPS burns lots of electrons, so you may need a fair battery pack to operate it. There are lower power modes, wait and stop, but I haven't personally explored them yet to see how low the current can go.
It's for a motorcycle so power consumption is not a problem. I have been reading the IsoMax programming PDF. I understand some of it but some is over my head. My biggest question right now is to do with being standalone piece. Can I write a program and have it run each time the micro is powered up, or does it have to be programmed each time it is powered up? I don't really understand machines. For my project think I would have one MACHINE similar to the bounceless+ example to start and stop the logger. If the start button is pressed it would start a MACHINE-CHAIN. That would have one MACHINE for each input to get the value and store it in the Data Ram and another MACHINE write all the values to the Stamp Drive via a serial port. I would use the EVERY xxxxx CYCLES SCHEDULE-RUNS MACHINE-NAME to set the sample rate. I have allot of reading to do. I would like to complete this project by spring because my bike is arriving in March and I would like to have it on the bike for the first practice session in the middle of May. But if I can't get it to work what would this cost me it got NMI to write?
RMDumse
11-02-02, 09:08 AM
Originally posted by Spike
Can I write a program and have it run each time the micro is powered up, or does it have to be programmed each time it is powered up?
Programs can be moved into Flash as they download using EEWORD after each definition, and IN-EE after each transition added to a state machine.
The AUTOSTART feature of the IsoPod(TM) will let you write code, then when it powers up it will run your application.
With the machines, you can even autostart the background scheduled tasks, and leave the foreground open and available to talk to you for diagnostics when you plug into the serial channel. The multitasking aspect of it is kind of neat that way.
Now, you have to be careful, because if you autostart a bad program, you can get your board locked up. We can recover it by reprogramming the whole flash, but it takes an additional cable, PC JTAG software and the kernel image to get it straightened out. So don't just casually experiment with AUTOSTART ing until you know what you're doing.
But the code is as simple as this:
: STARTUP
INIT
W.F.B. SET-STATE
EVERY C350 CYCLES SCHEDULE-RUNS CONTEST
; EEWORD
SAVE-RAM
HEX
7C00 AUTOSTART STARTUP
Here the word STARTUP is autostarted. On power on reset the word will run. It initializes everything necessary, chooses an initial state for the machine CONTEST and installs CONTEST into the background. It then quits and lets the IsoMax interactive environment have the foreground.
Originally posted by Spike
If the start button is pressed it would start a MACHINE-CHAIN. That would have one MACHINE for each input to get the value and store it in the Data Ram and another MACHINE write all the values to the Stamp Drive via a serial port.
Actually, the example I pulled that code from (a Mini Sumo robot programmed for Table Top Contest) had a wait for button start up. Here's what the beginning of the word CONTEST looks like
MACHINE CONTEST EEWORD
ON-MACHINE CONTEST
APPEND-STATE W.F.B. EEWORD ( WAIT FOR BUTTON
APPEND-STATE QTINIT EEWORD ( QUICK TRIP
APPEND-STATE QTDOWN EEWORD
APPEND-STATE QTTURN EEWORD
APPEND-STATE QTBACK EEWORD
APPEND-STATE QTENDIT EEWORD
APPEND-STATE TTINIT EEWORD ( TTIME
APPEND-STATE TTDOWN EEWORD
APPEND-STATE TTTURN1 EEWORD
APPEND-STATE TTHALF EEWORD
APPEND-STATE TTTURN2 EEWORD
APPEND-STATE TTSIDEOUT EEWORD
APPEND-STATE TTTURN3 EEWORD
APPEND-STATE TTSIDEIN EEWORD
APPEND-STATE TTTURN4 EEWORD
APPEND-STATE TTBACK EEWORD
APPEND-STATE TTENDIT EEWORD
APPEND-STATE LFINIT EEWORD ( LINE FOLLOWING
APPEND-STATE LF.RR EEWORD
APPEND-STATE LF.R EEWORD
APPEND-STATE LF. EEWORD
APPEND-STATE LF.L EEWORD
APPEND-STATE LF.LL EEWORD
IN-STATE
W.F.B.
CONDITION
PB7 OFF?
CAUSES
REDLED OFF
YELLED OFF
GRNLED OFF
PB0 OFF
THEN-STATE
QTINIT
TO-HAPPEN IN-EE
IN-STATE
W.F.B.
CONDITION
PB6 OFF?
CAUSES
REDLED OFF
YELLED OFF
GRNLED OFF
PB0 OFF
THEN-STATE
TTINIT
TO-HAPPEN IN-EE
IN-STATE
W.F.B.
CONDITION
PB5 OFF?
CAUSES
REDLED OFF
YELLED OFF
GRNLED OFF
PB0 OFF
THEN-STATE
LFINIT
TO-HAPPEN IN-EE
etc.
Notice the W.F.B. (wait for button) state has several different transitions looking for different buttons to be pressed, and takes off into different sections of the code (or said another way, into a different set of interlocked states) depending on which button is selected. As each contest piece finishes, it returns to W.F.B for another round if desired.
Originally posted by Spike
I would use the EVERY xxxxx CYCLES SCHEDULE-RUNS MACHINE-NAME to set the sample rate.
That's the basic idea. If you need a slower rate than the SCHEDULE-RUNS you could have a counter and just count and exit on the machine for a give number of cycles, and just pass into the rest of the machine at a lower, divided rate. If you're used to a OOpic being too slow, you'll probably be amazed to the point of disbelief at how fast an IsoPod(TM) is. 10 to 100 Hz is a very slow process for IsoPod(TM).
Originally posted by Spike
I would like to complete this project by spring because my bike is arriving in March and I would like to have it on the bike for the first practice session in the middle of May. But if I can't get it to work what would this cost me it got NMI to write?
Well, we certainly do custom system design and programming. But this is a pretty simple project for us. Why don't you contact me directly (rmd@newmicros.com) and maybe I can do it for you in trade for something.
vBulletin v3.0.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.