baptistou Posted October 12, 2009 Report Posted October 12, 2009 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 Quote
nILS Posted October 12, 2009 Report Posted October 12, 2009 Also, separate individual tags by commas. "RS232 serial baudrate C" -> "RS232,serial,baudrate" Quote
Smithy Posted October 12, 2009 Report Posted October 12, 2009 Also, separate individual tags by commas. "RS232 serial baudrate C" -> "RS232,serial,baudrate"Oh ohhhhhh,the Tag Gestapo has arrived! :P Quote
TK. Posted October 12, 2009 Report Posted October 12, 2009 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.htmlthats all!Best Regards, Thorsten. Quote
baptistou Posted October 12, 2009 Author Report Posted October 12, 2009 Thanks Thorsten for your advice. I just recieved a CORE32 kit from smash TV, I'll try as soon as it's all soldered!Baptistou Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.