Go Down

Topic: LDR with 7 seg display and PWM output (Read 13461 times) previous topic - next topic

cjcj

On eBay? I hope you opened a dispute!
I did write back to the seller saying "what tha".  Interested to see what he does.  If I have to return the unit, it'll probably cost me between $5 to $10.  Some seller are just dishonest!

PaulRB

I expect they will send you a replacement, rather than risk a dispute case or poor feedback. Question is do they understand difference between ds1307 and ds3231, if they are one of those bazar-type vendors that sell false nails and clothes that no self respecting woman would be seen wearing in public except on a hen night!

cjcj

Yes, your right.  Not sure if they understand the difference either.  I just had a reply from "Alice" and I had no idea what her reply ways so I wrote back in simpler english - "You send me wrong part.  Please send me right part = DS3231 NOT".  It makes me laugh.  But at the same time I ordered another unit for about $2 from someone else - "Plan B".

PaulRB

You mean alice1101983? They run the TxHang shop. I was recommended them by another forum member and have used them a couple of times without a problem.

cjcj

#49
Mar 30, 2015, 01:29 pm Last Edit: Mar 30, 2015, 01:37 pm by cjcj
    Now sorry if this question sounds a bit naive, but I'm trying to get my head how a TPIC6B595N shift register works and then daisy chaining 15 of them.  I have setup 2 x 74HC595 with an exercise noted in a book called "Beginning Arduino" to try and understand registers.  Is this what happens:
    • The Arduino generates binary code - 8 bits / 1 byte (i.e. 00010000) to depict a 7 segment digit number
    • This info is sent in serial (via a single line) to the shift register - pin 3 (SER IN)?
    • Each bit is sent/received 1 at a time and shoves the next spot in the register until all 8 are filled up (received)
    • To snapshot this, via the Arduino, "latch" is changed from Low to High  - this is pin 12 (RCL) or the register
    • This flip causes the bits to be copied to each of register output pins (drain0 to drain7)
    • This then repeats replacing the bits in the shift register

    Now, to cascade, is this correct?
    • All the 15 drain0's are connected together, and all 15 drain1's, are connected together etc, etc
    • All 15 latch pins are connected together - pin 12?
    • All 15 clock pins are connected together - pin 13?
    • To "shunt?" the 8 bits down from the first register to the next and next, pin 18 (SER OUT) is connected to pin 3 (SER IN) of the next register, and so on
    • Common anodes (in my case) are connected directly to 24V
    • The arduino PWM signal is connected to all the output enable pins (G) - pin 9 of each register
    • The arduino sends out 15 bytes at a time which fill each of the 15 shift registers

    Is this the basic idea?  So does this mean that 15 bytes of info are sent by the arduino ever microsecond or so, hence any change in 8-bit is displayed immediately in the 7 segment displays so 100 duty cycle?  And does it also mean that the dimming all the displays is controlled by a PWM signal from the Arduino to pin 9 of every shift register which essentially essentially creates a sort of duty cycle/pulse width?

    Maybe a question for Bob - other than the 15 shift registers, 20 pin IC sockets and 0.1uF caps for each register, is there any other basic components that I need to get started for this test?

PaulRB

#50
Mar 30, 2015, 04:54 pm Last Edit: Mar 30, 2015, 05:18 pm by PaulRB
  • The Arduino generates binary code - 8 bits / 1 byte (i.e. 00010000) to depict a 7 segment digit number
  • This info is sent in serial (via a single line) to the shift register - pin 3 (SER IN)?
  • Each bit is sent/received 1 at a time and shoves the next spot in the register until all 8 are filled up (received)
  • To snapshot this, via the Arduino, "latch" is changed from Low to High  - this is pin 12 (RCL) or the register
  • This flip causes the bits to be copied to each of register output pins (drain0 to drain7)
  • This then repeats replacing the bits in the shift register

Now, to cascade, is this correct?
  • All the 15 drain0's are connected together, and all 15 drain1's, are connected together etc, etc
  • All 15 latch pins are connected together - pin 12?
  • All 15 clock pins are connected together - pin 13?
  • To "shunt?" the 8 bits down from the first register to the next and next, pin 18 (SER OUT) is connected to pin 3 (SER IN) of the next register, and so on
  • Common anodes (in my case) are connected directly to 24V
  • The arduino PWM signal is connected to all the output enable pins (G) - pin 9 of each register
  • The arduino sends out 15 bytes at a time which fill each of the 15 shift registers

