Page 1 of 1

LED Charlieplex Error [solved]

Posted: Mon Jan 22, 2018 9:05 am
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

Re: LED Charlieplex Error

Posted: Mon Jan 22, 2018 11:25 am
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.

Re: LED Charlieplex Error

Posted: Mon Jan 22, 2018 11:46 am
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

Re: LED Charlieplex Error

Posted: Mon Jan 22, 2018 12:06 pm
by Benj
Thanks Martin,

I'll get something like this uploaded to the wiki.
charliplex.jpg
charliplex.jpg (91.65 KiB) Viewed 3633 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.

Re: LED Charlieplex Error

Posted: Mon Jan 22, 2018 12:44 pm
by medelec35
Perfect!
Thanks Ben.
Will try it and let you know how I get on.

Re: LED Charlieplex Error

Posted: Mon Jan 22, 2018 9:55 pm
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

Re: LED Charlieplex Error

Posted: Tue Jan 23, 2018 11:14 am
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?

Re: LED Charlieplex Error

Posted: Tue Jan 23, 2018 11:24 am
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.