BS2, I am working on an AudioVU meter and right now I just want to light all of the LEDS, and I want to light one row as a starting point and then move to cycling through them.
' {$STAMP BS2}
' {$PBASIC 2.5}
serialout PIN 1
serialclk PIN 2
serialclr PIN 3
col VAR Word
col = 2
HIGH serialclr
main:
DO
HIGH 15
HIGH 14
HIGH 13
HIGH 12
HIGH 11
HIGH 10
HIGH 9
HIGH 8
HIGH serialclk
PAUSE 10
SEROUT 1, 396, [DEC 2]
PAUSE 1
LOW serialclk
LOOP
END
thats my code so far, I want to light the row connected to Q1
I am able to light the rows by jumpering the pin to ground.
Those high power shift registers work pretty much like a regular '595 chips.
There's a section of the StampWorks book which shows how to use the normal '595 chips. Hopefully it will give you an idea of how to use the high power version.
Looking at your code now, I'd say you're not even close to controlling the chip. I don't see the data line being pulses at all.
I am driving one led per pin, and using the shift register to control the column selected.
I with that chip that I am using, I'm not sure what to do with
RCK, GNOT and SRCLRNOT
here is some updated code
' {$STAMP BS2}
' {$PBASIC 2.5}
serialout PIN 0
serialclk PIN 1
serialclr PIN 2
col VAR Word
col = 2
LOW serialclr
LOW serialclk
main:
DO
HIGH 15
HIGH 14
HIGH 13
HIGH 12
HIGH 11
HIGH 10
HIGH 9
HIGH 8
PAUSE 200
LOW 15
LOW 14
LOW 13
PAUSE 200
LOOP
SEROUT 0, 1, MSBFIRST, [80]
PULSOUT 3,1
LOW 2
END
I am using a MSGEQ7 to process incoming signals, but I am not seeing the outputs that I expected. With but with respect to the display shifting I am still having an issue with the columns turning off before I would like them too creating a "dim effect".
' {$STAMP BS2}' {$PBASIC 2.5}
Clock PIN 1 ' shift clock (74HC595.11)
SerData PIN 0 ' serial data (74HC595.14)
Latch PIN 2 ' output latch (74HC595.12)
' -----[ Constants ]-------------------------------------------------------
' -----[ Variables ]-------------------------------------------------------
pattern VAR Byte
bittotal VAR Byte
' -----[ Initialization ]--------------------------------------------------
'OUTH = 000000 ' OUTH initialized TO LOW.
DIRH = 111111 ' Set P8-P15 to all output-low.
Reset:
LOW Latch ' make output and low
pattern = 1
' -----[ Program Code ]----------------------------------------------------
PULSOUT 4, 1
Main:
DEBUG ? IN5, CR
DEBUG ? IN6, CR
DEBUG ? IN7, CR
DO
GOSUB levelselect
GOSUB Out_595 ' put pattern on 74x595
pattern = pattern << 1 ' shift pattern left
'LOOP UNTIL (pattern = 128)
'pattern = 1
IF (pattern = 128) THEN
pattern = 1
PULSOUT 4, 1
ENDIF
LOOP
GOTO Main
Out_595:
SHIFTOUT SerData, Clock, MSBFIRST, [pattern] ' send pattern to '595
'HIGH Latch
'LOW latch
PULSOUT 2,10
RETURN
levelselect:
bittotal = IN5 + IN6+ IN6+ IN6+ IN7 + IN7 + IN7 + IN7
IF bittotal = 0 THEN
OUTH = 000001
ELSEIF bittotal = 1 THEN
OUTH = 000011
ELSEIF bittotal = 2 THEN
OUTH = 00000111
ELSEIF bittotal = 3 THEN
OUTH = 001111
ELSEIF bittotal = 4 THEN
OUTH = 011111
ELSEIF bittotal = 5 THEN
OUTH = 111111
ELSEIF bittotal = 6 THEN
OUTH = 111111
ELSEIF bittotal = 7 THEN
OUTH = 111111
ENDIF
RETURN
There are probably some timing issues that I am overlooking. Due to time constraints I may switch to an arduino to utilize a Fourier transform library to process the signal and simplify my A/D conversion process as well.
I am able to adjust the bands using a potentiometer for now.
Comments
What micro are you using, and what have you tried so far?
-Phil
thats my code so far, I want to light the row connected to Q1
I am able to light the rows by jumpering the pin to ground.
And thanks for the welcome
-Phil
There's a section of the StampWorks book which shows how to use the normal '595 chips. Hopefully it will give you an idea of how to use the high power version.
Looking at your code now, I'd say you're not even close to controlling the chip. I don't see the data line being pulses at all.
I used the TPIC6B595 to control some RGB arrays.
How are you powering the anodes? The BS2 can directly drive one LED but you don't want to power a whole row of LEDs with a BS2 I/O pin.
I with that chip that I am using, I'm not sure what to do with
RCK, GNOT and SRCLRNOT
here is some updated code
But I will take a loot at your tutorial
And, do you have the 595 datasheet?
http://www.ti.com/lit/ds/symlink/tpic6b595.pdf
The descriptions of the noted pins are on the first page.
I was able to get it to cycle the way that I wanted, you've been a huge help so far!
I will try to get schematics and hopefully show the complete project over the course of the next few days!
Looking forward to seeing the completed project.
Do you feel successful enough to make this thread as "solved"?
This is how the project is working so far.
http://www.youtube.com/watch?v=1b6zmg6YLLY&feature=youtu.be
I am using a MSGEQ7 to process incoming signals, but I am not seeing the outputs that I expected. With but with respect to the display shifting I am still having an issue with the columns turning off before I would like them too creating a "dim effect".
There are probably some timing issues that I am overlooking. Due to time constraints I may switch to an arduino to utilize a Fourier transform library to process the signal and simplify my A/D conversion process as well.
I am able to adjust the bands using a potentiometer for now.