0

Need help porting project from Arduino UNO to Itsy Bitsy 5V
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Need help porting project from Arduino UNO to Itsy Bitsy 5V

by admonish on Wed Feb 21, 2018 8:10 am

I'm building a small portable mp3-player and got it working on Arduino UNO so now I want to downsize and port it over to the Itsy Bitsy. I have been sitting here for hours now trying to get this thing to work but I cant work out which pins to use etc. Total newb here btw, my first project.

For playback Im using a no-name vs1053 shield which works perfectly with this library:
https://mpflaga.github.io/Arduino_Libra ... for_SdFat/

The UNO is currently connected to the shield like this:
03eac425503bc758.jpg
03eac425503bc758.jpg (20.14 KiB) Viewed 595 times


I have been trying to figure out which pins on Itsy Bitsy would correspond to the pins used on the UNO but I cant even get the SD-card to initialize. I'm assuming I can connect the SCK, MISO and MOSI pins on the Itsy Bitsy to the shield no problem, but the other pins I dont get.

These are the error messages I get when initializing the SD-card:
/** card returned an error response for CMD18 (read multiple block) */
uint8_t const SD_CARD_ERROR_CMD18 = 0X5;

/** ACMD41 initialization process timeout */
uint8_t const SD_CARD_ERROR_ACMD41 = 0XA;

Any help is greatly appreciated!

Best wishes, Thomas

admonish
 
Posts: 3
Joined: Wed Feb 21, 2018 7:44 am

Re: Need help porting project from Arduino UNO to Itsy Bitsy

by adafruit_support_mike on Thu Feb 22, 2018 1:37 am

To check, are you using the Itsy Bitsy with an ATmega32u4 microcontroller?

adafruit_support_mike
 
Posts: 63679
Joined: Thu Feb 11, 2010 2:51 pm

Re: Need help porting project from Arduino UNO to Itsy Bitsy

by admonish on Thu Feb 22, 2018 1:45 am

Hi Mike!

Yes that is correct:)

I should also point out, the SD-card reader is on the mp3-shield and is (from what I can understand) enabled via the CS-pin in the schematic.

Best wishes, Thomas

admonish
 
Posts: 3
Joined: Wed Feb 21, 2018 7:44 am

Re: Need help porting project from Arduino UNO to Itsy Bitsy

by adafruit_support_mike on Fri Feb 23, 2018 2:03 am

Good.. that means you're still working in the ATmega microcontroller family. Most of the code should work without needing more than a few changes in pin numbers.

The signal most likely to cause trouble will be DREQ. The VS1053 toggles a pin when its input buffer starts getting low to let the microcontroller know it's time to load more data, and that signal usually goes to a microcontroller pin that can recognize interrupts. That way the interrupt will suspend whatever code is running and do the audio data update before the VS1053's buffer runs dry.

The ATmeag32u4 has interrupts on different pins than the Uno's ATmega328, so check the Pinouts page to find a pin that will work:

https://learn.adafruit.com/introducting ... logic-pins

The XCS and XDCS signals can connect to any output pins.. they're basically the VS1053's way of saying, "there's no actual SPI standard, so nyah" and more or less do the job of a single CS signal like the SD card uses.

The RESET signal can also connect to any output pin. The microcontroller toggles that at startup to put the VS1053 in a known state.

adafruit_support_mike
 
Posts: 63679
Joined: Thu Feb 11, 2010 2:51 pm

Re: Need help porting project from Arduino UNO to Itsy Bitsy

by admonish on Fri Feb 23, 2018 7:28 am

Got it working now, thanks a bunch!

Even got the LiPoly backpack working with the Itsy Bitsy, so now the project is 300% smaller and 100% portable:)

admonish
 
Posts: 3
Joined: Wed Feb 21, 2018 7:44 am

Please be positive and constructive with your questions and comments.