Go Down

Topic: Need more outputs on my arduino mega ! (yes ... i know ...) (Read 3442 times) previous topic - next topic

Graynomad

Quote
Reading the datasheet, it shows that a resistor and a capacitor should be used on each output

I think you are looking at the test circuits, these are just to show how the manufacturer (or you) can test the chip. Nothing to do with using it normally.

No resistors or caps required on the outputs.

Quote
how do i drive the 2nd TPIC6C595 connected on the SerialOut of the 1st TPIC6C595 ?

Just daisy chain ser out to ser in etc for as many chips as you like.

Quote
You're telling me that i have to add a capacitor across "Vcc" and "GND" pins of each TPIC6C595 ?

Yes, standard procedure for just about any chip.

Quote
if i use the TPIC6C595 daisy chained, i will not need to buy 2N2222 transistors as i will be able to use my TIP120s

I still don't understand why you need both a high-current chip and transistors. Can you answer that question?

Quote
- Time = 0 >>> I want to turn ON relay 3
- Time = 1 >>> I want to keep relay 3 ON and turn ON relay 7
- Time = 2 >>> Now i want to turn OFF relay 3


Code: [Select]
int pin_bits0 = B00000100;  // relay 3 on
int pin_bits1 = B00000000;

digitalWrite (latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits1);  // send upper 8 bits
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits0);  // send lower 8 bits 
digitalWrite (latchPin, HIGH);

delay (1000);

int pin_bits0 = B01000100;  // relays 3 and 7 on
int pin_bits1 = B00000000;

digitalWrite (latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits1);  // send upper 8 bits
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits0);  // send lower 8 bits 
digitalWrite (latchPin, HIGH);

delay (1000);

int pin_bits0 = B01000100;  // relay 3 off, 7 on
int pin_bits1 = B00000000;

digitalWrite (latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits1);  // send upper 8 bits
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits0);  // send lower 8 bits 
digitalWrite (latchPin, HIGH);




______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

simkard

Quote
how do i drive the 2nd TPIC6C595 connected on the SerialOut of the 1st TPIC6C595 ?
-> Just daisy chain ser out to ser in etc for as many chips as you like.

Ok, i had saw these pins but i'm wondering how does the first TPIC6C595 passes the data to the second one ?

Quote
You're telling me that i have to add a capacitor across "Vcc" and "GND" pins of each TPIC6C595 ?
-> Yes, standard procedure for just about any chip.

What should be the value for the shift-register to works without troubles ?

Quote
if i use the TPIC6C595 daisy chained, i will not need to buy 2N2222 transistors as i will be able to use my TIP120s
-> I still don't understand why you need both a high-current chip and transistors. Can you answer that question?

Aaaahhhh ... please forgive me with this, i was in my dreams yesterday @ night ;) (too much coding drove me crazy ! haha -> I'm actually working on a dynamic menu tree for KS0108 library)

Quote
- Time = 0 >>> I want to turn ON relay 3
- Time = 1 >>> I want to keep relay 3 ON and turn ON relay 7
- Time = 2 >>> Now i want to turn OFF relay 3



Code: [Select]
int pin_bits0 = B00000100;  // relay 3 on
int pin_bits1 = B00000000;

digitalWrite (latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits1);  // send upper 8 bits
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits0);  // send lower 8 bits 
digitalWrite (latchPin, HIGH);

delay (1000);

int pin_bits0 = B01000100;  // relays 3 and 7 on
int pin_bits1 = B00000000;

digitalWrite (latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits1);  // send upper 8 bits
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits0);  // send lower 8 bits 
digitalWrite (latchPin, HIGH);

delay (1000);

int pin_bits0 = B01000100;  // relay 3 off, 7 on
int pin_bits1 = B00000000;

digitalWrite (latchPin, LOW);
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits1);  // send upper 8 bits
shiftOut(dataPin, clockPin, MSBFIRST, pin_bits0);  // send lower 8 bits 
digitalWrite (latchPin, HIGH);


-> You must had make a mistake on the last step ... wouldn't the last (int pin_bits0 = B01000100) be (int pin_bits0 = B01000000) instead ?
(if i'm wrong ... then i will REALLY need some reading about how the process of enabling/disabling outputs works ...)


Thanks to you for all your time spent on my questions !

Graynomad

Quote
how does the first TPIC6C595 passes the data to the second one ?

SEROUT -> SERIN, look at the names, they are pretty self explanatory.

Quote
What should be the value for the shift-register to works without troubles ?

Typically 0.1uF.

Quote
I'm actually working on a dynamic menu tree for KS0108 library

Sorry, that just makes me even more confused. The KS0108 is a GLCD right? Why does is need any high-current drivers to use it? And even if it does why both drivers and transistors.

Quote
wouldn't the last (int pin_bits0 = B01000100) be (int pin_bits0 = B01000000)

Yes, well spotted, the perils of cut and paste.


______
Rob

Rob Gray aka the GRAYnomad www.robgray.com

simkard

Quote
how does the first TPIC6C595 passes the data to the second one ?
SEROUT -> SERIN, look at the names, they are pretty self explanatory.

Yes but, what is the message i have to send to the first one to tell him to pass the message to the second one ?

Quote
What should be the value for the shift-register to works without troubles ?
Typically 0.1uF.

Ok, thanks for that !!!

Quote
I'm actually working on a dynamic menu tree for KS0108 library
Sorry, that just makes me even more confused. The KS0108 is a GLCD right? Why does is need any high-current drivers to use it? And even if it does why both drivers and transistors.

In fact, i want to explode some KS0108 :) ... Nnnnooooo !!! just kidding, it is not related, i'm creating a "dynamic animated menu with user actions (4 buttons)" for GLCD library ... This was what i meant when saying i was working on it late last night and was totally decerebrated :)

