ATMega168 and SD Card [Can't get it work].. PLease help.

Hello there :slight_smile:

Please help me solve my problem with SD Card and my AtMega 168 microcontroller. I've read that this MCU have a small RAM. The sketch uploads with no problem. But when i run the serial monitor.... the word "Initializing" and unusual ascii characters appear. Everything works fine with with my 328. But not in 168. DO i need to tweak something in the libraries? Please.. I have no more money to buy a new one :smiley: Please help.

Thanks in advance.

The 328 has twice as much memory as the 168, is your sketch running out of memory?

How much are you using? Is the SD card already formatted?

Actually, i am just using the samples sketch of SD in arduino. If I use 328, everything is fine, but when i use 168, doesn't work.

I am using SD/MMC shield

To test, i uploaded the sketch to atmega168 then using a serial monitor, it say "12nitializing?6?2" blah blah blah... I detached the SD shield, SAME....

That looks like you have not got the baud rate the same in the serial monitor and the sketch.

Can you provide links to the code you are trying to run and the hardware you have.

If I use 328, everything is fine, but when i use 168, doesn't work.

Is "You don't have enough memory" that hard to understand?

The SD class reserves 512 bytes for a buffer FOR EACH OPEN FILE. Since a 168 has 1024 bytes of memory, the single buffer uses half of it.