Electronics > Projects, Designs, and Technical Stuff
Flashing STM32 with USART over audio
thesame:
Hello everyone. I bought Blue Pill dev board based on STM32F103 in order to do some experiments. Now I realized I have neither ST-LINK nor usb-to-serial converter and it would be very inconvenient to make a ride to the store to buy one. That's why I thought I could flash the board with just my laptop's audio jack. I was inspired by the people who already did similar things: https://davidawehr.com/blog/audioserial/ https://hackaday.io/project/4926-cheepit-sparrow-dev-boards-for-smartphones/details https://sudoroom.org/serial-over-webaudio/
I'm trying to design a schematic diagram of audio-to-usart converter for this project and I was hoping somebody could point me to errors.
I used a multimeter and measured AC voltage of laptop sound output. It gave me about 1.4 Volts and I make an assumption that peak-to-peak voltage would be +-2 Volts. More than enough for switching a transistor.
I also measured microphone input and it gave me 5 Volts of DC bias.
The board is connected (and powered by) to the laptop with USB cable. 3.3 Volts is generated on the board. RX and TX are connected to the STM32 board and MIC and SPK are connected to the laptop audio jack.
The general question is: what am I missing?
thm_w:
You are going to want a USB->Serial or a STlink at some point, pony up the $2 for it and save the hassle.
Another option is if you have a standard RS232 port you could convert that into lower TTL voltage levels:
http://picprojects.org.uk/projects/simpleSIO/ssio.htm
thesame:
That's a good point! But buying the adapter is much more boring option than building one. I think at first it's enough to be able to flash the chip and then connect to it with native usb.
I'd like to start with the audio flashing and if it fails go the adapter path. Do you think the schematic I drawn could burn laptop audio i/o or stm32?
thm_w:
I assume you don't have an oscilloscope to check the output waveform right?
Do you have any arduino boards or anything with a USB/232 converter already built into it?
Not sure if that circuit would work or not.
thesame:
If I had something with usb/serial converter this topic wouldn't exist. Unfortunately I have no oscilloscope either.
In the circuit I assume that the positive half-wave of the audio output saturates the transistor and pushes down the RX line to the ground giving 0. Negative half-wave on the other hand cuts off the transistor producing 1 to the RX. As far as I can tell 2400 or 9600 baud rate more or less fits the audio bandwidth.
TX line is just received by microphone input and processed by software DSP.
Navigation
[0] Message Index
[#] Next page
Go to full version