Another thing that makes no sense
lenny1337
Posts: 26
This one has stumped quite a few people here, not to mention me. To make a long story short, we have a light board here which drives like 50 shift registers w/ a basic stamp. The shift register procedure is known as subroutine "lighttest". What i want to do is remotely initiate this light test. I breadboarded the driver circuit, and wrote the following code:
Start:
DO
k = k+1
IF (k>1) THEN
SERIN 0, 16468, [noparse][[/noparse]WAIT("go")]
DEBUG "got it"
GOSUB LIGHTTEST
DEBUG "light test done", CR
ELSE
GOSUB LIGHTTEST
ENDIF
(note that it runs through the first time when its plugged in, this is just a hardware requirement)
Now, on the breadboard, when i press the remote trigger i undoubtedly each time see "got it" followed after a short period by "light test done". However, when i take the BS2 and plug it into the actual driver card, nothing happens. THe only way i can start the light test is by manually restarting the driver circuit.
I've mapped all the pins on the driver, varified voltages on the reciever, tested the SAME reciever in the breadboard everything works fine, but when its on the circuit card, nothing. No reaction.
Now, if I change the K to "If (K>2) THEN", then i will get two light tests out of my hardware - but the third one will fail to be remotely triggered.
Anyone? Anyone?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center
Post Edited (lenny1337) : 7/26/2007 6:50:07 PM GMT
Start:
DO
k = k+1
IF (k>1) THEN
SERIN 0, 16468, [noparse][[/noparse]WAIT("go")]
DEBUG "got it"
GOSUB LIGHTTEST
DEBUG "light test done", CR
ELSE
GOSUB LIGHTTEST
ENDIF
(note that it runs through the first time when its plugged in, this is just a hardware requirement)
Now, on the breadboard, when i press the remote trigger i undoubtedly each time see "got it" followed after a short period by "light test done". However, when i take the BS2 and plug it into the actual driver card, nothing happens. THe only way i can start the light test is by manually restarting the driver circuit.
I've mapped all the pins on the driver, varified voltages on the reciever, tested the SAME reciever in the breadboard everything works fine, but when its on the circuit card, nothing. No reaction.
Now, if I change the K to "If (K>2) THEN", then i will get two light tests out of my hardware - but the third one will fail to be remotely triggered.
Anyone? Anyone?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center
Post Edited (lenny1337) : 7/26/2007 6:50:07 PM GMT
Comments
SERIN 0, 16468, [noparse][[/noparse]WAIT("go")]
You are telling the Stamp to wait for a "go", but then you are not sending it any data.· Try something like:
SERIN 0, 16468, [noparse][[/noparse]WAIT("go"), "a"]
if com = "a" then GOSUB lighttest
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center
Start:
DO
k = k+1
IF (k>1) THEN
SERIN 0, 16468, [noparse][[/noparse]WAIT("go"), flag]
DEBUG ? flag
IF flag = 1 THEN
GOSUB lighttest
ENDIF
DEBUG "light test done", CR
ELSE
GOSUB LIGHTTEST
ENDIF
the remote trigger end looks like this:
[noparse][[/noparse]...]
flag VAR Bit
flag = 1
PULSOUT 2, 1200
SEROUT 2, 16468, [noparse][[/noparse]"go", flag]
[noparse][[/noparse]...]
and on the breadboard the debug out is:
flag = 1
(pause)
light test done
on the hardware, still nothing.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center
You need to terminate the DO statement like so:
Start:
DO
k = k+1
IF (k>1) THEN
SERIN 0, 16468, [noparse][[/noparse]WAIT("go"), flag]
DEBUG ? flag
IF flag = 1 THEN
GOSUB lighttest
ENDIF
DEBUG "light test done", CR
ELSE
GOSUB LIGHTTEST
ENDIF
LOOP
Regards,
Bruce Bates
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
Is it possible to test your system at a lower baud rate to eliminate that possibility.
Jeff T.
I guess this is just one of those unsolvable issues...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center
Then the trouble must be·your lighttest subroutine (which, so far, has been excluded from this "discussion") and/or how you're interfacing with the Stamp.· DEBUG only indicates, as I think you understand,·that your program has progressed to some program line.
Over to you, Len.
this problem really makes no sense. i thougth that perhaps 5V was not enough for the board and got a variable power supply and gave it 5.5V which i believe is the threshold of "not burning (expletive) up", and yet that made no difference either.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center
(Sheesh.)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center
And what is the deal with variable "k"?· What value is it when the program first slides into "Start:"?· Is it 0 [noparse][[/noparse]zero]?
heres the rest of the code- nothing special
' ********************** I/O DEFINITIONS *********************
OUTPUT 13 'Setting input and output pin definitions
OUTPUT 11
OUTPUT 10
OUTPUT 9
OUTPUT 8
INPUT 12 'Optional input pin that can receive the data
'scrolling R to L back to the microcontroller.
' ********************* INITIALIZATION ***********************
LOW 8 'Initialize CLK to low.
LOW 9 'Initialize STROBE to low.
LOW 10 'Initialize DATA_IN_LR to low.
LOW 11 'Initialize LR output enable to logic high (enables outputs).
LOW 13 'Initialize RL output enable to logic high (enables outputs).
'******************** VARIABLE DEFINITIONS *******************
N CON 80 'Total number of lights
NL CON 3 'Length of adjacent ligts to be scrolled
C CON 1 'Pause in ms between clock cycles. Will control the scroll speed of the
'lights down the length of the board.
T CON 2000 'Pause in ms between light test and dark test.
i VAR Byte 'counter
j VAR Byte 'counter
k VAR Byte 'counter
CLEAR:
LOW 9
FOR i=1 TO (N)
LOW 10
HIGH 8
LOW 8
NEXT
RETURN
'***********************************************************
'* LIGHTS: Fills registers with N logic '1's *
'***********************************************************
LIGHTS:
LOW 9
FOR i=1 TO (N)
HIGH 10
HIGH 8
LOW 8
NEXT
RETURN
'***********************************************************
'* ZEROS: Fills registers with NL logic '0's *
'***********************************************************
ZEROS:
FOR i=1 TO NL
LOW 10
PAUSE C
HIGH 8
PAUSE C
LOW 8
NEXT
RETURN
'***********************************************************
'* ONES: Fills registers with NL logic '1's *
'***********************************************************
ONES:
FOR i=1 TO NL
HIGH 10
PAUSE C
HIGH 8
PAUSE C
LOW 8
NEXT
RETURN
'***********************************************************
'* ZERO: Fills register with one logic '0' *
'***********************************************************
ZERO:
LOW 10
PAUSE C
HIGH 8
PAUSE C
LOW 8
RETURN
'***********************************************************
'* ONE: Fills register with one logic '1' *
'***********************************************************
ONE:
HIGH 10
PAUSE C
HIGH 8
PAUSE C
LOW 8
RETURN
'***********************************************************
'* LIGHTTEST: Scrolls lights of length NL down the *
'* the length of the board and back. *
'***********************************************************
LIGHTTEST:
GOSUB CLEAR 'Initialize shift registers with logic '0's
HIGH 9 'Sets the strobe to high so lights can be seen.
GOSUB ONES 'Shifts NL lights to be scrolled into shift registers.
FOR j=1 TO (2*N) 'Shifts 2*N logic '0's into shift registers
GOSUB ZERO 'which shift the lights down the length
NEXT 'of the board and back.
LOW 9 'Strobe low.
RETURN
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lenny Bogdanov
Systems Concept Center