supercrab / arduino-seven-segment

Arduino Library for 7 Segment LCD/LED Displays
20 stars 7 forks source link

Cascade Problem #4

Closed silencium2k closed 5 years ago

silencium2k commented 5 years ago

Hello Supercrab Thank you for making this awesome library. I am in the Process of building a fancy retro LCD speedometer. It all works so far with a 3 digit LCD. But when I try to cascade two AY0438 to be able to run 6 digits I can only get the first 3 digits running correct. On digit 4, 5 and 6 the segments are disordered. I think it might has something to do with the screen definition, because even when I want to get 3 digits running, I need to define "8.8|8" what is somehow strange, even with a 8.8.8 LCD it needs to be like that, otherwise the segments are disordered. With the "88:88:88" definition it does only show the first digit correct. I am sure that I have connected all the wires correct and I also looped the DATA IN on the second AY0438 through DATA OUT of the first one, like it's described in the Datasheet.

Have you ever had it running cascaded? Kind regards Silas

PS: I run it on an Arduino Nano Here is the code how I can only get the first 3 digits running correct:

`

include

define CLOCK 5 // Arudino digital 5 -> AY0438 clock

define DATA 6 // Arudino digital 6 -> AY0438 data

define LOAD 7 // Arudino digital 7 -> AY0438 load

SevenSegment screen(CLOCK, DATA, LOAD);

static char LCDout[6]; float LCDfloat;

void setup(void) { Serial.begin(9600); screen.begin("AY0438","8.8|8888"); // Set display driver AY0438 and screen definition

} void loop(void) { delay(1000);

LCDfloat = 123456;

dtostrf(LCDfloat, 6, 0, LCDout);

// Print on LCD screen.print(LCDout); } `

silencium2k commented 5 years ago

Look's like the only screen definitions that are actually working are "8" and "8.8|8.8"

supercrab commented 5 years ago

Hi

Apologies for the delay. Unfortunately, I don't have another LCD driver or bigger screen to test the cascadable mode.

Does it work with a single display? You said your display was 8.8.8 Your screen definition would be 8.8.8 | character is for defining a position where the screen could be a dot or a colon.

i can't see cascade mode wouldn't work, unless there's a problem I haven't foreseen. You could try driving the screen with 2 drivers and having 2 versions of my library.

Glad the library helped :) Send me some pictures of your display so I can check

Cheers M

On Thu, Nov 29, 2018 at 5:13 PM silencium2k notifications@github.com wrote:

Look's like the only screen definitions that are actually working are "8" and "8.8|8.8"

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-442916351, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJLNzlMphkzmPhcZqv0dveJ7R0U37ks5u0BWxgaJpZM4YxGOk .

silencium2k commented 5 years ago

Hi M Thanks for the respond. I actually have 2 separate LCD's that I drive. But the driver chips can not see that. They just give out the decoded numbers on their outputs. The small display is a 8.8.8 and the big one is a 8.8|8.8. I have two videos uploaded where both LCD's are parallel, not cascaded. One time with the screen definition 8.8.8 where both display do not show the third character correct, and in the second video with the 8.8|8.8 screen definition where all works fine, even the 8.8.8 LCD with actually not the 100% correct screen for that definition. But that's what I mean by saying the chip can't see what LCD it drives. This is all to show why I think not all screen definitions are working. It does only work with "8", "8.8" and "8.8|8.8"

https://www.youtube.com/watch?v=z_Ax1RhSTJw https://www.youtube.com/watch?v=pADS0e5ud4Q

I can make more videos or picture if it helps you, or I could try out some code for you for testing if you do not have 2 drivers.

Greetings Sil

silencium2k commented 5 years ago

Could you take a look at the screen definitions?

supercrab commented 5 years ago

Do you have any specs for the screens so I can check? It sounds like maybe something hasn’t been connected properly

On Tue, 4 Dec 2018 at 20:45, silencium2k notifications@github.com wrote:

Could you take a look at the screen definitions?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-444251317, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJDkV0IMNvvIIZoD6_9LYZMlaLlvyks5u1t7agaJpZM4YxGOk .

silencium2k commented 5 years ago

These are the screens:

8.8.8 https://www.tme.eu/gb/Document/36ea989336494bf685db273df7362b5e/DE123.pdf

8.8|8.8 https://www.tme.eu/gb/Document/d3696130517cb1dfdacdfd80b2685677/DE158.pdf

