PDA

View Full Version : Question on StampCI Board



mhammer
04-07-2007, 01:51 AM
Hello All,


I have a problem with the Stamp CI Board.·· I have it interfaced with a DC Input Module on a Grayhill Relay Board using the 50 pin header. I am using a Javelin Stamp on the Board and the input is·Connected to Pin 1.·· When the input is high the javelin doesn't See it.··· I have checked the diagram and the documenation of the StampCI Board and it should work.·· The input's Logic is at 5v.· I don't think it is a bad input because i have 27 Different units and they all act the same.·· If anyone has any ideas on what i might be missing please let me know.


Thanks

QuattroRS4
04-07-2007, 02:15 AM
when you say the stamp doesn't see it do you check it ..

Sorry there - had code - deleted it by accident back again ..

import stamp.core.*;
public class Sample {
·static int val;
public static void main(){
val=0;
do{
if (CPU.readPin(CPU.pins[1])== true){
val = val +1;
// more code here ...
}
}while (true);
}
}


when input is received on pin 1 it increments 'val' -

Rgds,
······ Quattro

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'

Post Edited (QuattroRS4) : 4/6/2007 7:41:12 PM GMT

mhammer
04-07-2007, 02:19 AM
Yes i do check for it. and if i bypass the Ul2803 on the board my program works fine. I would just like to not have to hack the board to make it work.

QuattroRS4
04-07-2007, 02:37 AM
ULN2803 inverts the input - therefore if you give it a low - its corresponding output is high and vise versa..

Quattro

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'

Post Edited (QuattroRS4) : 4/6/2007 10:22:49 PM GMT

mhammer
04-07-2007, 03:15 AM
So what you are saying is that when the input is high i should be checking for a low on the pin? IE

CPU.readPin(CPU.pins) == false

QuattroRS4
04-07-2007, 03:22 AM
Yeah that would do it ..


Quattro

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'

mhammer
04-07-2007, 03:37 AM
I guess i am still missing something so i am going to post some code.· This is the code that reads the pulse in.·· when the input is high(indicated by a light on the module) the code blow doesn't return a value if i·check for high or low.


· private static void checkpulse() {
··· if(CPU.readPin(CPU.pin0)==systemTypeBool) {
····· if(goahead) {
······· goahead=false;
······· // more code here
····· }
··· }
··· else {
····· if(goahead==false)
····· {
······· goahead=true;
·······//·more code here
····· }
··· }
· }

systemTypeBool is either true or false depending on the unit.· either way it still doesn't see the input.

The input module i am using is a Grayhill 70L-IDCNP DC Input.·· 10-32VDC/15-32Vac Input with 4.5 to 28V Logic

The board it is hooked up to is a Grayhill 70LRC8K·IO Board.

hope this sparks someone's·mind because i have been working on these for 3 weeks and can't figure it out.

QuattroRS4
04-07-2007, 05:20 AM
From the example I showed you add a debug line as follows - to see if val is incrementing...
then change the ==true to ==false and run again..

System.out.println(val);

I don't understand how you have the problem - if you bypassed the ULN2803 and it works - now that you know it inverts the signal as explained - reversing your 'if' conditions should give you the result.

Where you were expecting a 'true' now look for a 'false' and vise versa...that should do it ..

As I don't have a Javelin Stamp at hand or the mentioned circuit - I can only go by the specs. of a uln2803 ... and what you have said..


If this doesn't work Post a link to this problem in the Javelin Stamp forum - I am sure Peter Verkaik will sort out your code issues ..



Regards,

Quattro







EDIT

"I am sure Peter...." typo there - forgot the sure !!! - sorry Peter

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'

Post Edited (QuattroRS4) : 4/7/2007 12:30:53 PM GMT

Chris Savage
04-07-2007, 06:44 AM
Hello,

The Stamp CI Board uses the ULN2803 to drive the outputs, but for inputs there are resistors that feed back from the output of the ULN2803 to the input for the BASIC Stamp to pick up. Because of this configuration the inputs won’t be inverted, but how they’re driven could explain why they’re not picked up. Also, are you setting your pins as inputs? If so you should be able to measure an input pin with a DMM/DVM to see if it is going high. Are you sure the module itself works?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support

QuattroRS4
04-07-2007, 09:11 AM
Typo fixed in my previous post ....

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
'Necessity is the mother of invention'

Peter Verkaik
04-07-2007, 12:58 PM
Here is the schematic of the stamp ci board
http://www.stampsinclass.com/dl/docs/prod/schem/stampci.pdf
Here is the uln2803 datasheet
http://www.tranzistoare.ro/datasheets/90/366828_DS.pdf

The uln2803 inputs have a 2.7k resistor to ground (via transistor base).
If the feedback is large (10k or so), applying 5V at an IO pin, will
give a maximum value of (2.7/12.7)*5 = 1.06V at a javelin pin, not enough for the javelin
to see it.
What is the feedback resistor value?

If the feedback is low (1k or so), applying 5V at an IO pin, will
give a value of (2.7/3.7)*5 = 3.65V, enough for the javelin to see it,
(javelin input treshold value is 2.5V) but then the uln2803 input is driven
which may result in·an additional path to ground via the collector of the uln2803 transistor.
It may even start oscillating.

Since the ci board·was designed for the basic stamp, and these have a treshold value
of 1.4V, the feedback resistor value may need to be changed to 2.7k to get 2.5V
at a javelin pin.
But this may lead to the result just pointed out.

Why not applying an input via the host parallel port (X1)?

regards peter

mhammer
04-08-2007, 05:25 AM
I think you found it peter.··I checked with a meter (Thanks Chris) and found that the pin is going high just not high enough for the javelin to see.· I am going to talk to the powers that be and see if we can use a stamp with the second generation units.




Thanks for the help guys.

Peter Verkaik
04-08-2007, 05:54 AM
You can resolve the issue in a number of ways.
1. Use a basic stamp.
2. Use a javelin and for the inputs use the host parallel port. (Preferred option I think).
3. Use a javelin and for inputs use the IO pins but disconnect the appropiate input and output pins
of the ULN2803 from its socket (if the ULN2803 is directly soldered into the board
you may need to cut these pins) but this only works if you do not use that input
also for·output. Basically, you leave only the feedback resistor between IO and
javelin pin.

regards peter