That all looks correct.

So does this mean that 15 bytes of info are sent by the arduino ever microsecond or so, hence any change in 8-bit is displayed immediately in the 7 segment displays so 100 duty cycle?
No, your sketch only sends the data when you want to change something. So for example if you were displaying the time as hh:mm you would only need to update once per minute.

And does it also mean that the dimming all the displays is controlled by a PWM signal from the Arduino to pin 9 of every shift register which essentially essentially creates a sort of duty cycle/pulse width?
Yes, your sketch can set the level with analogWrite(), again, only when it needs to change.

Maybe a question for Bob - other than the 15 shift registers, 20 pin IC sockets and 0.1uF caps for each register, is there any other basic components that I need to get started for this test?
For your small 7-seg displays, probably be ok, maybe add a 10uF for each display. For your large displays, some much larger caps, maybe 1000uF per digit.

CrossRoads

#51
Mar 30, 2015, 05:01 pm Last Edit: Mar 30, 2015, 06:19 pm by CrossRoads
All devices receive clock and latch in parallel.
1st device gets Serial data from processor, it's Serial Out goes to Serial In on next chip.
Example:
http://www.crossroadsfencing.com/BobuinoRev17/
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.

PaulRB

Quote
All the 15 drain0's are connected together, and all 15 drain1's, are connected together etc, etc
Oh, that's wrong. Each drain is connected to a separate segment cathode.

cjcj

You mean alice1101983? They run the TxHang shop.
Yes.  What a coincidence.  It was exactly the same person / company.
No, your sketch only sends the data when you want to change something. So for example if you were displaying the time as hh:mm you would only need to update once per minute
Yes, of course.  That makes sense.
For your small 7-seg displays, probably be ok, maybe add a 10uF for each display. For your large displays, some much larger caps, maybe 1000uF per digit.
Is that right?  I "thought" that each IC needs a 0.1uF capacitor as close to the Vcc as possible and ground in order to stop any resilient "noise".

All devices receive clock and latch in parallel.
1st device gets Serial data from processor, it's Serial Out goes to Serial In on next chip.  Example...
Yes, now that's starting to make sense.  Your link to the sketch now also is making sense.  So am I now understanding this correctly.  Your post #30 that shows a circuit board, is essentially exactly what I need (expect I need an extra 3 shift registers, plus having to connect my PWM signal?

PaulRB

Quote
I "thought" that each IC needs a 0.1uF capacitor as close to the Vcc as possible and ground in order to stop any resilient "noise".
Correct, you need those too. The larger caps are to smooth the sudden demand spikes when large currents are switched, such as your led segments. You might get away with minimal or no caps for your small prototype, depending how good your power supply is and how far away the chips are from it. But with your large displays and the long power lines you will probably have in the final build of the project, lots of large caps spread around would be a very good idea.

cjcj

I suppose then these are to replace the 0.1uF.  So do I put them next to each shift register (15 in total), and maybe 35V, 1000uF?

PaulRB

#56
Mar 31, 2015, 11:14 am Last Edit: Mar 31, 2015, 11:41 am by PaulRB
I mean you need (or might need) both. Definitely a 0.1uF decoupling cap for each chip (accross 5V & ground), plus (maybe) a larger cap to smooth the high-current switching (accross 24V & ground - check cap's voltage rating is adequate). With your small displays, maybe not needed at all. For the large displays, maybe 1000uF per display is overkill. I'm not sure how to estimate that, maybe Bob has some advice.

cjcj

All devices receive clock and latch in parallel.
1st device gets Serial data from processor, it's Serial Out goes to Serial In on next chip.
Bob,
So am I now understanding this correctly.  Your post #30 that shows a circuit board, is essentially exactly what I need (expect I need an extra 3 shift registers, plus having to connect my PWM signal?  And yes, any ideas on the number and placement of caps as suggested above?

Go Up