A wrong segment connection can't be the problem. Look in the videos how it works with the "8.8|8.8" definition on both screens. The driver chip can not see what it drives. It just gives out the decoded numbers on its outputs. Or am I wrong with this assumption?

supercrab commented 5 years ago

Yes, the driver is agnostic to the displays connected to it. Could you try something like this to check that every second a new segment is displayed? It sounds like there's could be one missing?

for s=0 to segmentcount { d.setSegment(s) delay(1000) }

On Fri, Dec 7, 2018 at 4:46 PM silencium2k notifications@github.com wrote:

These are the screens:

8.8.8 https://www.tme.eu/gb/Document/36ea989336494bf685db273df7362b5e/DE123.pdf

8.8|8.8 https://www.tme.eu/gb/Document/d3696130517cb1dfdacdfd80b2685677/DE158.pdf

A wrong segment connection can't be the problem. Look in the videos how it works with the "8.8|8.8" definition on both screens. The driver chip can not see what it drives. It just gives out the decoded numbers on its outputs. Or am I wrong with this assumption?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-445292569, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJMV1RvnbbzHXdbeEXzgn40n4M08Gks5u2pt6gaJpZM4YxGOk .

silencium2k commented 5 years ago

Sorry, that code doesn't work and I'm not very fit with coding so that I could fix it. But I did try that exact counting code from the demo:

include

define CLOCK 5 // Arudino digital 5 -> AY0438 clock

define DATA 6 // Arudino digital 6 -> AY0438 data

define LOAD 7 // Arudino digital 7 -> AY0438 load

SevenSegment screen(CLOCK, DATA, LOAD);

uint16_t counter = 0;

void setup(){

// Set display driver AY0438 and screen definition screen.begin("AY0438","8.8|8.8");

}

