-1
\$\begingroup\$

I'm an electrical engineering student and I've just started to learn microcontrollers.I want to know is there any way to connect my board(I uploaded its picture)to computer when I'm using USART without USB to TTL module?enter image description here

\$\endgroup\$

closed as unclear what you're asking by Elliot Alderson, RoyC, Oleg Mazurov, Simon B, Finbarr Aug 21 at 13:50

Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • \$\begingroup\$ I assume when you say you are using USART that you mean you are using the USB connection with a CDC driver (USB-to-Serial)? \$\endgroup\$ – Ron Beyer Aug 15 at 20:01
  • \$\begingroup\$ @RonBeyer I want to send back a data to computer(like a number or text etc.)with usart protocol.I want to know when I'm going to do so,do I have to use a usb to ttl module, or are there other ways?The following link show what i mean when i'm saying usb to ttl module:eshop.eca.ir/2272-large_default/… \$\endgroup\$ – kiarash yoosefi Aug 15 at 20:06
  • \$\begingroup\$ Please provide a link to the datasheet for the board you are using. It has a USB connector...what is it for? \$\endgroup\$ – Elliot Alderson Aug 15 at 20:21
  • \$\begingroup\$ @kiarashyoosefi - "is there any way to connect my board [...] to computer when I'm using USART without USB to TTL module?" (a) What computer do you want to send the data to? Is it a PC or something else? Please explain. (b) What exact interface(s) are available on that computer for you to use for this? (c) Why exactly don't you want to use a USB to TTL module to do this? Is it a problem of cost, or the "computer" doesn't have a USB port, or something else? Remember that we might waste time suggesting something that is also not suitable, unless you tell us the exact constraints. Thanks. \$\endgroup\$ – SamGibson Aug 15 at 20:30
  • \$\begingroup\$ @SamGibson (a)it's a pc,the os is windows 10,(b)USB,vga,hdmi,i guess only usb is appropriate for that,(c)actually it's about the cost,i just want to know if there is any way to do that without purchasing a module it's better than buying one. \$\endgroup\$ – kiarash yoosefi Aug 15 at 20:43
0
\$\begingroup\$

(a)it's a pc,the os is windows 10,(b)USB,vga,hdmi,i guess only usb is appropriate for that,(c)actually it's about the cost,i just want to know if there is any way to do that without purchasing a module it's better than buying one.

From the information in your comment, you have no other sensible choice than using a USB to TTL adapter, as you have no other suitable interface on your PC except USB.

Also, it is going to cost more in components and PCB etc. to make a USB to TTL adapter yourself, than buying one.

\$\endgroup\$
  • \$\begingroup\$ Do you suggest any product model which definitely is appropriate with arm microcontrollers?I mean which model of usb to ttl adapter is compatible with arm micros? \$\endgroup\$ – kiarash yoosefi Aug 15 at 20:55
  • \$\begingroup\$ Well we, as a rule, do not offer product recommendations here on EE.SE. But if you go to your favorite search engine and type in "USB to TTL" literally thousands of offerings should pop up. You'll want to check it's specifications against your ARM to ensure the chosen one will work. \$\endgroup\$ – rdtsc Aug 15 at 21:04
  • \$\begingroup\$ @kiarashyoosefi - "Do you suggest any product model which definitely is appropriate with arm microcontrollers?" Shopping questions are off-topic here (see help center). That's because e.g. we don't know which exact models are available in your area / country etc. and even if we did, that information would change with time. There is no specific compatibility issue with that STM32F1 MCU board and typical USB to TTL adapters. That board runs the MCU at 3.3V so its outputs are a valid TTL high, and it has 5V-tolerant inputs. Ensure Windows 10 drivers are available for the adapter you choose. \$\endgroup\$ – SamGibson Aug 15 at 21:06
0
\$\begingroup\$

While it would require substantially more complex firmware on the MCU and is likely unwise for you right now for that reason, the STM32F103 has a native USB device port which your board appears to show brought to a mini-USB port.

By connecting that directly to your computer you can implement a serial-like connection over USB without a converter, either CDC/ACM or some other protocol, though getting this initially recognized on Windows may be painful. And it's practically useful to have a simple serial setup to see debug output while working on the USB code.

Before you pursue that route consider that you will also need to program your board. Unlike some later STM32's the STM32F103's ROM bootloader does not speak USB. So you would either need to use something like an external converter to speak to the bootloader via serial, or to use an SWD adapter for programming. The latter is by far the best solution. It is also possible to tunnel debug output through SWD in various ways, though non trivial to set up with the lower cost implementations.

If you needed to produce a lot of systems, there are 3rd party bootloaders that do speak USB you could flash using SWD or serial, and continue from there with USB alone - ports of Arduino to this platform often do that. But first you have the chicken and egg problem of getting working code that can speak USB on there. For that, realistically you should buy not only a USB to 3v3 serial adapter, but also an SWD adapter.

\$\endgroup\$

Not the answer you're looking for? Browse other questions tagged or ask your own question.