PDA

View Full Version : IsoPod analog sensor inputs


martindupras
11-12-02, 06:34 AM
I am looking into using the IsoPod in some projects that I developed using the HandyBoard. Two questions:

1) From what I understand in the documentation, I could use a maximum of 8 analog sensors (such as photocells, bending strips, etc.) by using the 2 4-channel ADCs. Is that correct? If so, can I use three connector sensors (of the type that have 5+, signal and ground) with the IsoPod?

2) Besides the obvious differences, how would one compare the IsoPod with the HandyBoard, from the point of view of trying to replace the HandyBoard

Additionally, if anyone has pointers to artistic/interactive uses of the IsoPod, I would be very interested.

Thanks!

- martin

RMDumse
11-12-02, 09:30 AM
Yes, the IsoPod(TM) has 8 Analog inputs. The converters are very fast. They can be set up to convert continously, and whenever you want data, you just read it from the results register, and it will be no more than a few microseconds old.

No, you need to be careful with +5 as the inputs are 3V inputs.

The IsoPod(TM) exceeds the HandyBoard in almost every specification, except being so much faster, the IsoPod(TM) uses much more current.

martindupras
11-13-02, 07:55 AM
Thanks for the very useful information.

I think I'm ready to order a couple of Isopods, the question being 'which one?'.

For one thing, in the previous (very useful, thank you!) reply, it was said that the voltage I can use for sensors is only 3v. Would the SR version handle 5V to sensors?

Second, I understand that the main difference between version 1 and version two is that version 2 has two rs232 ports rather than one rs232 and one rs422. Other than that, are there any significant differences?

Third, and that's where I'm a bit confused, there's the development kit and the quick kit. Am I correct in understanding that, since I don't intend to physically connect components on a pc board I could just get the quick kit and one or two additional Isopods, and that would be all I need to program and use them?

Last, on the order page, the quick kit seems only to come with the Isopod v1. Can it be ordered with v2 or v2 SR?

Thanks a lot.

- martin

nmitech
11-13-02, 10:16 AM
Would the SR version handle 5V to sensors?
Digital inputs can withstand up to 5.5V.
Analog input range: 0 - 3V. You have to step 5V down some ways by using Voltage divider or scale down with OP-Amp, etc... to meet the spec requirement.


Second, I understand that the main difference between version 1 and version two is that version 2 has two rs232 ports rather than one rs232 and one rs422.

That is correct! Keep in mind, you can order V2 with one RS-232 and one RS-422/485 also.

Other than that, are there any significant differences?
V2 has Smaller size, Two additonal mounting holes, Cleaner A/D circuit, free up couple of timers and brought out to the connector for easy access.


Third, and that's where I'm a bit confused, there's the development kit and the quick kit. Am I correct in understanding that, since I don't intend to physically connect components on a pc board I could just get the quick kit and one or two additional Isopods, and that would be all I need to program and use them?
Yes, If you don't want to make your own cable you can order one quick kit and couple of the isopods with it. Well, you may need the Development kit insteads of quick kit, the reason that the development kit has prototyping area so you can add the additional circuit to step 5V sensor down for the analog inputs.

Last, on the order page, the quick kit seems only to come with the Isopod v1. Can it be ordered with v2 or v2 SR?
Yes, The web is now updated.

RMDumse
11-13-02, 10:31 AM
The A/D is limited in its analog range to only 3.3V, so if you want to read a 5V signal, you must first divide it down with a resistor pair, to avoid overvoltaging the A/D inputs.