Quote
wouldn't the last (int pin_bits0 = B01000100) be (int pin_bits0 = B01000000)
Yes, well spotted, the perils of cut and paste.

:) ouffff ! i thought i had to read many things ! hahaha ;)

Graynomad

Quote
what is the message i have to send to the first one to tell him to pass the message to the second one ?

Just daisy-chain all SRs

MEGA dataPin -> SEROUT -> SERIN -> SEROUT -> SERIN -> SEROUT -> SERIN...

Connect all RCK ("latchPin" from the reference example) and SRCLK (clockPin) pins together, then treat the lot a one big shift register.

Quote
In fact, i want to explode some KS0108  ... Nnnnooooo !!! just kidding, it is not related, i'm creating a "dynamic animated menu with user actions (4 buttons)" for GLCD library ... This was what i meant when saying i was working on it late last night and was totally decerebrated

Sorry simkard but we are obviously on different planets, I've asked maybe 4 times about the high-current shift regs and transistors and I'm still no wiser.

Good luck with this.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

simkard

Quote
Quote
In fact, i want to explode some KS0108  ... Nnnnooooo !!! just kidding, it is not related, i'm creating a "dynamic animated menu with user actions (4 buttons)" for GLCD library ... This was what i meant when saying i was working on it late last night and was totally decerebrated

Quote
Sorry simkard but we are obviously on different planets, I've asked maybe 4 times about the high-current shift regs and transistors and I'm still no wiser.


Yes we're on the same planet and i will definitely not need the transistors to drive my relays.
I just hope that i will not be running into some kind of problems with the relays coils (fly-backs) even if i use reverse-diodes.

The dynamic menu i'm working on for GLCD library is not related to what we are talking about in this thread.


Quote
Just daisy-chain all SRs

MEGA dataPin -> SEROUT -> SERIN -> SEROUT -> SERIN -> SEROUT -> SERIN...

Connect all RCK ("latchPin" from the reference example) and SRCLK (clockPin) pins together, then treat the lot a one big shift register.

Well, i still don't understand how do i drive the outputs of these shift-registers put in daisy chain ...

Ex. : Let's say i have 3 TPIC6C595, if i understood correctly, for driving the whole 24 outputs, i'll have to send 6 bytes which the first one will be ending on the 3rd TPIC6C595 ?


Thanks !

Graynomad

Here's a schematic using three '595s



The TPIC6B595 has a different pinout but you should get the idea from this.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

CrossRoads

Quote

driving the whole 24 outputs, i'll have to send 6 bytes which the first one will be ending on the 3rd TPIC6C595


24 outputs is 3 bytes (8 bits per byte), and yes the first byte in ends up at the farthest right shift register in GrayNomad's schematic.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

simkard

Haha, well ... one more time i was tired of coding so i said dumb things ...

I really have to sleep sometimes !  :smiley-mr-green:


Ok now i understood the whole thing.

I going to order the components right now and hope to receive them tomorrow.


Thanks for your help guys ! it was really gentle ! I greatly appreciate !


By the way, as i'm really not familiar with MOS type transistors, how do you think is the best way for connecting them to relay coils (+12V) with fly-back and all problematics concerned included ?


Thanks (Yes, this will be my last question ;) )

Graynomad

AFAIK the snubbing/flyback/whatever diode is all you need. FETs are more sensitive than transistors to ESD etc but I don't think you need to add anything more.

______
Rob  
Rob Gray aka the GRAYnomad www.robgray.com

simkard


AFAIK the snubbing/flyback/whatever diode is all you need. FETs are more sensitive than transistors to ESD etc but I don't think you need to add anything more.

______
Rob  


It is what i thought.
The only thing that i'm not confident with is the fact that MOSFETs are ESD more sensitives than basics transistors like TIP12x ...
What sort of precautions i have to take before manipulating them ?


Thanks !

Graynomad

I've never seen anyone add more protection for FETs but it does make sense.

There are all manner of TVS diodes, MOVs, varistors etc designed for this purpose.

If you mean physically handling them you can get anti-static wrist straps etc but I normally just ensure my hands are grounded to the package and desk or whatever when I pick a component up.  

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

Go Up