How do you connect to Midi?
Moderator: Benj
-
- Posts: 68
- Joined: Mon Oct 24, 2011 7:50 pm
- Has thanked: 11 times
- Been thanked: 3 times
- Contact:
How do you connect to Midi?
Hello,
I am trying to output some simple midi notes using the flowcode basic midi output example. The problem is, I can't seem to find out how to connect the midi input cable to the AVR microcontroller. Which pins do I need to connect?
I am trying to output some simple midi notes using the flowcode basic midi output example. The problem is, I can't seem to find out how to connect the midi input cable to the AVR microcontroller. Which pins do I need to connect?
- Steve
- Matrix Staff
- Posts: 3422
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: How do you connect to Midi?
The MIDI IN and MIDI OUT pins can be selected via the component connections screen for the MIDI component in the Flowcode program. Find the MIDI component on the panel, right click it and select "connections".
-
- Posts: 68
- Joined: Mon Oct 24, 2011 7:50 pm
- Has thanked: 11 times
- Been thanked: 3 times
- Contact:
Re: How do you connect to Midi?
Thank you for the reply! I know how to do that, what I was asking is, how do you physically connect the microcontroller to the midi device's 5-pin input? Is there any required circuitry?Steve wrote:The MIDI IN and MIDI OUT pins can be selected via the component connections screen for the MIDI component in the Flowcode program. Find the MIDI component on the panel, right click it and select "connections".
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: How do you connect to Midi?
Hi
yes it will require additional circuitry as you need to interface the avr to the midi, ensuring neither get destroyed a quick search on google yielded this
http://www.avrfreaks.net/index.php?modu ... icle&id=19
i had a quick scan of it and it contains connection details
hth
yes it will require additional circuitry as you need to interface the avr to the midi, ensuring neither get destroyed a quick search on google yielded this
http://www.avrfreaks.net/index.php?modu ... icle&id=19
i had a quick scan of it and it contains connection details
hth
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
-
- Posts: 68
- Joined: Mon Oct 24, 2011 7:50 pm
- Has thanked: 11 times
- Been thanked: 3 times
- Contact:
Re: How do you connect to Midi?
Awesome thanks! I tried the circuit but the midi device doesn't seem to be receiving any midi information. Could this be because I'm using the internal RC oscillator in the microcontroller? Do I need a crystal oscillator for this to work?dazz wrote:Hi
yes it will require additional circuitry as you need to interface the avr to the midi, ensuring neither get destroyed a quick search on google yielded this
http://www.avrfreaks.net/index.php?modu ... icle&id=19
i had a quick scan of it and it contains connection details
hth
- Steve
- Matrix Staff
- Posts: 3422
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: How do you connect to Midi?
You will certainly need to make sure your timing is right to receive MIDI signals. But as long as you've set the oscillator correctly and can achieve the appropriate bitrate, you should be ok with an internal oscillator.
-
- Posts: 68
- Joined: Mon Oct 24, 2011 7:50 pm
- Has thanked: 11 times
- Been thanked: 3 times
- Contact:
Re: How do you connect to Midi?
So do you think the fact that I am using the RC oscillator is not the problem?Steve wrote:You will certainly need to make sure your timing is right to receive MIDI signals. But as long as you've set the oscillator correctly and can achieve the appropriate bitrate, you should be ok with an internal oscillator.
- Benj
- Matrix Staff
- Posts: 15312
- Joined: Mon Oct 16, 2006 10:48 am
- Location: Matrix TS Ltd
- Has thanked: 4803 times
- Been thanked: 4314 times
- Contact:
Re: How do you connect to Midi?
RC oscillator should work if it is stable and you have defined the frequency correctly in Flowcode. eg so 1 second delays in Flowcode = 1 second on the hardware.
If 1 second delays do not match on the hardware then the MIDI baud rate will also be incorrect.
If 1 second delays do not match on the hardware then the MIDI baud rate will also be incorrect.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
-
- Posts: 68
- Joined: Mon Oct 24, 2011 7:50 pm
- Has thanked: 11 times
- Been thanked: 3 times
- Contact:
Re: How do you connect to Midi?
Oscillator seems correct, but the midi device still doesn't seem to be receiving anything.Benj wrote:RC oscillator should work if it is stable and you have defined the frequency correctly in Flowcode. eg so 1 second delays in Flowcode = 1 second on the hardware.
If 1 second delays do not match on the hardware then the MIDI baud rate will also be incorrect.
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: How do you connect to Midi?
another thought, have you looked at the docs for the midi eblock on the main sight ,might help also can you post your code so others can see and maybe help and what micro are you using
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
-
- Posts: 68
- Joined: Mon Oct 24, 2011 7:50 pm
- Has thanked: 11 times
- Been thanked: 3 times
- Contact:
Re: How do you connect to Midi?
I looked through the midi E-block datasheet. There is one difference that I spotted between my circuit and the E-block; my circuit doesn't have a buffer chip, but the E-block does. Is this what's causing it to not work?dazz wrote:another thought, have you looked at the docs for the midi eblock on the main sight ,might help also can you post your code so others can see and maybe help and what micro are you using
Chip I am using:
Attiny2313(AVR)
Clock speed: 8mhz
I have attached the flowcode file that I have been using.
Thanks for the help!
- Attachments
-
- 2. MIDI Basic Output.fcf_avr
- (4.5 KiB) Downloaded 258 times
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: How do you connect to Midi?
Hi
From memory the buffer is there stregnthen the output current so may have a bearing, also are the midi component pins in flowcode connected out =pd1 in =pd0
are the connections as follows (PD1is from the ATtiny2313 data sheet),
ATtiny2313 digital pin 3 PD1(TXD) connected to MIDI jack pin 5
MIDI jack pin 2 connected to ground
MIDI jack pin 4 connected to is there to protect the +5V through 220-ohm resistor ( Please double check i gave the correct pinout as im not responsible for wrong connections ,starting world war3 or diconnecting the country from the national grid )
another thing is i dont usually use avr's i keep killing em, are the configs correct as i have ruined a few by writing the wrong config data
hope this helps
From memory the buffer is there stregnthen the output current so may have a bearing, also are the midi component pins in flowcode connected out =pd1 in =pd0
are the connections as follows (PD1is from the ATtiny2313 data sheet),
ATtiny2313 digital pin 3 PD1(TXD) connected to MIDI jack pin 5
MIDI jack pin 2 connected to ground
MIDI jack pin 4 connected to is there to protect the +5V through 220-ohm resistor ( Please double check i gave the correct pinout as im not responsible for wrong connections ,starting world war3 or diconnecting the country from the national grid )
another thing is i dont usually use avr's i keep killing em, are the configs correct as i have ruined a few by writing the wrong config data
hope this helps
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
-
- Posts: 68
- Joined: Mon Oct 24, 2011 7:50 pm
- Has thanked: 11 times
- Been thanked: 3 times
- Contact:
Re: How do you connect to Midi?
Tried changing the connections to PD1(TXD), still not working.dazz wrote:Hi
From memory the buffer is there stregnthen the output current so may have a bearing, also are the midi component pins in flowcode connected out =pd1 in =pd0
are the connections as follows (PD1is from the ATtiny2313 data sheet),
ATtiny2313 digital pin 3 PD1(TXD) connected to MIDI jack pin 5
MIDI jack pin 2 connected to ground
MIDI jack pin 4 connected to is there to protect the +5V through 220-ohm resistor ( Please double check i gave the correct pinout as im not responsible for wrong connections ,starting world war3 or diconnecting the country from the national grid )
another thing is i dont usually use avr's i keep killing em, are the configs correct as i have ruined a few by writing the wrong config data
hope this helps
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: How do you connect to Midi?
hi
I noticed that in your chart when you issue a sendmidi on, you send a sendmidi off, does increasing the delay to one second work as it seems that its constantly sending a note then canceling it
hth
I noticed that in your chart when you issue a sendmidi on, you send a sendmidi off, does increasing the delay to one second work as it seems that its constantly sending a note then canceling it
hth
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php
-
- Posts: 68
- Joined: Mon Oct 24, 2011 7:50 pm
- Has thanked: 11 times
- Been thanked: 3 times
- Contact:
Re: How do you connect to Midi?
So I figured out what the problem was. It was the flowcode MIDI component. There is something wrong with it that's causing it to not work properly. So, here is what I did to work around the problem; use three RS232 components, set the baud rate to 31250, and manually send out the three hex values(one per RS232 component). Example: RS232 number one: 0x90, RS232 number two: 0x1E, RS232 number three: 0x45.
Got the midi notes working with just the internal oscillator. Hope this helps anybody with the same problem.
Got the midi notes working with just the internal oscillator. Hope this helps anybody with the same problem.
-
- Posts: 1314
- Joined: Sun Jan 15, 2012 3:15 pm
- Has thanked: 474 times
- Been thanked: 458 times
- Contact:
Re: How do you connect to Midi?
cool glad your up n running, but keep at the midi its probably a chip config setting or something
To sign up to the V5 forum follow this link http://www.matrixmultimedia.com/forum_upgrades.php