The SR option is different only in the power supply section. The entire system operates off of 3.3V except for one chip, the CAN bus interface chip, which was only available in a 5V version. The power supply section in the original design used two linear TO220 regulators slung underneath the board. One took the Vin to 5V (for legacy connections and powering of this CAN interface chip) and the other took the 5V on to the 3.3V which the rest of the board operated from. The SR option is simply a switching regulator power supply in place of the two linear regulation devices. The SR option is a small board which fits above the CPU, and switches the Vin to 5V and 3.3V. The advantages of this switching regulator is several. It is smaller, and doesn't have to sling the large regulators under the board. Being on top of the board, it makes for easier mounting. Since it is a switching regulator, it is much more energy efficient, not wasting the extra voltage as heat, but "transforming" it down to voltage, so current required is much less. Also, since the energy conversion is more efficient, much less heat is generated by the SR option regulator. However, being a switching regulator, it makes more digital noise, which can show up in the A/D readings.

The differences between the V1 and V2 IsoPod(TM) boards starts with the option of two RS232 ports, rather than the only option of one RS232 and the other RS422 on V1. Also the pinouts were changed in several ways. For one, the A/D inputs were moved closer to the chip, to reduce the potential for induced digital noise by the longer runs. Many of the J6, J7 and J8 signals were compressed into the new J6 connector, and they were reordered to be more consistent in placement. Finally, the reduction of connectors made the board shorter and allowed the addition of two small mounting holes at the end.

The board (V1 or V2) is available stand alone, or with a serial cable and wall transformer (quick kit), or with a development prototype board again with serial cable and wall transformer (development kit). You can specify which board you prefer with either the quick kit or development kit.

The same is true for the SR option. Either the V1 or V2 board can be built with a linear regulator section, or with the switching regulator section (SR option), but the SR is more expensive to make, so we have to charge extra for that option.

martindupras
03-02-03, 02:52 PM
Thanks for all the information, that was very helpful. I now have two isopods and the quick kit. I wired a harness to connect my sensors to the 8 analog ports, and that seems to work. I used the beginning example in the documentation and put a jumper between groung and PAx, and they all work for on/off.

I read through the docs a couple of times and it's starting to make some sense to me, however, I'm not quite clear how I capture the sensor data and pass that out. What I'm interested to do at this stage is do something like this:

(pseudo code)

if PA0 !+ lastvalue_of_Pa0
send to serial port " 00 00 Pa0 255"

or something along these lines. I would like to simply send any new value to the serial port and read that on my PC.

Is there any example code that would be close to this for me to experiment with?

Many thanks!

nmitech
03-03-03, 02:01 PM
you can use something like this,

HEX

PORTA GETBYTE U.
or
PORTA GETBYTE EMIT

Where U. sends the unsigned number of PORTA to serial (or displays on terminal) followed by a space, and EMIT sends the ASCII equivalent of 16-bit.

martindupras
03-03-03, 05:03 PM
Thanks very much for the reply. I'm still not quite sure how that works. I'm not quite sure where I put the value of, say, PA0 in those lines.

I tried PORTA GETBYTE U. which does seem to read something. I attached a photocell to the PA0 and ground, and when I obscure it I get FF (255), and FE (254) otherwise.

That leads me to 3 more questions:

1) how can I read the values of PA0, PA1, etc, with the above command?

2) since the ADC are 12-bit, how can I obtain a 12-bit value from the analog inputs?

3) I tried EMIT and instead of displaying the value, it displays a little square. Does U. display unsigned to the terminal, and EMIT send the ascii value to the serial port, or am I misunderstanding?

I'd be grateful if you could point me to these things somewhere in the documentation.

Many thanks!

nmitech
03-04-03, 11:14 AM
1) how can I read the values of PA0, PA1, etc, with the above command?

PA0 GETBIT U.
or
PA1 GETBIT U.

2) since the ADC are 12-bit, how can I obtain a 12-bit value from the analog inputs?

( read the A/D channel 0 and display on screen )
ADC0 ANALOGIN 2/ 2/ 2/ U.

( read the A/D channel 1 and display on screen )
ADC1 ANALOGIN 2/ 2/ 2/ U.
........

Also, Here is the ADC discusssion thread with a good example program posted by g_jilek on 03/03/03.
http://www.newmicros.com/discussion/showthread.php?threadid=353