void loop(){

// String to print static char buf[8];

// Convert count to string sprintf(buf, "%04d\0", counter);

// Insert colon into string buf[5] = buf[4]; buf[4] = buf[3]; buf[3] = buf[2]; buf[2] = ':';

// Display screen.print(buf);

// Increment counter counter++;

// Wait a bit delay(100); }

It is working on both LCD's, the 8.8.8 and the 8.8|8.8 one. But it does only work with "8.8|8.8" in the screen definition. Not with "8.8.8", even though the small LCD is a 8.8.8 Like I said, it's something with the screen definitions

supercrab commented 5 years ago

Try this. Every second you should see a new segment illuminated. If nothing happens for a second then there is a missing segment `

include

define CLOCK 5 // Arudino digital 5 -> AY0438 clock

define DATA 6 // Arudino digital 6 -> AY0438 data

define LOAD 7 // Arudino digital 7 -> AY0438 load

SevenSegment screen(CLOCK, DATA, LOAD);

Serial.begin(9600);

void setup(){

// Set display driver AY0438 and screen definition screen.begin("AY0438","8.8|8.8"); }

void loop(){ for (uint_8 s = 0; s<23; s++) { Serial.println(s); screen.setSegment(s); delay(1000); } } `

segment 7 should be a decimal point segment 8 should be segment a segment 15 should be a decimal point segment 16 should be a colon

You need to identify which segment number (0-24) corresponds to which segment on your display. This will help you find the issue.

On Fri, Dec 7, 2018 at 11:25 PM silencium2k notifications@github.com wrote:

Sorry, that code doesn't work and I'm not very fit with coding so that I could fix it. But I did try that exact counting code from the demo:

include

define CLOCK 5 // Arudino digital 5 -> AY0438 clock

define DATA 6 // Arudino digital 6 -> AY0438 data

define LOAD 7 // Arudino digital 7 -> AY0438 load

SevenSegment screen(CLOCK, DATA, LOAD);

uint16_t counter = 0;

void setup(){

// Set display driver AY0438 and screen definition screen.begin("AY0438","8.8|8.8");

}

void loop(){

// String to print static char buf[8];

// Convert count to string sprintf(buf, "%04d\0", counter);

// Insert colon into string buf[5] = buf[4]; buf[4] = buf[3]; buf[3] = buf[2]; buf[2] = ':';

// Display screen.print(buf);

// Increment counter counter++;

// Wait a bit delay(100); }

It is working on both LCD's, the 8.8.8 and the 8.8|8.8 one. But it does only work with "8.8|8.8" in the screen definition. Not with "8.8.8", even though the small LCD is a 8.8.8 Like I said, it's something with the screen definitions

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-445396269, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJJ2lunW1HuQQ6KQSKM8T0-JSyr1zks5u2vjcgaJpZM4YxGOk .

silencium2k commented 5 years ago

I couldn't get it to work again. _"'uint8' was not declared in this scope" I tried including some libraries, but it didn't help. Please check this video where I show you some stuff concerning the issue.

https://youtu.be/22hA5P3dYoE

Greetings Sil

supercrab commented 5 years ago

Use uint8_t I think I had a typo!

On Mon, 10 Dec 2018 at 23:04, silencium2k notifications@github.com wrote:

I couldn't get it to work again. "'uint_8' was not declared in this scope" I tried including some libraries, but it didn't help. Please check this video where I show you some stuff concerning the issue.

https://youtu.be/22hA5P3dYoE

Greetings Sil

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-446008039, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJMB175kjGRPOa6kanMd-pZ0cozbAks5u3uhvgaJpZM4YxGOk .

silencium2k commented 5 years ago

Well yes, that was a typo, but now there is another thing wrong with the code. Not it says: _no matching function for call to 'SevenSegment::setSegment(uint8t&)'

Check the latest video I uploaded to youtube I can show all the letters and numbers I want, and it shows it all correctly. How can it be wrong wired up!?

supercrab commented 5 years ago

Ah yes, it should setSegment(s, true)

On Tue, 11 Dec 2018 at 17:06, silencium2k notifications@github.com wrote:

Well yes, that was a typo, but now there is another thing wrong with the code. Not it says: no matching function for call to 'SevenSegment::setSegment(uint8_t&)'

Check the latest video I uploaded to youtube I can show all the letters and numbers I want, and it shows it all correctly. How can it be wrong wired up!?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-446281222, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJIKbFq-QPWrOkbwwOqSW5udfaHDwks5u3-YlgaJpZM4YxGOk .

silencium2k commented 5 years ago

i'll try In the meantime: check the video pls :)

silencium2k commented 5 years ago

it doesn't do anything. Blank screens

supercrab commented 5 years ago

TRy this and film it

include

define CLOCK 5 // Arudino digital 5 -> AY0438 clock

define DATA 6 // Arudino digital 6 -> AY0438 data

define LOAD 7 // Arudino digital 7 -> AY0438 load

SevenSegment screen(CLOCK, DATA, LOAD);

Serial.begin(9600);

void setup(){

// Set display driver AY0438 and screen definition screen.begin("AY0438","8.8|8.8"); }

void loop(){ for (uint_8 s = 0; s<23; s++) { Serial.println(s); screen.setSegment(s, true); screen.display(); delay(1000); } }

On Tue, Dec 11, 2018 at 5:12 PM silencium2k notifications@github.com wrote:

it doesn't do anything. Blank screens

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-446283092, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJJaPQy3eRKdinEMxO7ghJI9KwhGqks5u3-dogaJpZM4YxGOk .

silencium2k commented 5 years ago

here you go. https://youtu.be/geDSMstvNg0 The dots I have not wired to the LCD's because I don't need them. The segment G on the 3rd figure doesn't show up somehow. but with all the other code I run it works, I can show all the numbers and letters I want and they are correct.

supercrab commented 5 years ago

If you haven’t wired the dots you don’t need dots in your screen initialisation! Try”8888”

On Tue, 11 Dec 2018 at 17:54, silencium2k notifications@github.com wrote:

here you go. https://youtu.be/geDSMstvNg0 The dots I have not wired to the LCD's because I don't need them. The segment G on the 3rd figure doesn't show up somehow. but with all the other code I run it works, I can show all the numbers and letters I want and they are correct.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-446297707, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJIiQ3BOOULTO90ae-p5rzP_AsxUVks5u3_FDgaJpZM4YxGOk .

supercrab commented 5 years ago

Read the bit about screen definition

On Tue, 11 Dec 2018 at 18:00, Mase supercrab@gmail.com wrote:

If you haven’t wired the dots you don’t need dots in your screen initialisation! Try”8888”

On Tue, 11 Dec 2018 at 17:54, silencium2k notifications@github.com wrote:

here you go. https://youtu.be/geDSMstvNg0 The dots I have not wired to the LCD's because I don't need them. The segment G on the 3rd figure doesn't show up somehow. but with all the other code I run it works, I can show all the numbers and letters I want and they are correct.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-446297707, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJIiQ3BOOULTO90ae-p5rzP_AsxUVks5u3_FDgaJpZM4YxGOk .

silencium2k commented 5 years ago

That was the very first screen definition that I run. Because it would be logical to use, I understand that, and yes I did read the description. BUT IT DOES NOT WORK, like I said maybe 10 times. The only screen definitions that are working correct are: "8", "8.8" and "8.8|8.8"

silencium2k commented 5 years ago

btw: with your test code and a screen definition of "8888" it gives the same result as before in the vid.

supercrab commented 5 years ago

If you have no decimal points or colons connected then try using 8888 as the definition.

On Tue, 11 Dec 2018 at 18:07, silencium2k notifications@github.com wrote:

btw: with your test code and a screen definition of "8888" it gives the same result as before in the vid.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-446302121, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJFue88n_XNKtvJjVxywXw6bzYxYUks5u3_RHgaJpZM4YxGOk .

silencium2k commented 5 years ago

Do you even read my answers????

supercrab commented 5 years ago

Yes sir! It’s difficult to debug when you’re not at the machine

On Tue, 11 Dec 2018 at 18:17, silencium2k notifications@github.com wrote:

Do you even read my answers????

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-446305441, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJPztYATdGL2lZ6vJreypQVrYMU1Sks5u3_argaJpZM4YxGOk .

supercrab commented 5 years ago

No need to be rude dear!

On Tue, 11 Dec 2018 at 18:17, silencium2k notifications@github.com wrote:

Do you even read my answers????

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-446305441, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJPztYATdGL2lZ6vJreypQVrYMU1Sks5u3_argaJpZM4YxGOk .

silencium2k commented 5 years ago

So believe me, it is not a wiring problem. That you could see, if you would check out the 3 videos I uploaded only for you and maybe also for other people that in the future want to use cascaded mode.

silencium2k commented 5 years ago

Yes man, sorry, I do not want to be rude, but you know, when I have to say the same stuff 5 times, I feel kind of not listened to and it does not bring anyone forward

supercrab commented 5 years ago

Do you realise that cascade mode is for extending the length of the display not for duplicating them?

On Tue, 11 Dec 2018 at 18:21, silencium2k notifications@github.com wrote:

So believe me, it is not a wiring problem. That you could see, if you would check out the 3 videos I uploaded only for you and maybe also for other people that in the future want to use cascaded mode.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/supercrab/arduino-seven-segment/issues/4#issuecomment-446306935, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDJJCLfGp0kpUrCoUVwf87lSG7-jFWyks5u3_eygaJpZM4YxGOk .

silencium2k commented 5 years ago

now we are talking. That i absolutely know and have tried it even long before i started this thread

silencium2k commented 5 years ago

now the screens are in parallel to show that it works on a 8.8.8 and a 8.8|8.8 LCD the same

silencium2k commented 5 years ago

I've been playing around with that counting code. That the last segment G hasn't been showing up was because it's limited to a total of 23 in the code. With 24 it works. In that counting code the screen definition does not have any effect by the way. It is doing absolutely the same regardless of what is in the screen definition. It even works when blank there.

supercrab commented 5 years ago

The point of the segment tester is to check that every segment a-f on each digit corresponds to the correct segment number that the screen definition expects. 0 = a1, 1 = b1, ..., 7 = a2, 14 = a3 and 21 = a4. If everything is wired up correctly then to access the same segment in the next digit then the you add 7 to the segment number with an LCD defined with "8888".

setSegment is a back door command and ignores any screen definition.

Try turning on debuging too and seeing what that gives in the output

define SERIAL_MESSAGES_ON 0

silencium2k commented 5 years ago

Yes I understand that, and like I said and showed in the video it does bring up all the segments in the right order. Have you watched the latest video I uploaded? There you can see that.

supercrab commented 5 years ago

Yes, on that particular video, there is a second delay after "8" and a 2 second delay after "88". That tells me that the library is turning on segment 7, and 15, 16 but nothing is displayed. This points to a wiring problem as something should be displayed on every segment. Can you check where what the segments are connected to? Counting from 1, it's segment 8, 16, 17

silencium2k commented 5 years ago

Like I said I did not wire up the dots intentionally because I don't need them in this application. It's not a wiring problem.

supercrab commented 5 years ago

I know they're not wired in. I'm asking what segments are illuminated when you do:

screen.setSegment(7, true); screen.setSegment(15, true); screen.setSegment(16, true); screen.display();

silencium2k commented 5 years ago

Thanks, I'll check that asap in the evening

silencium2k commented 5 years ago

I tested the code. There is no segment showing with it.

silencium2k commented 5 years ago

I also tested that code:

screen.setSegment(0, true); screen.setSegment(1, true); screen.setSegment(2, true); screen.setSegment(3, true); screen.setSegment(4, true); screen.setSegment(5, true); screen.setSegment(6, true); The first digit is showing "8"

screen.setSegment(8, true); screen.setSegment(9, true); screen.setSegment(10, true); screen.setSegment(11, true); screen.setSegment(12, true); screen.setSegment(13, true); screen.setSegment(14, true); The second digit is showing "8"

screen.setSegment(17, true); screen.setSegment(18, true); screen.setSegment(19, true); screen.setSegment(20, true); screen.setSegment(21, true); screen.setSegment(22, true); screen.setSegment(23, true); The third digit is showing "8"

On both LCD's

supercrab commented 5 years ago

"How can it be wrong wired up!?" - you have not wired segment numbers 7, 15, 16 (and possibly more on both displays). Each segment number in the library must be connected to the display "So believe me, it is not a wiring problem. " - it is a wiring problem the fact that nothing is displayed for segments 7, 15, 16 demonstrates this "Like I said I did not wire up the dots intentionally" - that's fine but you've left gaps in the segment wiring which means the screen initialization won't work properly.

supercrab commented 5 years ago

If you use the definitions you had before 8.8.8 and 8.8|8.8 you should be able to get around your issue without having to rewire the whole lot

supercrab commented 5 years ago

You can't expect the library to magically know that you haven't connected up all the segments to the display.

silencium2k commented 5 years ago

"Each segment number in the library must be connected to the display" Why? The AY0438 can not see if a dot is connected or not... so it does not care! All the segments I need are wired up correctly, and the library can not care about not connected segments if the segments that are being used are correct

silencium2k commented 5 years ago

"that's fine but you've left gaps in the segment wiring which means the screen initialization won't work properly." How can the screen initialization see what is connected and what isn't?

supercrab commented 5 years ago

The library doesn't care if you connect the dots or not... You must connect everything up in a sequential order! You did not connect the dots but you should have wired up the next digit

screen.setSegment(0, true); screen.setSegment(1, true); screen.setSegment(2, true); screen.setSegment(3, true); screen.setSegment(4, true); screen.setSegment(5, true); screen.setSegment(6, true); The first digit is showing "8"

screen.setSegment(7, true); // you fked up here - this is not connected to anything on the display

screen.setSegment(8, true); // you've connected your second digit to here screen.setSegment(9, true); screen.setSegment(10, true); screen.setSegment(11, true); screen.setSegment(12, true); screen.setSegment(13, true); screen.setSegment(14, true);

screen.setSegment(15, true); // nothing connected here either screen.setSegment(16, true); // or here

screen.setSegment(17, true); // third digit screen.setSegment(18, true); screen.setSegment(19, true); screen.setSegment(20, true); screen.setSegment(21, true); screen.setSegment(22, true); screen.setSegment(23, true);

supercrab commented 5 years ago

The screen initialization maps the internal representation of the screen to the physical screen.

If you had wired up the dots it would have worked perfectly or if you had connected segment 7 to the next digit. I can see you having trouble grasping how the concept of segment mapping works so I’ll spare you the details and suggest you require the screen to you get the expected results. If you leave out all the dots you will have 7*4 = 28 wires going from the driver to the display.

silencium2k commented 5 years ago

Is cascaded mode only activated when the screen initialization "88:88:88" is used?

supercrab commented 5 years ago

No, you have to set it with setCascaded(true). Bro, have you even looked at the code or even searched "cascade"?

supercrab commented 5 years ago

Come on now. This code is fairly old now, and I’ve not had chance to look at it much in the last 4 years. I’ve got a couple of kids and they're pretty demanding on my time and I suspect I'm being trolled here...

silencium2k commented 5 years ago

Yes I did look at the code, but I am no coder so I do only understand the basics. Well, searching for "cascade" would indeed have been a good idea. I didn't think of that. I actually though it automatically is giving the code out on DO if its longer that 32 segments or something like that.