RCtime not working
Inanes
Posts: 14
Planet BS2. I·tried to run an RCtime command (to read photoresistors) on pin 4 but it returned zero and occasionaly some unstable values not related to the sensor. I tried also pin2 and pin6 and neither them could read RC. All other·pins worked ok. No wiring, and no grounding problems found, I just placed the sensor wire to different pins and programmed BS2 accordingly. I tested (LED) the pins output and worked ok for all pins. I attached the code I did the tests:
' {$STAMP BS2}
' {$PBASIC 2.5}
sensor_left CON 3 'I/O control for the light sensor
sensor_right CON 4 'I/O control for the light sensor
left VAR Word 'Here is stored the time constant of the left photoresistor/RC-circuit
right VAR Word 'Here is stored the time constant of the right photoresistor/RC-circuit
HIGH sensor_left
HIGH sensor_right
PAUSE 3
RCcommand:
RCTIME sensor_left,1,left 'measure the light intensity on the left sensor
HIGH sensor_left
PAUSE 20
RCTIME sensor_right,1,right 'measure the light intensity on the left sensor
HIGH sensor_right
PAUSE 20
DEBUG ? left, ? right, CR
PAUSE 1000
GOTO RCcommand
END
Ping))) did not work either with these pins. Is this a problem with the specific pins' internal pot??? What is the architecture of the BS2 chip to behave like that?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
4th robot law: A robot may not substitute a human to satisfy another human, as long as such satisfaction does not conflict with the 1st, 2nd, and 3rd law.
Inanes Pastas
Post Edited (Inanes) : 8/22/2006 7:54:36 AM GMT
' {$STAMP BS2}
' {$PBASIC 2.5}
sensor_left CON 3 'I/O control for the light sensor
sensor_right CON 4 'I/O control for the light sensor
left VAR Word 'Here is stored the time constant of the left photoresistor/RC-circuit
right VAR Word 'Here is stored the time constant of the right photoresistor/RC-circuit
HIGH sensor_left
HIGH sensor_right
PAUSE 3
RCcommand:
RCTIME sensor_left,1,left 'measure the light intensity on the left sensor
HIGH sensor_left
PAUSE 20
RCTIME sensor_right,1,right 'measure the light intensity on the left sensor
HIGH sensor_right
PAUSE 20
DEBUG ? left, ? right, CR
PAUSE 1000
GOTO RCcommand
END
Ping))) did not work either with these pins. Is this a problem with the specific pins' internal pot??? What is the architecture of the BS2 chip to behave like that?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
4th robot law: A robot may not substitute a human to satisfy another human, as long as such satisfaction does not conflict with the 1st, 2nd, and 3rd law.
Inanes Pastas
Post Edited (Inanes) : 8/22/2006 7:54:36 AM GMT
Comments
Post Edited (Inanes) : 8/23/2006 11:21:17 AM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
Post Edited (TechnoRobbo) : 8/21/2006 1:03:21 PM GMT
Haven't tried to apply Vdd to problematic pins and read it through debug. Shall I put a resistor (eg 220 Ohm) and INPUT 4 to try this?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
pwssr could you post the jpg?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
·· I decided to try it myself, and it is, in fact, corrupted.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
Post Edited (Inanes) : 8/23/2006 5:47:30 AM GMT
Since the evaluation version of WinZip is essentially free, why fool around with anything else?
http://www.winzip.com/downwzeval.htm
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
<!--StartFragment -->
First - sorry for starting this Winzip debate.
Second - from studying your diagram I can't helpbut feel that the caps charging and discharging are interacting with each other by creating unexpected potential differences.
Why don't you simplify the circuit like this:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
Post Edited (TechnoRobbo) : 8/23/2006 6:21:53 AM GMT
' {$STAMP BS2}
' {$PBASIC 2.5}
idx VAR Nib
FOR idx=0 TO 15
· HIGH idx
· INPUT idx
· DEBUG DEC idx,BIN IN0(idx)
· LOW idx
· INPUT idx
· DEBUG BIN IN0(idx),CR
NEXT
Here is what I got·from DEBUG :
010
110
211
310
411
510
611
710
810
910
1010
1110
1210
1310
1410
1510
So, pins 2, 4, and 6 fail to become inputs when pins are low?
Post Edited (Inanes) : 8/23/2006 1:28:04 PM GMT
000
100
200
310
410
510
610
710
811
911
1011
1111
1210
1310
1410
1511
But that means I'm using those pins in a circuit thats pulling them to Vdd . Are you?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
Post Edited (TechnoRobbo) : 8/23/2006 5:22:19 PM GMT
If everything was disconnected from those pins, yes, the result means that there is something amiss with pins 2,4 and 6. Don't immediately blame it on the Stamp. It might be that the circuit board or wiring has a hidden leakage path to the +supply.
On the circuit board itself, with the Stamp removed, measure the resistance from the offending pins over to the Vdd node. That resistance should be asymptotocally near infinite (after the supply capacitors charge).
If it is the Stamp, the likely cause is that the low side driver transistors are blown, so that the Stamp can no longer pull low. Connect a voltmeter or 'scope to the output pin, and run a DO: TOGGLE 2 : LOOP program to see if the output toggles. If you don't have a voltmeter handy, use the known good stamp pins to test:
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Tracy, I detected no leakage from Vdd to any of the stamp's general purpose I/O. I also tried the toggle 2 (or 4, or 6) and the output was 1010101010...... as expected.
Resume΄: My stamp is able to drive high or low all·of its pins. However, for pins 2, 4, and 6 it reads and reports that they are driven high, even if their are driven low. Am I correct? Do you think the problem is permanent?
P.S. -·All output-based functions (shiftout,·pulsout, serout, e.t.c.) work allright at those pins, but when reading of the pin state is necessary (like RCtime), my stamp fails
I misunderstood earlier what you should be using is a pulldown resistor to test - in otherwords take 3 - 10k resistor and connect it to the Vss and the pins 2,4 & 6. You are reading it high all the time, its reading low (or Vss) thats your problem. for get about driving the pin since thats not your problem either.
' {$STAMP BS2}
' {$PBASIC 2.5}
DIRS=0
DO
DEBUG HOME,BIN16 INS, CR
PAUSE 250 'give debug some time to talk
LOOP
'output on your BS2 will probbly look like this 0000000001010100
' if everythings fine it will look like this '0000000000000000
Though I believe Tracy's right - might as well not give up till the (PC Alert) nutritionally-challenged lady sings.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
Also try it with p3 the output and p2 the input.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Yesterday I started·to·get nuts, I tried all of your suggestions but results were contradictory, making not sense; the Stamp was able to drive high or low, but for my 3 problematic pins their input state was prevented to get known to the Stamp. What missed me?
Finally, I have some good news, and some bad news. Good news are that the Stamp is not to blame for all this. Bad news is that the circuit board has a leakage. Tracy, bingo!
What I checked before was leakages from the BS2 pins to Vdd or Vss, assuming zero resistance, so, I set my multimeter to 200 Ohm, and everything looked ok.
I have the Parallax BOE and after exhaustive testing, I found:
R(Vdd to pins 2,4,6)=10kOhm
R(Vdd to all other pins)=infinite
R(Vss to pins 2,4,6)=19kOhm
R(Vss to all other pins)=infinite
Leakages between the cursed pins and 1,2,4,6,8,9,12,16,28 BS2 socket positions (chip PIC16C57C). Resistance between 10 and 19 kOhm
Is there a way to save my BOE? What do we do in these situations?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
4th robot law: A robot may not substitute a human to satisfy another human, as long as such satisfaction does not conflict with the 1st, 2nd, and 3rd law.
Inanes Pastas
Post Edited (Inanes) : 8/26/2006 9:42:20 AM GMT
If theres no apparent damage to the board and the short occurs without the chip installed and you are beyond the 90 day warranty - perhaps you can have the breadboard repaired.
Drastic options not recommended by Surgeon General: scratch out the tracers,clip pins· and/or solder a jumper in place. You must be darn sure where the cross-connect occurs to use this option.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Have Fun
TR
I was not able to find the source of the leakage. Neither could I isolate, I've found leakages from VSS all the way to the pins 2,4,6. Even on the BS2 socket. Is there a possibility to have a blown transistor on the board? I made some measurements and I found one that the base-emitter-collector gave same resistance. It was hard to check individual components, because they are tiny SMD. Not to mention to dismount-put a new one! I do not want to have my card repaired to anybody around, since I live in a smal town with no experienced electronic experts.
Nevertheless, if nothing could be done, I will continue using my BS2 board, with this defect. If I do so, I would like your opinions on how safe that would be for BS2 chip.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
4th robot law: A robot may not substitute a human to satisfy another human, as long as such satisfaction does not conflict with the 1st, 2nd, and 3rd law.
Inanes Pastas