Hello Everyone !

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
assh_3886026
Level 1
Level 1
5 replies posted First question asked First reply posted

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? 

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

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

PSoC4-044-2.JPG

For PSoC 5LP there is a component 4 Digit 7-Segment LED Driver,

which works nicely with 4 Digit 7 Segment LED

PSoC5LP-059.JPG

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

schematic.JPG

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.

000-TeraTerm-log.JPG

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

IMG_3521.JPG

I hope this sample could be a little help for you.

moto

View solution in original post

0 Likes
10 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

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

0 Likes

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

0 Likes

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:

seg1.PNG

Then you would do the mapping as follows:

seg2.PNG

Please share the LCD datasheet if you need help with the mapping.

Regards,

Dheeraj

0 Likes
lock attach
Attachments are accessible only for community members.

Hi Dheeraj,

I'm attaching datasheet of a 3 digit 7 segment display that I have.

Can you please help me with mapping and configure segment LCD for this device ?

Regards,

Ashish

0 Likes

Are you working on PSoC 042 Kit? Please share your project, it will be easier.

Regards,

Dheeraj

0 Likes
lock attach
Attachments are accessible only for community members.

Hi,

I'm working with PSOC 046 kit. Please find the project in the attachment. 

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

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

PSoC4-044-2.JPG

For PSoC 5LP there is a component 4 Digit 7-Segment LED Driver,

which works nicely with 4 Digit 7 Segment LED

PSoC5LP-059.JPG

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

schematic.JPG

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.

000-TeraTerm-log.JPG

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

IMG_3521.JPG

I hope this sample could be a little help for you.

moto

0 Likes
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

Hi,

Now CY8CKIT-046 version

46L.JPG

Sorry, but pin assignment had to be changed.

moto

0 Likes

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

MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

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

0 Likes