Jump to content

Recommended Posts

Posted

Hi!

I would like to connect some serial interaced devices to my midibox project, but then they will need different baudrates: mainly 4800 for the NMEA devices (a GPS for example) and mainly 9600 for the others (more classical baudrate). Does anyone here knows how to handle that?

I would like to do some trials with a PIC based core that I already have made, and my final project will be with and STM32 and I will probably want to have two serial interfaces, one for a GPS and the other for an AIS (it's a navigation system). I think that I will be able to set both to 4800 bps, and as the STM32 core has two midi ins an outs I will probably be able to convert them to serials connexions (MIDIbox-to-COM concept).

Does anyone has advice about this? My main problem now is to set the baudrate at 4800 or 9600bps.

Thanks all.

Baptistou

Posted

cleanup.png

Also, separate individual tags by commas. "RS232 serial baudrate C" -> "RS232,serial,baudrate"

Oh ohhhhhh,

the Tag Gestapo has arrived!  :P

Posted

I would like to connect some serial interaced devices to my midibox project, but then they will need different baudrates: mainly 4800 for the NMEA devices (a GPS for example) and mainly 9600 for the others (more classical baudrate). Does anyone here knows how to handle that?

I would like to do some trials with a PIC based core that I already have made, and my final project will be with and STM32 and I will probably want to have two serial interfaces, one for a GPS and the other for an AIS (it's a navigation system). I think that I will be able to set both to 4800 bps, and as the STM32 core has two midi ins an outs I will probably be able to convert them to serials connexions (MIDIbox-to-COM concept).

Does anyone has advice about this? My main problem now is to set the baudrate at 4800 or 9600bps.

With MIOS8 it won't be possible to realize this without doing modifications in MIOS source code: the MIDI parser in MIOS_MPROC_Handler has to be disabled, incoming bytes have to be polled by your application via MIOS_MIDI_RxBufferUsed and MIOS_MIDI_RxBufferGet.

Disadvantage: by doing this modification, you won't be able to upload the application via MIDI anymore. Or you would have to change the cables (remove RS232, plug in MIDI cables) and use the first level bootloader after PIC reset to upload code.

No fun!

The baudrate has to be adapted in MIOS_MIDI_Init, the formulas (and precalculated values for 4800/9600 baud) can be found in the PIC datasheet.

MIOS32: easy! Especially since code can still be uploaded via USB MIDI w/o swapping cables :)

In your mios32_config.h file, change the UART settings to following values:


// Interface assignment: 0 = disabled, 1 = MIDI, 2 = COM
#define MIOS32_UART0_ASSIGNMENT 2
#define MIOS32_UART1_ASSIGNMENT 2

// Baudrate of UART first interface
#define MIOS32_UART0_BAUDRATE 4800

// Baudrate of UART second interface
#define MIOS32_UART1_BAUDRATE 9600
[/code]

Thereafter you can use the MIOS32_COM functions to send/receive data:

http://www.midibox.org/mios32/manual/group___m_i_o_s32___c_o_m.html

thats all!

Best Regards, Thorsten.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...