I had a comment from Håkon Nessjøen stating that he had success in shrinking the code to fit in the standard mega8 onboard. He stated that he had removed the links to the vprintf and vscanf libraries in the makefile and the code shrunk dramatically. Thanks Håkon for pointing that out, that was a great catch.
I set out this morning to do this myself and am happy to say I was successful. There were other changes that had to be made to the code to make it functional on the mega8. Unfortunately I am pressed for time this morning so I will document those changes in detail later. However, I have the updated code available for download here ( jy-mcu_mega8.zip ).
Here is a quick rundown of the changes I made:
- Changed fuse settings in mega8 to turn off div/8 fuse to make it run at 8MHz
- Changed F_CPU to 8000000 in 8x32matrix.c
- Changed delay.c for only 2 NOP’s for a 1us delay at 8MHz
- Changed timer naming for mega8 in 8x32matrix.c
- Commented out all ADC functions and temperature reading in 8x32matrix.c
- Re-worded demo text in 8x32matrix.c
- Added extra delay to ledarray_flash to allow for on/off time setting in 8x32matrix.c
- Removed linker flags in makefile for vprintf and vscanf
- Added avr-size to makefile to see size after compile
I’ll cover these in detail at a later time, hope this helps some of you out who didn’t feel comfortable replacing the mcu.