Go Down

Topic: Midi input with no rx pin (Read 286 times) previous topic - next topic

ARIS009

Hi
 
I am doing a project that requires midi input which I have seen uses the rx pin on the arduino.My problem is that I have an 8 bit DAC(digital to analog converter) hooked up to the PORTD(the only one with 8 pins on the uno) so I cant use the rx pin.

Does any body know how can I use midi in with another pin or another arduino board with differnt port registers that will allow an 8 bit DAC without using the rx pin?

Thanks a lot for your time.

Grumpy_Mike

1) Use software serial for your MIDI output
or
2) Use an Arduino Micro pro - this can connect to MIDI over USB and so does not need Pin 1
or
3) Use a Mega, that has other free ports with all pins available.

ARIS009

#2
Dec 08, 2018, 12:55 pm Last Edit: Dec 08, 2018, 01:03 pm by ARIS009
Thanks for answering so fast, but could you please explain your ideas a bit more especially the first two because I have no idea how to apply them.

Also I want to make clear that I want to use midi input with my arduino.

Again thanks a lot for your time.

slipstick

Normally MIDI In/Out use hardware Serial commands which need pins 0 and 1. You can instead change the code to use SoftwareSerial which can be set up on any digital pins of your choice.

If you post the code and circuit that you are using you can probably get detailed instructions about what changes are needed but there's no point us trying to guess what you currently have.

Steve


Grumpy_Mike

Option 2 says use a different sort of Arduino. The one I suggested can use the USBMIDI libiary that can connect direct to your PC or lap top and be recognised as a HID MIDI device. This leaves pins 0 & 1 free to use in your parallel interface.

MarkT

Hi
 
I am doing a project that requires midi input which I have seen uses the rx pin on the arduino.My problem is that I have an 8 bit DAC(digital to analog converter) hooked up to the PORTD(the only one with 8 pins on the uno) so I cant use the rx pin.
You can split the 8 bit parallel output of the DAC between two ports, read both ports and combine the
values using shifts and ORs.  Sure its convenient to have all 8 bits on a single port, but its not a hard
requirement unless timing is really tight.

Thus instead of reading the 8 bits like this:
Code: [Select]

byte readDAC()
{
  return PIND ;
}

you might do something like:
Code: [Select]

byte readDAC()
{
  return (PIND & 0xF0) | (PINB & 0x0F) ;
}

Thus using Arduino pins 8,9,10,11,4,5,6,7 for bits 0 to 7 of the DAC's parallel output.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

ARIS009

#6
Dec 12, 2018, 04:21 pm Last Edit: Dec 12, 2018, 04:25 pm by ARIS009
Thanks a lot for the great advice guys.

I am going to use Arduino leonardo pro micro that supports usb midi.Could anyone tell me the port registers for it and save me some trouble please? Cause I do not understand a word from the datasheet.

Thanks.


Grumpy_Mike

It is all on the schematic.

ARIS009

Sorry for being a noob but could you just tell me were to hook up my 8 bit DAC and the command I need to use on my code? As I told you I do not understand the shcematics

Thanks

MarkT

The loeonardo doesn't bring out an entire 8 bit port out on the Arduino pins.
[ I will NOT respond to personal messages, I WILL delete them, use the forum please ]

Grumpy_Mike

#10
Dec 14, 2018, 09:49 pm Last Edit: Dec 14, 2018, 09:54 pm by Grumpy_Mike
Quote
As I told you I do not understand the shcematics
No you didn't you said:-
Quote
Cause I do not understand a word from the datasheet.
A data sheet is not a schematic.

You have also not said what you want to do with this D/A. Do you know what you are trying to do? Would you mind sharing it with us?

ARIS009

I want be able to receive midi messages and translate them into a voltage so I can control an analog synthesizer with midi.Also sorry for inaccuracys on my posts but it the first serious project I do with arduino.
Anyway could you please answer my question?
could you just tell me were to hook up my 8 bit DAC and the command I need to use on my code?

Thank a lot for the time you hane invested in my problem.

slipstick

If you mean MIDI to 1V/ octave CV you'd be amazed how many people have already done such projects with Arduinos. If you were to Google "Arduino MIDI to CV" you'd find all sorts of useful information.

BTW an 8 bit DAC isn't nearly good enough if you expect to get musical notes out of the synth. You might get away with 12 bits but really 16 bits is more like it.

Steve

Grumpy_Mike

Yes agreed, and you would be much better off using an SPI interfaced D/A rather than trying to interface a parallel one.
Note that CV is not implemented in a very standard way, but one volt per octave is perhaps the most popular, so you normally need greater than 5V for this. For the different standards see https://en.m.wikipedia.org/wiki/CV/gate

ARIS009

Guys, please I am not asking for another solution on my project.I simply want to know how can I wirw an 8 bit DAC on an arduino leonardo pro micro.

Does anyone know this???

Go Up