adamjvr / lolshield

Automatically exported from code.google.com/p/lolshield
0 stars 0 forks source link

LOL Shield Charlieplex library incompatable with Mega 1280/2560 #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. arduino 022
2. Mega 2560
3. LOL shield

What is the expected output? What do you see instead?
Nothing the charlieplex library is incompatible with Mega 1280/2560

What version of the product are you using? On what operating system?
see above

Please provide any additional information below.
http://arduino.cc/forum/index.php/topic,76626.0.html thread on this.

Original issue reported on code.google.com by capnrmor...@gmail.com on 26 Oct 2011 at 9:40

GoogleCodeExporter commented 9 years ago
someone has started trying to modify the code here:  still  no luck but a 
start...
http://atstechlab.wordpress.com/2011/02/04/arduino-mega-and-the-lol-shield/

Original comment by capnrmor...@gmail.com on 27 Oct 2011 at 5:05

GoogleCodeExporter commented 9 years ago
The version of the Charliplexing library found in the 0.2 beta release of the 
LolShield library is indeed incompatible with the Mega 2560.
On those boards, the pin mapping between the ports on the MCU and the Arduino 
ports is different. I believe this is a problem for the MEGA1280 based boards 
too. As the driver accesses the MCU ports directly instead of via the Arduino 
digial pin functions, the wrong pin mapping is used on the Mega boards. Also, 
the library does not setup interrupts when used with the MEGA2560 chips.

I've modified the version 0.2 beta version of the library to do the following:
1. Setup interrupts for MEGA2560 (I just added #defines, not sure if any other 
changes are needed).
2. Added code to remap the ports correctly when using the MEGA1280/2560.
3. Fixed a small bug which might improve display brightness. (was doing 13 
cycles of matrix, not 12).

I've tested it with my 2560, and it seems to work fine. Hopefully it will work 
with the 1280 too.

My changes are to the Charliplexing.cpp file. To try them out, replace the 
Charliplexing.cpp file in the LolSheild directory with the file attached to 
this issue. You will need to be using the 0.2 beta version of the library for 
this to work.

I was going to merge these changes to the development tree code, but it has 
been modified further since the 0.2 beta, such that my changes need re-working.

Perhaps we should put a patched version of the 0.2 beta on the downloads page 
as a temporary measure for those people that have the MEGA boards?

Original comment by retry...@gmail.com on 30 Oct 2011 at 12:58

Attachments:

GoogleCodeExporter commented 9 years ago
Apologies, I uploaded the wrong file. 

Original comment by retry...@gmail.com on 30 Oct 2011 at 1:00

Attachments:

GoogleCodeExporter commented 9 years ago
This worked along with updating the WProgram.h to Arduino.h in the 
charlieplexing.cpp and Figure.cpp. Thanks!

Original comment by kevinjkr...@gmail.com on 21 Dec 2011 at 5:50

GoogleCodeExporter commented 9 years ago
I will have a look at this as time allows. I will need some support with 
testing, though, since I do not own either ATMEGA1280 nor ATMEGA2560 systems.

Original comment by thilo.al...@gmail.com on 7 Jan 2012 at 8:02

GoogleCodeExporter commented 9 years ago
I got my Arduino Mega ADK and Lol shield today but was very disappointed to see 
that it did not work at all.

After some fiddling, I was able to get the "lol_shield test v1.pde" to work for 
my board. I am attaching the modified code (worked on Mega2560 and Arduino IDE 
v1.0). Hopefully, others in my situation will at least be able to test their 
shield LEDs and make them blink :)

I also refactored it and added some comments to make it more readable. 
Hopefully it will make sense to everyone and you can have fun tweaking it.

Original comment by amitkhan...@gmail.com on 27 Feb 2012 at 8:04

Attachments:

GoogleCodeExporter commented 9 years ago
I found another interesting thing that might help some of you.  I noticed 
yesterday that the LEDs lit up in an orderly fashion only if I attached the lol 
shield to the proto shield first and then attached the combination to the 
Arduino Mega. Trying to connect the lol shield directly to the board produced 
random LED patterns.

I wasn't able to figure this out yesterday but on closer inspection today, i 
found that the outer casing of the USB port on the Mega board was touching the 
solder joints underneath the lol shield. A little bit of tape on the USB port 
casing fixed the problem :)

I bought my lol shield from http://microcontrollershop.com/

Original comment by amitkhan...@gmail.com on 28 Feb 2012 at 8:05

GoogleCodeExporter commented 9 years ago
I've taken the liberty to update the patched Charliplexing.cpp that was 
submitted on Oct 29, 2011. It is up to date as of version 23 (released on Jan 
14 2012). I get a few artifacts here and there, but I don't have a different 
arduino to compare with. So, I don't know if this is expected behavior or not.

Original comment by dlow.m...@gmail.com on 15 Mar 2012 at 5:04

Attachments:

GoogleCodeExporter commented 9 years ago
Using your last charliplexing.cpp file i get the following compilation errors

In file included from Basic_Test.pde:32:
C:\Ardiuno\libraries\LoLShield/Charliplexing.h:21:27: error: HardwareTimer.h: 
No such file or directory
C:\Ardiuno\libraries\LoLShield/Charliplexing.h:22:20: error: wirish.h: No such 
file or directory
C:\Ardiuno\libraries\LoLShield/Charliplexing.h:23:16: error: io.h: No such file 
or directory

how can i solve this

Original comment by djmikemi...@gmail.com on 27 Feb 2013 at 5:08

GoogleCodeExporter commented 9 years ago
fixed in revision 30

Original comment by r...@ihack.net on 20 Aug 2013 at 5:42