- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello ,
I have a question about 7 segment LED drive.
I will connect segment LED and CYBLE416045-02 directly.
And Is it ok?
I will put some resistor between LED and CYBLE416045-02.
Maybe the current will be 10mA .
Is it ok?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kimi,
Here's a pic of a TopDesign schematic sheet of a 4-digit LED matrix drive circuit. This should give you start. Since you only need 3-digit, you can eliminate Digit4 and CR_segs_3.
The implementation code is pretty simple.
Load CR_segs_0 with the Digit1 segments you want to turn on.
Load CR_segs_1 with the Digit2 segments you want to turn on.
Load CR_segs_2 with the Digit3 segments you want to turn on.
Load CR_segs_3 with the Digit4 segments you want to turn on.
The 250 Hz clock to the LUT will automatically count up on each clock cycle.
Each clock cycle will select a different CR_seqs_x to output to the Segments of Digit1 through Digit4.
Additionally, the LUT will select which of the commons (cmns bus) gets selected active low to allow only the current to flow through the LEDs of Digitx being driven.
If you're interested here is the PSoC Creator TopDesign. It is not complete. The code to control the CR_segs_x registers is not present but it should be fairly simple too. You don't need to Start() the LUT or the CR_seqs_x registers.
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kimi,
How many digits? The CYBLE416045-02 although a fine part has limited IO.
If you're going to drive 7 segments of more than one digit, you will have to consider matrix multiplexing. Sadly, there is no component for the PSoC6 to do this. There is more than one for the other PSoCs.
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for the reply.
I will use 3 digits.
I use 11 IO to control 7 Segments.
8 IO is for SEGMENT. and 3 IO is for selecting DIGITs.
is there any problem?
Is there any specific IO to control segmnet?
Thanks and have a nice day~~
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kimi,
I think you're on the right track. Since you're probably driving the LEDs with a 3.3V source, consider using a 180 ohm series resistor to each segment. This will limit the current to 8 mA.
PSoC3, 4 and 5 have components that help with LED segment drive configurations. Sadly, this type of component is not available for the PSoC6.
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kimi,
Here's a pic of a TopDesign schematic sheet of a 4-digit LED matrix drive circuit. This should give you start. Since you only need 3-digit, you can eliminate Digit4 and CR_segs_3.
The implementation code is pretty simple.
Load CR_segs_0 with the Digit1 segments you want to turn on.
Load CR_segs_1 with the Digit2 segments you want to turn on.
Load CR_segs_2 with the Digit3 segments you want to turn on.
Load CR_segs_3 with the Digit4 segments you want to turn on.
The 250 Hz clock to the LUT will automatically count up on each clock cycle.
Each clock cycle will select a different CR_seqs_x to output to the Segments of Digit1 through Digit4.
Additionally, the LUT will select which of the commons (cmns bus) gets selected active low to allow only the current to flow through the LEDs of Digitx being driven.
If you're interested here is the PSoC Creator TopDesign. It is not complete. The code to control the CR_segs_x registers is not present but it should be fairly simple too. You don't need to Start() the LUT or the CR_seqs_x registers.
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kimi,
Have you come up with a solution for driving the 7 segment LED yet?
If not, are you planning on using PSoC Creator or ModusToolbox as your IDE?
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kimi,
I have proved using a logic scope the TopDesign logic is correctly muxing the Segments by using the Commons as a sink on each digit.
However ... My Bad!
My schematic above is only using 1 common pin to sink up to 8 segment currents. When ALL segments are turned on at a 8mA per segment current that is 64mA!!!. This is too much for one common pin to sink (max = 8mA). That is why I added NPN transistors on each common. (See pic below.) There are many NPN transistors available that can drive 100mA.
If you have larger LEDs that need more current than 8mA per segment drive you will need to make the following changes:
- The Pin_segments should drive a PNP transistor which sources Vdd to the current limiting resistors.
- If the PNP transistors are used to drive the segments, the PNP base logic needs to be inverted. You can do this by adding 'not' gates before the Pin_segments or invert the bit assignments for the segments in the SW.
- The current limiting resistors will most likely need to adjusted for the additional needed current. Most likely the value needs to be lowered.
- The NPN transistors on the common lines may need to support more current. You may need to select transistors with a higher Pd and/or a lower Vce specification.
You can use N-Channel FETs with low Rdson values. Be careful. The gate capacitance needs to be discharged quick enough to prevent inter-digit leakage.
I've included a new TopDesign that inverts the LUT outputs for cmdsel because of the NPN transistors.
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
kimi,
I've implemented the driver code for the 4 digit 7-segment LED driver for the PSoC6 if you are interested.
You can find it at the Code Share forum at link: 4 Digit 7-segment LED driver for the PSoC6
Len
"Engineering is an Art. The Art of Compromise."