chipKIT® Development Platform

Inspired by Arduino™

LOL Shield library

Created Sat, 07 Jan 2012 10:05:24 +0000 by stefan646


stefan646

Sat, 07 Jan 2012 10:05:24 +0000

I am trying to compile a code on my max32 using the LOL Shield library, but i get the next error: "

C:\mpide-0023-windows-20111221.\hardware\pic32\libraries\LoLShield\Charliplexing.cpp:33:27: fatal error: avr/interrupt.h: No such file or directory compilation terminated."

I search on forum about avr/interrupt.h but i didn't understand the problem entirely. So what i must do to resolve the problem?


majenko

Sat, 07 Jan 2012 12:51:00 +0000

The problem here is that the LOL library has been written specifically to work on ATMEL based Arduino boards.

You would need to re-write the library to use the PIC32 chip instead. Specifically the interrupt code (which is probably linked to timer code, so that will need re-writing too).

Someone may have already done the work for you though - have you googled for a ChipKit specific LOL library?


stefan646

Sat, 07 Jan 2012 13:03:58 +0000

have you googled for a ChipKit specific LOL library?

Yes I have, but I didn't found anything :(


stefan646

Tue, 10 Jan 2012 08:13:37 +0000

You would need to re-write the library to use the PIC32 chip instead. Specifically the interrupt code (which is probably linked to timer code, so that will need re-writing too).

How do I re-write the library?


rasmadrak

Tue, 10 Jan 2012 09:01:48 +0000

How do I re-write the library?

Sorry if this sounds rude, but rewriting a library most often requires fundamental knowledge of both the original code/platform and the new one.

What I would do is instead asking what the LOL library does and try writing/searching for something similar instead of asking for the exact same library. How does the LOL shield communicate - Serial, SPI, I2C etc?

Without saying too much, I'm guessing it's more likely a couple of shift registers being bit-banged or communicating via SPI. In that case the standard libraries will work.


majenko

Tue, 10 Jan 2012 09:23:54 +0000

The LOL library is a Charlieplexing library using (I believe) the standard digital IO lines of the Arduino.

It is most likely timer+interrupt driven, and may well use direct IO port access for speed.


stefan646

Tue, 10 Jan 2012 11:22:02 +0000

The LOL library is a Charlieplexing library using (I believe) the standard digital IO lines of the Arduino.

Yes it is.

I guess i would need to write my own equivalent code. Thank you all for the answers.


milos.dzaleta

Tue, 10 Jan 2012 15:48:03 +0000

If someone rewrite this library please post it. I was trying to rewrite but with no success.

Thank you in advance!


n9wxu

Fri, 28 Dec 2012 04:23:26 +0000

Here is a LOL shield library. You should remove R35 on a MAX32 or R37 on a UNO32 or you will have ghosting.

The MAX32 has dim columns but the UNO32 works great.

This version has 16 shades of grey and uses the CORE timer. Most of the canned demo's work fine.


GastonLagaffe

Thu, 07 May 2015 12:23:45 +0000

Salut,

the ZIP-file in the last post is not in the correct zip format. Does anyone have a valid copy of the file (I tried multiple zip-packers)

Ciao, Mathias


majenko

Thu, 07 May 2015 12:41:23 +0000

Our previous hosting company managed to wholesale corrupt all our forum attachments somehow. I'll find out if this one is available in one of our backups.


majenko

Thu, 07 May 2015 15:19:32 +0000

Should be working now.


GastonLagaffe

Thu, 07 May 2015 15:43:53 +0000

Salut Matt,

thanks for the rapid reply - the file works! All left for me is to get it now to run on my HelvePic32 ;) It is also a good opportunity to dive into timer programming

Thanks again for the very fast response, Mathias


GastonLagaffe

Thu, 07 May 2015 17:57:15 +0000

Salut,

code works. For completeness and if someone wants to use the LoLShield with the HelvePic32/DP32: In Charliplex.ccp at line 146 insert:

/* For HelvePic32/DP32 */
#ifdef __32MX250F128B__
/* DP32  Pin Mapping                                        FEDCBA9876543210 */
/* DP32  Pin Mapping                                        543210           */
const pin_map_t pin02 = {(port_t*)&TRISB, 0b00000000000000001000000000000000}; //RB15
const pin_map_t pin03 = {(port_t*)&TRISB, 0b00000000000000000100000000000000}; //RB14
const pin_map_t pin04 = {(port_t*)&TRISB, 0b00000000000000000010000000000000}; //RB13
const pin_map_t pin05 = {(port_t*)&TRISB, 0b00000000000000000000001000000000}; //RB9
const pin_map_t pin06 = {(port_t*)&TRISB, 0b00000000000000000000000100000000}; //RB8
const pin_map_t pin07 = {(port_t*)&TRISB, 0b00000000000000000000000010000000}; //RB7
const pin_map_t pin08 = {(port_t*)&TRISB, 0b00000000000000000000000000001000}; //RB3
const pin_map_t pin09 = {(port_t*)&TRISB, 0b00000000000000000000000000000100}; //RB2
const pin_map_t pin10 = {(port_t*)&TRISB, 0b00000000000000000000000000000010}; //RB1
const pin_map_t pin11 = {(port_t*)&TRISB, 0b00000000000000000000000000000001}; //RB0
const pin_map_t pin12 = {(port_t*)&TRISA, 0b00000000000000000000000000000010}; //RA1 
const pin_map_t pin13 = {(port_t*)&TRISA, 0b00000000000000000000000000000001}; //RA0
#endif

and around line 332 (after the insert):

void alloff()
{
#ifdef __32MX250F128B__
//                                5432109876543210
    TRISASET =  0b00000000000000000000000000000011;
    TRISBSET =  0b00000000000000001110001110001111;
#else
    TRISDSET =  0b00000000000000000000011100001111;
    TRISFSET =  0b00000000000000000000000000000010;
    TRISGSET =  0b00000000000000000000001111000000;
#endif
}

Honestly: the PIC platform with UECIDE really is fun! Thanks for this support, Mathias