3) I tried EMIT and instead of displaying the value, it displays a little square. Does U. display unsigned to the terminal?
That is correct! If you enter,
HEX 41 U.
it will display 41

and EMIT send the ascii value to the serial port?
Yes, if you enter,
HEX 41 EMIT
it will display A


if you could point me to these things somewhere in the documentation.

You can find The FORTH Glossary reference page on the IsoPod Download page,
http://www.newmicros.com/store/product_details/download.html

or click here to go direct,
http://www.ee.ualberta.ca/~rchapman/MFwebsite/V50/Alphabetical/Brief/index.html

martindupras
03-04-03, 04:33 PM
Thanks for that, that helps a little.

I tried what you said, but as decimal values I get always changing values around 3800, which does not seem to follow the sensor behvaiour (in other words, nothing that I do to the sensor seems to have any effect.)

I connected a photocell between PA0 and grnd. I assume PA0 should be reading resistance? Is that the case? Why isn't it working for me? Am I doing something wrong?

On another note, I tried some of the examples in the IsoMax manual. I tried BLINKGRN, and for some reason, one line:

100 0 LOOPVAR CNT

doesn't seem to work. I get "LOOPVAR ?"

I also tried 100 LOOPVAR CNT, which is elsewhere in the manual, with the same result. What gives?

By the way, my Isopod is a V2 sr, and it's running Isomax v0.5.

Many thanks again!

nmitech
03-04-03, 05:06 PM
martindupras,

First PA0 is a digital I/O, not analog input. The eight analog inputs are available on J3, pin 3 to 10 and labels as ANA0- ANA7 respectively. Please see schematic or IsoPod V2 addendum for correct pinout. Schematic & addendum can be found in the IsoPod download page from my previous post.

LOOPVAR? syntax error. You probably forgot to include the gray text on your program. So make sure you have to have this also,

: LOOPVAR &#60BUILDS HERE P, DUP , , DOES> P@ ;

100 LOOPVAR CNT

RMDumse
03-04-03, 05:13 PM
Originally posted by martindupras
I connected a photocell between PA0 and grnd. I assume PA0 should be reading resistance? Is that the case? Why isn't it working for me? Am I doing something wrong?

Well, perhaps something might be wrong if that is the only connection you have. The A/D reads voltage, not current, and not resistance.

A photo cell, usually meaning a photo resistor, like a CdS cell, would need a pull up to 3V to act as a dividor, to create a varying voltage the A/D could read.

A photo voltaic cell, usually meaning a solar cell, would need a load resistor across it, to give an (approximate) reading of power. An unloaded solar cell will charge up in the light and have a (relatively) constant voltage output. But with a load, the more light, the higher the voltage (up to that same no-load limit).

martindupras
03-05-03, 04:51 AM
That is much clearer, many thanks. I understand now. I was using the photocell just as a test to check that I could get ADC readings.

I was doing that because I was not quite clear how to step down the voltage from 5V to 3V to the sensors. I'm still not clear on that, but am I correct in assuming that I would take a feed off the +5V into a voltage regulator then take out the 3V output, and split that to my 8 sensors? I assume therefore that the ADCs would read the voltage coming out of the sensor as a 12-bit value, with 3V being 111111111111 and 0V being 000000000000. Correct?

Many thanks!

- martin

RMDumse
03-05-03, 07:07 AM
There are several pins with 3V already provided on the board. You could hook one side of your CdS cell to gnd, the other side to a junction of ANA0 and a pull up resistor. The other side of the pull up resistor would go to the 3V supply from the board. A filter cap across the whole thing might be good. I'd suggest a .1 or a .001 to reduce power supply noise (or maybe even both for good measure).

The A/D reading in the register is left shifted, but the MSB is a sign bit, as I recall, so your result will be (typically) between 0000000000000xxx and 0111111111111xxx . In the sample code LC sent, there was division 2/ 2/ 2/ to strip those bottom bits and right shift the result into a more useable form.