Author Topic: 9-bit Addressable Latch Required  (Read 2092 times)

0 Members and 1 Guest are viewing this topic.

Offline DocaraTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: gb
9-bit Addressable Latch Required
« on: July 08, 2018, 07:52:02 am »
Hi,

I'm using 3 Piezo Switches with RGB LEDs included. The LED's resistors are part of the assembly and the whole device is rated for 12V.

I would like to have individual control over each of these LEDs via uC but I cannot multiplex them in the usual way because they are too dim in operation and so I need them on 'statically'

The only way I can think off to is a 9-bit addressable latch (8-bit + 4-bit in practice) and just have the uC use 4 I/O pins for the addresses and 1 I/O pin for the data.

1. Is there an alternative (better) way to do this
2. Just to confirm - the output would always be present

Thanks
Matt
 

Offline JS

  • Frequent Contributor
  • **
  • Posts: 947
  • Country: ar
Re: 9-bit Addressable Latch Required
« Reply #1 on: July 08, 2018, 08:14:14 am »
9 bits on a single chip seems odd, pcf8574 is an adressable latch, active high, hi-z low (works as input when low) 8 IO pins, you would only need 2 pins on the micro to drive up to 8 of them, I2C control so adress is selected in the data bus, no external chip select. Pretty common and modules come with those to test as they are used to drive lcd displays and is a very versatile chip.

If you need a single chip a 9 bit shift register would do what you nees but it could generate some flikker as you load the data to it. Or a 16 bit serial to parallel converter. I don't know any 9 bits converter...




JS

If I don't know how it works, I prefer not to turn it on.
 

Offline DocaraTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: gb
Re: 9-bit Addressable Latch Required
« Reply #2 on: July 08, 2018, 08:20:52 am »
Hi JS,

I know you cant get a 9-bit addressable latch,  I need one - that's my problem!

Please read my post again I've suggested an 8 and 4

The I2C port expander route  looks an interesting direction to pursue

Thanks
Matt
 

Offline JS

  • Frequent Contributor
  • **
  • Posts: 947
  • Country: ar
Re: 9-bit Addressable Latch Required
« Reply #3 on: July 08, 2018, 08:24:37 am »
I saw that, but using 2 different ICs for the same task seems odd, and if you are short of pins you can probably use some of those extra 7 anyway, and the ones I said can be used as IO. I2C would be my first choice, even more olif you are counting your pins. 1 wire might hafe some solutions but I2C is the most obvious one to go.

JS

If I don't know how it works, I prefer not to turn it on.
 

Offline DocaraTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: gb
Re: 9-bit Addressable Latch Required
« Reply #4 on: July 08, 2018, 08:36:34 am »
The 16bit version (PCF8575) I think is a viable alternative, unfortunately it's only rated for 5V output so Tranny's will be needed.



 

Offline JS

  • Frequent Contributor
  • **
  • Posts: 947
  • Country: ar
Re: 9-bit Addressable Latch Required
« Reply #5 on: July 08, 2018, 08:40:37 am »
The 16bit version (PCF8575) I think is a viable alternative, unfortunately it's only rated for 5V output so Tranny's will be needed.
Yes, would be nice for it to be open collectors but I guess that's a different IC (let me know which)

I don't know your conf, you can certainly drive leds with this IC if 5V is good enough, current shouldn't be a problem. Also as it's only active high you'd ccant drive common anode leds...

JS

If I don't know how it works, I prefer not to turn it on.
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: 9-bit Addressable Latch Required
« Reply #6 on: July 08, 2018, 09:00:53 am »
Are they common anode?  If so TPIC6C595 will get you 8x 30V 100mA open drain outputs in a single chip for only 3 I/O pins (or an existing SPI bus + one extra /CS pin).   For the 9th output, use a discrete MOSFET, on another I/O pin.

 

Offline DocaraTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: gb
Re: 9-bit Addressable Latch Required
« Reply #7 on: July 08, 2018, 09:05:09 am »
Yeah also the nice thing about this one is the lack of registers to deal with. I dont quite get the need to have to write 2 bytes (1 for each port) all the time -very annoying!!

My application is 12V  common cathode.
https://www.camdenboss.com/camden-boss/cps22if-plwh-12rgb-plastic-rgb-illuminated-piezo-switch/c-23/p-18780

Gotta love transistors

Matt
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: 9-bit Addressable Latch Required
« Reply #8 on: July 08, 2018, 09:48:25 am »
Errrr ........ its datasheet shows common ANODE: https://www.camdenboss.com/products/datasheet/CPS22IF-LWH_series_D.pdf

 

Offline DocaraTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: gb
Re: 9-bit Addressable Latch Required
« Reply #9 on: July 08, 2018, 09:51:19 am »
Errrr ........ its datasheet shows common ANODE: https://www.camdenboss.com/products/datasheet/CPS22IF-LWH_series_D.pdf

