Modes to which pins and stuck in a mode

45 views
Skip to first unread message

JesseA

unread,
Apr 2, 2009, 1:40:51 AM4/2/09
to Arduinoboy
Got my arduinoboy almost working I think but i have some questions

pins 8-12 I assume correspond as follows?
8 - lsdj midi slave sync
9 - lsdj midi master sync
10 - lsdj keyboard mode
11 - midi to nanoloop sync
12 - mgb
13 - status light

Two strange things are going on:
1) when I cycle through the modes it always gets stuck on mode 4 (midi
to nanoloop) and the button press/hold won't let me get out of this
mode unless I hold reset on the arduino while holding the mode
button.
2) in mode 1 the arduino recognizes midi in but the only way i know
this is that the 5th led flashes when i hit a key on my synth (I
assume the 6th led or the status light should be blinking and not the
5th), no other mode recognizes midi in data. The only time the status
light comes on is when the arduino is powered on.

both of these things occur even after reuploading the
Arduinoboy1_1_0.pde and even with the gameboy link cable disconnected
and the arduino powered through usb vs the gameboy.

any ideas and am i supposed to upload each .pde? It looks as if when i
load Arduinoboy1_1_0.pde it shows all the other included .pde files in
tabs within the arduino software and I'm guessing they all upload as
one?

I might try diff't resistors on the midi in and out, i may have gotten
the wrong ones. they are 220hm 2W, heh and I read 1/2 or 1/4 should do
the trick.

trash80

unread,
Apr 2, 2009, 2:29:07 AM4/2/09
to Arduinoboy

> pins 8-12 I assume correspond as follows?
> 8 - lsdj midi slave sync
> 9 - lsdj  midi master sync
> 10 - lsdj keyboard mode
> 11 - midi to nanoloop sync
> 12 - mgb
> 13 - status light

its in reverse order, sorry for the confusion. though 13 is status, 12
is slave, 11 is master, 10 is keyboard mode, 9 is nano, 8 is mgb.

>
> Two strange things are going on:
> 1) when I cycle through the modes it always gets stuck on mode 4 (midi
> to nanoloop) and the button press/hold won't let me get out of this
> mode unless I hold reset on the arduino while holding the mode
> button.

if the gameboy wires are not plugged in correctly so that the gb
serial input is not hooked up, the arduino will hang on midi master
mode in this version. (its waiting for a +5v from the gb serial) ...
its kind of a bug, i didnt notice it before because my gb was always
plugged in. :D

if you want to fix the code without having to check your wires first
replace the function "modeLSDJMasterSync" in the Mode_LSDJ_MasterSync
file with this:

void modeLSDJMasterSync()
{
while(1){
readgbClockLine = PINC & 0x01; //Read gameboy's clock line
if(readgbClockLine) { //If Gb's Clock is
On
while(readgbClockLine) { //Loop untill its
off
checkLSDJStopped(); //Check if LSDJ hit
Stop
readgbClockLine = PINC & 0x01; //Read the clock
again
bit = (PINC & 0x04)>>2; //Read the serial
input for song position
setMode();
updateStatusLight();
}
countClockPause= 0; //Reset our wait
timer for detecting a sequencer stop

readGbSerialIn = readGbSerialIn << 1; //left shift the
serial byte by one to append new bit from last loop
readGbSerialIn = readGbSerialIn + bit; //and then add the
bit that was read

sendMidiClockSlaveFromLSDJ(); //send the clock &
start offset data to midi
} else {
setMode();
}

if (Serial.available() > 0) { //If serial data
was send to midi input
incomingMidiByte = Serial.read(); //Read it
Serial.print(incomingMidiByte, BYTE); //Send it to the
midi output
}
}
}

> 2) in mode 1 the arduino recognizes midi in but the only way i know
> this is that the 5th led flashes when i hit a key on my synth (I
> assume the 6th led or the status light should be blinking and not the
> 5th), no other mode recognizes midi in data. The only time the status
> light comes on is when the arduino is powered on.

your in mGB mode, it will blink to midi channels 1 to 4 on the first 4
lights, to each midi channel.

> any ideas and am i supposed to upload each .pde? It looks as if when i
> load Arduinoboy1_1_0.pde it shows all the other included .pde files in
> tabs within the arduino software and I'm guessing they all upload as
> one?

the main file will compile and upload everything. Arduinoboy1_1_0.pde

> I might try diff't resistors on the midi in and out, i may have gotten
> the wrong ones. they are 220hm 2W, heh and I read 1/2 or 1/4 should do
> the trick.

watt doesnt matter, it should be fine.

Best of luck,
Timothy

JesseA

unread,
Apr 2, 2009, 9:09:30 PM4/2/09
to Arduinoboy
I got it so I can cycle through all modes now without having to reset,
I believe it was a link cable wire.

The arduino is powered through the link cable but I cannot send or
receive any midi data from or to the arduino, I'm so close I just know
it though.
I can however receive data into the arduino via midi for sure in mgb
mode as the channel light flickers on keyboard note ons.

Is there a way to tell if the gameboy is sending data and the arduino
is receiving it properly? I have midiox installed on my pc and in lsdj
master mode if i hit start none of the leds light up on the arduino
(aside from the mode indicator light being on) and no data is received
in midiox through my usb midi interface.

I've also tried lsdj keyboard mode and tried sending note ons from my
synth to the corresponding lsdj funcitons such as c2 for start, c#2
for stop, etc and nothing happens.
I should probably take on each issue one at a time so how about midi
in to the arduino to gameboy for now. as i've mentioned in mgb mode
the leds flash for each midi channel, should any leds flash in other
modes when midi data is being sent and I just know I'm missing
something obvious.

thanks

JesseA

unread,
Apr 3, 2009, 2:23:29 AM4/3/09
to Arduinoboy
It works now, swapped the link cable and it helps to put lsdj into
slave mode + wait when sending midi data :)
Reply all
Reply to author
Forward
0 new messages