- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need to interface a 4 digit 7 segment with a PSOC 4 device. I'm using Segment LCD component present in PSOC 4.2
I've successfully interfaced single digit 7 segment display with device. However, interfacing with 4 digits segment isn't working.
Can someone guide me through steps to program for 4 digit 7 segment display ?
For single digit segment, I've selected 7 segment lines and 1 common line. On the other hand, for 4 digits display, I'm choosing 7 segment lines and 4 common lines. Is this correct?
Solved! Go to Solution.
- Labels:
-
PSoC 4 Architecture
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I was also following this topic.
And I was trying to control 4 digit 7 segment LED with Segment LCD module.
It took me a few days till I finally noticed that a LED is NOT a LCD.
And to make things difficult for those who does not know this,
Segment LCD module almost looks like working for LED,
so I did a lot of tweaking... orz
For PSoC 5LP there is a component 4 Digit 7-Segment LED Driver,
which works nicely with 4 Digit 7 Segment LED
But we don't have the counter part of this for PSoC 4.
Anyway, after noticing that Segment LCD is not for LED, I hacked a switcher for PSoC 4 in verilog
=========================
module count4(
input reset,
input clk,
output reg [1:0] count,
output [3:0] com
) ;
always @ (posedge clk or posedge reset) begin
if (reset == 1'b1) begin
count <= 2'b00 ;
end else begin
count <= count + 2'b01 ;
end
end
assign com[3] = (count == 2'd3) ? 1'b1 : 1'b0 ;
assign com[2] = (count == 2'd2) ? 1'b1 : 1'b0 ;
assign com[1] = (count == 2'd1) ? 1'b1 : 1'b0 ;
assign com[0] = (count == 2'd0) ? 1'b1 : 1'b0 ;
endmodule
=========================
And the schematic looks like
Although the count4 is for 4 digit 7 segment LED,
if you don't connect 1 of com bits, it should work for 3 digit 7 segment LED.
After building and loading the project,
you can test the behavior of the program like commands below from TeraTerm.
Note: When I started this project, I was thinking that the display is LCD,
so the LCD(x) = x is wrong now, but I hope that you can understand what it means.
After entering the command above, my LED showed
I hope this sample could be a little help for you.
moto
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please share the datasheet of the Segment LCD you are interfacing with. It will contain information on the number of segments and commons you need.
Regards,
Dheeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi Dheeraj,
I'm working with 7 segment LED display, and it's common anode type. It doesn't need any specific command for it's operation. To interface single digit segment with PSOC 4200L device, I followed this video tutorial
PSoC 4 - Display 7 Segmentos CY8CKIT-042 - YouTube
I'm trying to extend this understanding for a 4 digit display with help of datasheet provided for LCD segment by cypress and not being able to figure out which step I'm missing or doing wrong.
Regards,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Every Segment LCD has a segment-common mapping table. You need to assign each pixel to right segment-common in the Display Helpers tab in the Segment LCD configurator.
For example, suppose the datasheet for your 7 segment LCD (with decimal points) has the following mapping table:
Then you would do the mapping as follows:
Please share the LCD datasheet if you need help with the mapping.
Regards,
Dheeraj
- 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
Are you working on PSoC 042 Kit? Please share your project, it will be easier.
Regards,
Dheeraj
- 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
Hi,
I was also following this topic.
And I was trying to control 4 digit 7 segment LED with Segment LCD module.
It took me a few days till I finally noticed that a LED is NOT a LCD.
And to make things difficult for those who does not know this,
Segment LCD module almost looks like working for LED,
so I did a lot of tweaking... orz
For PSoC 5LP there is a component 4 Digit 7-Segment LED Driver,
which works nicely with 4 Digit 7 Segment LED
But we don't have the counter part of this for PSoC 4.
Anyway, after noticing that Segment LCD is not for LED, I hacked a switcher for PSoC 4 in verilog
=========================
module count4(
input reset,
input clk,
output reg [1:0] count,
output [3:0] com
) ;
always @ (posedge clk or posedge reset) begin
if (reset == 1'b1) begin
count <= 2'b00 ;
end else begin
count <= count + 2'b01 ;
end
end
assign com[3] = (count == 2'd3) ? 1'b1 : 1'b0 ;
assign com[2] = (count == 2'd2) ? 1'b1 : 1'b0 ;
assign com[1] = (count == 2'd1) ? 1'b1 : 1'b0 ;
assign com[0] = (count == 2'd0) ? 1'b1 : 1'b0 ;
endmodule
=========================
And the schematic looks like
Although the count4 is for 4 digit 7 segment LED,
if you don't connect 1 of com bits, it should work for 3 digit 7 segment LED.
After building and loading the project,
you can test the behavior of the program like commands below from TeraTerm.
Note: When I started this project, I was thinking that the display is LCD,
so the LCD(x) = x is wrong now, but I hope that you can understand what it means.
After entering the command above, my LED showed
I hope this sample could be a little help for you.
moto
- 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
Hi moto,
Thanks a lot for clarifying this and putting your efforts for the project.
I've successfully replicated the results at my end. Again, thanks.
Regards,
Ashish
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Ashish-san,
LSB
segment[0] = a
segment[1] = b
segment[2] = c
segment[3] = d
segment[4] = e
segment[5] = f
segment[6] = g
segment[7] = DP
MSB
Best Regards,
29-Mar-2019
Motoo Tanaka