Old mans blurry eyes  |O :-[ :-[ :-[

(I'm using the same set as the ones that tell me 18yr olds down the pup find me attractive LOL)
« Last Edit: July 08, 2018, 09:59:57 am by Docara »
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: 9-bit Addressable Latch Required
« Reply #10 on: July 08, 2018, 11:43:18 am »
Have you looked at the TPIC6C595 I suggested?   If you don't mind the 9th LED briefly flickering during updates (which could be so fast the flicker would be essentially invisible), you can drive the 9th LED MOSFET from the same I/O pin as data in to the  TPIC6C595 and just set the desired level immediately after clocking out the 8 bits, which gets it down to only 3 I/Os.

Its unfortunate that Camden Boss don't offer a 5V version of the buttons.
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: 9-bit Addressable Latch Required
« Reply #11 on: July 08, 2018, 04:55:02 pm »
Can you use a shift register? You can chain a pair of 74HC595's to get 16 bits and you don't have to use them all.

You could also use any number of different 8 bit latches or decoders and run the 9th LED directly from one of the uC pins.
 

Offline JS

  • Frequent Contributor
  • **
  • Posts: 947
  • Country: ar
Re: 9-bit Addressable Latch Required
« Reply #12 on: July 08, 2018, 05:47:31 pm »
Can you use a shift register? You can chain a pair of 74HC595's to get 16 bits and you don't have to use them all.

You could also use any number of different 8 bit latches or decoders and run the 9th LED directly from one of the uC pins.
That's the idea I was missing, I knew I was missing something as simple and efficent as that but I couldn't get it!

JS

If I don't know how it works, I prefer not to turn it on.
 

Offline boB

  • Frequent Contributor
  • **
  • Posts: 312
  • Country: us
    • my work www
Re: 9-bit Addressable Latch Required
« Reply #13 on: July 08, 2018, 07:28:55 pm »
Can you use a shift register? You can chain a pair of 74HC595's to get 16 bits and you don't have to use them all.

You could also use any number of different 8 bit latches or decoders and run the 9th LED directly from one of the uC pins.

Something like this is good.  AND, if you don't want to use 2 of them and 8 of the bits are going to be latched "somehow", maybe you could use the processor bit itself that is going into the 595 as the 9th bit ?  As long as they aren't written too often, you probably wouldn't notice that 9th LED being shortly turned on when 1's are coming out and into the shift register ?

Fun problem !

boB
K7IQ
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: 9-bit Addressable Latch Required
« Reply #14 on: July 08, 2018, 08:54:05 pm »
As I said 12 hours ago: TPIC6C595 + 1 MOSFET.   Its an 8 bit shift register that's controlled like a 74HC595, but has 30V 100mA open drain outputs.
 

Offline boB

  • Frequent Contributor
  • **
  • Posts: 312
  • Country: us
    • my work www
Re: 9-bit Addressable Latch Required
« Reply #15 on: July 08, 2018, 09:14:48 pm »
As I said 12 hours ago: TPIC6C595 + 1 MOSFET.   Its an 8 bit shift register that's controlled like a 74HC595, but has 30V 100mA open drain outputs.

Interesting part.  So, with the double-D FFs, looks like this could work and possibly without a FET if the LED current is within spec.

Wouldn't this require an extra microprcessor pin for the two clocks or maybe an inverter for double-edge clocking to get that
extra serial output to work right ?

boB
K7IQ
 

Online Ian.M

  • Super Contributor
  • ***
  • Posts: 12864
Re: 9-bit Addressable Latch Required
« Reply #16 on: July 08, 2018, 09:48:30 pm »
Its not relevant to the O.P's problem but there are also the TPIC6B595 - 50V, 150mA and the TPIC6A595 - 50V, 350mA in the same family. 

If you don't care about the data rippling across all the LEDs as its updated *, you only need two pins:  Clock  SRCK and RCK with one of them, and drive SER_IN and the MOSFET (via a 470R gate resistor so its gate capacitance doesn't slug the SER_IN risetime) with the other.  N.B. that configuration takes nine clock pulses to load a byte.   

* Given a fast enough MCU it can be updated in under 10us, so the ripple flicker is negligible.  Even if its 100 times slower, a 1ms ripple flash will barely be perceptible even in dim lighting
« Last Edit: July 08, 2018, 09:50:39 pm by Ian.M »
 

Offline DocaraTopic starter

  • Regular Contributor
  • *
  • Posts: 78
  • Country: gb
Re: 9-bit Addressable Latch Required
« Reply #17 on: July 09, 2018, 03:35:32 pm »
Hello Everyone,

Thank you all for the replies.

I couldn't see a 'Solved' button anywhere.

I am more than likely going to use either the MCP23017, MCP23S17 or PCF8575 16bit port extender and transistors to drive the (3x3) 12V LED's.

The way the internals are organised makes other things easier for me - combinations of changing colours, flashing. Additionally the use of SPI or I2C to control things is also a massive for pin count reasons.

I consider the question answered.

Thanks again

 
The following users thanked this post: JS


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf