Jump to content

Led Matrix for older PIC cores in C


eliasaudio
 Share

Recommended Posts

Of course, it's possible to create a LED matrix with a PIC18F in C.

Unfortunately there is no simple example available, only complex examples like this one: http://svnmios.midibox.org/listing.php?repname=svn.mios&path=%2Ftrunk%2Fapps%2Fcontrollers%2Fmidibox_mm%2F&#

(see SR_Service_Prepare() function in src/main.c and the appr. code in src/mm_vpot.c)

 

Best Regards, Thorsten.

Link to comment
Share on other sites

Nice !

I'm also very interested in creating a LED matrix with a PIC18F in C !

I'll try to digest the code, and propose a stripped down version when i find some time.

Also i'm curious to know if a 16x16 leds is doable, and what would be the best hardware approach to do so ?

Any ideas are very welcome :)

Link to comment
Share on other sites

Yes, 16x16 matrices can be handled in C w/o problems, especially because the actual DOUT transfers are handled by MIOS8 in background with an optimized assembly based routine.

 

The mechanism is always the same: SR_Service_Prepare() will be called before the SRIO scan (each mS)

In this function, increment a counter variable on each cycle, reset to 0 once it reaches 16

Transfer the new pattern (which corresponds to the counter and is ideally stored in an array) via MIOS_DOUT_SRSet

 

Please note: a 16x16 LED matrix means that the 16 LED rows will only be visible for 6.25% of the time - the brightness won't be optimal!

It's better to implement two 8x16 matrices instead (counter from 0..7)

 

Best Regards, Thorsten.

Link to comment
Share on other sites

  • 2 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...