7 segment display component not simulating

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
HARPADAMDC2
Posts: 4
http://meble-kuchenne.info.pl
Joined: Mon Jul 31, 2023 11:07 am

Flowcode v9 7 segment display component not simulating

Post by HARPADAMDC2 »

I'm creating a digital dice using 2 7 segment displays so it can show either numbers 1-6 or 2-12. To simulate the program I've put the displays on the 2D panel.
All was working okay, saving the program as I went along. Got it all to work in the end.
Re-opened the program the next day and the display doesn't work.
If I delete the displays, add them in again and reconnect it it does. Saving is okay. But if I close Flowcode and the reload it, again the display doesn't work.
When I simulate the program it warns me that not all the pins are connect to the display. Tried connecting them to unused pins on the microcontroller and I still get the same issue.
Also tried putting the displays on the 3D panel instead. Same issue.
I've attached the file. The button 'shakes' the dice and the switch changes between 1 or 2 dice.
I'm not using the component macros for the display, as I going the get students to code it and not get reliant on using micros, but understand the basic of turning outputs on/off.

Thanks
Dave
Attachments
7 Segment_Dice2.fcfx
(34.67 KiB) Downloaded 37 times

chipfryer27
Valued Contributor
Posts: 1147
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 284 times
Been thanked: 412 times

Re: 7 segment display component not simulating

Post by chipfryer27 »

Hi

I'm using FC 10.0.4.33 with full database updates and yourfile simulates OK for me, and compiles to Hex too.

Are you running latest versions?

Regards

HARPADAMDC2
Posts: 4
Joined: Mon Jul 31, 2023 11:07 am

Re: 7 segment display component not simulating

Post by HARPADAMDC2 »

Hi chipfryer.

Thanks for trying it. It looks like it might be something to do with my version of FC then.
I work at a University, (50 user educational license), so checked with our IT people what version we are on and about updates.
I'm on Educational V9. They have just updated it and I still can't get the simulation to run.
As before, If I delete the displays and build them back in, it simulates okay. If FC is closed and reopened and the file loaded then it doesn't.

Thanks

BenR
Matrix Staff
Posts: 1739
Joined: Mon Dec 07, 2020 10:06 am
Has thanked: 440 times
Been thanked: 603 times

Re: 7 segment display component not simulating

Post by BenR »

Hello,

Please can you try this and see how you get on. It looks like the Arduino style pin references $d0 on FC9 are havign problems after a reload.

I have changed the 7-seg component connections to the $port references and this now seems to be behaiving again.
7 Segment_Dice2.fcfx
(33.31 KiB) Downloaded 56 times

HARPADAMDC2
Posts: 4
Joined: Mon Jul 31, 2023 11:07 am

Re: 7 segment display component not simulating

Post by HARPADAMDC2 »

Hi Ben

Thanks for looking at it and sending my your program. When I changed the ports so the program works a s a dice, it didn't work.
I think I've found the actual problem. It's not to do with the Arduino style pin reference, but weather the common pin is connected or not. I think what was confusing my understanding of what needs to be connected, is, changes only seam to apply when the file is saved and then reloaded.
The common pin on the display must be connected to a chip pin even if the common pin is not selected.
See the attached file. Neither have a common pin selected. The LH one does have its common pin connected so works, while the RH one isn't connected so doesn't work.
If I select there to be a common pin on the RH one and connect it ($D11). It still won't work. But if I save the program and then relaod it, it will.
What do I do if the circuit hasn't a spare pin on the chip tom connect to the common pin, and so is connected to 0V.

Dave

HARPADAMDC2
Posts: 4
Joined: Mon Jul 31, 2023 11:07 am

Re: 7 segment display component not simulating

Post by HARPADAMDC2 »

7 Segment_Dice2-LHCommonConnected.fcfx
(35.04 KiB) Downloaded 28 times

Post Reply