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

Please tell us which board you are using.
For CircuitPython issues, ask in the Adafruit CircuitPython forum.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
admonish
 
Posts: 3
Joined: Wed Feb 21, 2018 7:44 am

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

Post by admonish »

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 715 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

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

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

Post by adafruit_support_mike »

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

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

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

Post by admonish »

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

User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

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

Post by adafruit_support_mike »

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.

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

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

Post by admonish »

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:)

Locked
Please be positive and constructive with your questions and comments.

Return to “Itsy Bitsy Boards”