Cobra II - Flash and socket SPI BUS

Hello everyone,

I am currently messing about with my Cobra II (awesome board) and using a music module to playback some music. I noticed in the documentation for the music chip that is mentions you shouldnt use the same SPI Bus for the chip and an SD source. On the cobra II board do the SPI sources share the same BUS? Would wiring directly to the open pins instead of using the provided socket get around this?

I have got it playing 1 and a half music tracks before it seems to freeze up, even the IDE doesnt error it just drops out of debug. I am considering it might be a memory problem so will be looking at optimising the memory usage in my music module code but could this be related to sharing the same SPI bus?

Current setup

Cobra II
Music Module
External power supply

On a side note is it possible to power up the board and run the software using only the power supply? e.g not the usb cable


Paul Watts
Lost World Creations

Hi Paul,

I use a G120HDR to play music via the music module from SD without issue.

The G120 has 3 independent SPI buses, but the SD doesnt use these as it has it’s own SD interface on the chip.

Yes you can run your code just using the DC jack without needing the USB cable.

I can send you the code i use of that helps.


Ok thanks, just wanted to rule our the SPI bus. I am certain there is a memory leak somewhere.

Thats odd with the DC jack. When I plug it in using the DC jack only it just shows a white screen on the CP7 and does nothing, I have to plug in the usb cable to get it to boot the board :oS

Hello, its a 700 mah so I guess its not enough. Will have to try and get a more powerful one :o)

I have also seem to have fixed my music module, there does seem to be a problem with disposing of byte arrays. The memory doesnt appear to get cleared by automatic GC :o(. Just changed my code to always use the same buffer array instead of allocating a new one everytime :o)

Thanks for all your help :oD

Lost World Creations

that’s a better approach anyway, you’ll get much less memory used and less problems :slight_smile: (ask me how I know :slight_smile: :slight_smile: )

lol yeah it was working spot on last night after I rewrote my mp3 control. When I went back over my code that I wrote about a year ago I realised how inefficient it was, its always good to come back to things and clean them up :stuck_out_tongue:

Yes, this is insufficient power supply. The CP7 itself takes 700mA, and that leaves nothing for your board to run on.