Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

programming microcontroller using uart

Status
Not open for further replies.

yassin.kraouch

Advanced Member level 2
Joined
Jul 5, 2009
Messages
631
Helped
40
Reputation
80
Reaction score
40
Trophy points
1,308
Activity points
5,094
hi i want to program STM32F103CBT6 using uart, but the problem is that i want also to use this uart after for communication, can i connect directly the programming header in UART with the serial communication or i have to use a multiplexer ?
 

i suppose you are using the serial bootloader, which comes with this micro,
and you want it BOTH connected to the programming PC AND to another device... at the same time, huh?

if that is the case, you would need some kind of multiplexer... maybe even some DPDTswitch at least....
maybe (and just maybe because you should check arefully) the only pin you can share safetly is the GND...

if you describe more your system and you objetive, maybe someone can give more lights..
 

Yes you are right, i want to use this uart for programming device, and i am using the serial bootloader, so the uart is to be used for programming and for communication with other device, i have another idea is to use a schottky diode on the RX_line ( the cathode in the side of the PC ) with a pull up resistor, so the Rx_line will take the "0" from the PC ( throught diode schottky) and will take the "1 " from the pull up resistor, and the same thing for the communication with the other device, what do you think ? have you a schematic example that would help ?
 

Yes you are right, i want to use this uart for programming device, and i am using the serial bootloader, so the uart is to be used for programming and for communication with other device, i have another idea is to use a schottky diode on the RX_line ( the cathode in the side of the PC ) with a pull up resistor, so the Rx_line will take the "0" from the PC ( throught diode schottky) and will take the "1 " from the pull up resistor, and the same thing for the communication with the other device, what do you think ? have you a schematic example that would help ?

Hi,

How would the bootloader program know when its time to reload the program code from the PC ?

Might be simpler to select a chip with two hardware uarts or create a software uart for your other comms device routine so you can dedicate the hardware uart to the bootloader.
 

The STM32F103Cx series actually has three USARTs, therefore at the very least you have two additional USARTs to utilize in your app.

BigDog
 

The STM32F103Cx series actually has three USARTs, therefore at the very least you have two additional USARTs to utilize in your app.

BigDog

right, but i think @yassin.kraouch has some kind o development board with only one DB-9 connector... am i right? it that's true, and you are using it only beacuase the max3232 i don't like the diode solution, don't forget that rs232 is bipolar and a logic 0 (space) is actually positive voltage (+12V) and logic 1 (mark) is negative voltage(-12V)

BTW, did you considered setting another MAX3232 for the other usarts?
 

right, but i think @yassin.kraouch has some kind o development board with only one DB-9 connector... am i right? it that's true, and you are using it only beacuase the max3232....

BTW, did you considered setting another MAX3232 for the other usarts?


Chances are yassin.kraouch will need neither the DB9 nor an RS-232 transceiver like the max3232, if by other "device" he is referring to a module like a GPRS/GSM or GPS with compatible logic levels.

My point being there are several options available, before multiplexing the RS-232 lines become necessary.


Another option maybe, using the existing connection to the PC for communications after execution has be handed off to the user application from the bootloader.


BigDog
 

the connection to the device use the same voltage level, so i don't need a voltage level translator, i have no other usart to be used, i used all the usart, so i have only this usart to be used in parallel with other communication, so just as i said i will use only schottky diode to communicate with the two device ( pc and the uart device )
 

how did you used the other 2 USART of this micro?

do you plan tu use the PC communication while communicating to your device? can't you disconnect your extra device while programming via PC?

anyway good luck with your diode...
 

yes the device will be connected when programming the device, in order to have not confusion with the PC
 

the connection to the device use the same voltage level, so i don't need a voltage level translator, i have no other usart to be used, i used all the usart, so i have only this usart to be used in parallel with other communication, so just as i said i will use only schottky diode to communicate with the two device ( pc and the uart device )

What devices do you have attached to the other two USARTs?

What device are you planning on sharing the USART with the PC (bootloader)?

Although as a rule, I avoid sharing a USART between multiple devices, the few times I had to resort to such measures I've successfully used an Analog Mux/Demux like the 74HC4052.or Maxim devices.



BigDog
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top