LED Charlieplex Error [solved]

A forums to allow bugs and problems with Flowcode v7 to be reported and resolved.

Moderator: Benj

Post Reply
medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

LED Charlieplex Error [solved]

Post by medelec35 »

Error on compile:

Code: Select all

Description:   
Device:        PIC.12F.12F1840
Generated by:  Flowcode v7.3.0.6
Date:          Monday, January 22, 2018 07:56:52
Users:         1
Registered to: Martin
Licence key:   BA48R5
http://www.matrixtsl.com
Errors when generating C source code:
FC1.c : 647 : error : Unknown or missing port variable: $PORTB.0
FC1.c : 653 : error : Unknown or missing port variable: $PORTB.1
FC1.c : 659 : error : Unknown or missing port variable: $PORTB.2
FC1.c : 671 : error : Unknown or missing port variable: $PORTB.3

FINISHED

ports assigned:
CharlieP1.png
(50.28 KiB) Downloaded 1738 times
Attachments
FC1.fcfx
(14.05 KiB) Downloaded 169 times
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LED Charlieplex Error

Post by Benj »

Hi Martin,

Thanks for letting us know. I believe I have now solved the problem with this modified component.
led_charlieplexed.fcpx
(128.11 KiB) Downloaded 178 times
Unused pins are now tied to Pin 0 and so should always be valid.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: LED Charlieplex Error

Post by medelec35 »

Thanks Ben,
I can confirm that flowchart compiles ok.
The other issue regarding this is how to match the hardware with software.
As I have chose 4 pins (12LEDs) I'm looking for a diagram which will match LED1 on flowchart with LED1 on a circuit diagram ect.
Can the diagrams with LEDs numbered and matching pins be added to wiki?

Martin
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LED Charlieplex Error

Post by Benj »

Thanks Martin,

I'll get something like this uploaded to the wiki.
charliplex.jpg
charliplex.jpg (91.65 KiB) Viewed 3632 times
I believe the rule is that the LED connections stay as was from the last pin count say from 3 pins to 4 pins and then add the extra LEDs starting from pin0 and working your way through.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: LED Charlieplex Error

Post by medelec35 »

Perfect!
Thanks Ben.
Will try it and let you know how I get on.
Martin

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: LED Charlieplex Error

Post by medelec35 »

Hi Ben,
I can confirm that the 4 pin 12 LED version works 100% on 12F1840.
The version I posted required 1ms delay in between each LEDOn component.

Martin
Martin

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: LED Charlieplex Error

Post by Benj »

Thanks Martin,

That's brilliant thanks for letting us know. Glad it works nicely, do you think the delay should be added to the component to save you having to add it yourself?

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: LED Charlieplex Error

Post by medelec35 »

Glad I can help.
If you did add a delay, then It would be best to add a new parameter so you can specify as delay time in microseconds or milliseconds.
Reason for the choice is you may wish to dim the leds.
If not easy to do that then I believe it's best to add delay manually.
Martin

Post Reply