Electronics > Projects, Designs, and Technical Stuff
16 bit to 4 digit 7 segment decoder
<< < (13/16) > >>
oPossum:
2N7000 and 2N7002 N channel MOSFETs will work with 5 volt CMOS logic. TO-92 or SOT-23 package.
obiwanjacobi:

--- Quote from: bson on January 27, 2020, 08:27:31 pm ---Many of the 48 pin QFP MSP430's will do this neatly, and have enough 16 bit ports to make life easy.  Since it's a 16-bit processor you can stage the segment output as 16 bit data in a pattern buffer, to be output to a 16-bit port to drive the segments, and just have a DMA controller continuously scan it, possibly triggered by a timer.  When the DMA gets to the end it interrupts and you restart it in the handler. Then to update the segments you write to the pattern buffer.  Since each segment gets the same number of words staged in the pattern buffer this becomes simple and reliable, without potentially weird timing problems as it might if different bits in different GPIO registers are updated in sequence.  Similarly on the input, a GPIO pin interrupts and you read a 16-bit I/O register.  If it has changed you wake the main CPU in the interrupt handler (DMA will run in some sleep modes, and you wake it by modifying the pushed status register; TI-CCS has C macros and functions for this), save the new value (so you can detect changes), translate it to digits, convert to segment I/O words and store them to the pattern buffer, and go back to sleep.

--- End quote ---

I'm looking forward to your version!  ;D :popcorn:


--- Quote from: edavid on January 27, 2020, 10:15:17 pm ---What's your peak segment current?  If it's 10mA, 70mA/digit is not all that far from the spec of 40mA per pin.  It would probably work OK.

--- End quote ---
Yep its 10mA per segement, but the MCU pin is only 20mA. I have it on the breadboard without cathode-driver and I wouldn't mind it being a little brighter.


--- Quote from: oPossum on January 27, 2020, 11:54:04 pm ---2N7000 and 2N7002 N channel MOSFETs will work with 5 volt CMOS logic. TO-92 or SOT-23 package.

--- End quote ---
Don't I need P-Channel here: low-side/cathode?
edavid:

--- Quote from: obiwanjacobi on January 28, 2020, 06:27:11 am ---
--- Quote from: edavid on January 27, 2020, 10:15:17 pm ---What's your peak segment current?  If it's 10mA, 70mA/digit is not all that far from the spec of 40mA per pin.  It would probably work OK.

--- End quote ---
Yep its 10mA per segement, but the MCU pin is only 20mA. I have it on the breadboard without cathode-driver and I wouldn't mind it being a little brighter.

--- End quote ---

On the datasheet (http://ww1.microchip.com/downloads/en/devicedoc/doc2512.pdf), page 197, it says 40mA per pin.

A modern display would be at least 10X brighter... just saying  :-//
obiwanjacobi:
Yes I see you're right. Wonder how I got 20mA in my head. Thanks!

I have been eyeing some modern 4 digit common cathode displays...
I think I'll design my PCB in such a way that both/multiple can be fitted - if its not too much trouble.
technix:
Maybe it is doable using just some logic chips? 74HC164 + 74HC4511 + ULN2003 + 74HCU04/74HC14 + 4x 74LVC4245. The choice of 74HCU04 versus 74HC14 depends on your clock choice, 74HCU04 for crystal and ceramic clocks, 74HC14 for RC clocks.
Navigation
Message Index
Next page
Previous page
There was an error while thanking
Thanking...

Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod