📜 ⬆️ ⬇️

ARM - is it difficult ...?

After my recent article on Habré about tearing everything at the price of arm , many opinions were expressed that ARM needs a 4-6-layer board, well, at least 2, at least, and a bunch of strapping.

I decided to try to prove that this is far from the truth, and made a scarf whose simpler position is difficult: 1 third-party, 1 mandatory capacitor (there is no need for a stabilizer), 1 resistor, one 3.3V stabilizer, and finally a younger STM32: STM32F100C4T6B - 16kb flash, 4kb SRAM, 48 legs, Cortex-M3 (!!!) with DMA, debag on the fly, 32 * 32 + 32-> 32 for 1 clock and all other joys for 28 rubles.

This is programmed / debugged via Chinese J-LINK for $ 24 , but I didn’t decouple the entire JTAG connector: 5 pins on the board capture only 2 required SWD (serial wire debug) pins, and the JLINK power supply contact (used contacts from The programming cable is tinted on the right, so that such a scheme needs to have a common ground between the computer and the board - the easiest way is to get the power from USB. Appnout strongly recommends a separate capacitor for each leg of power supply - however, I didn’t see the power noise at the farthest power legs above 50-100 mV up to 2 ns range despite using only 1, so you can live, especially considering that sensitive the core is powered by an internal stabilizer (however, you need to take into account that the supply roads are somewhat thicker than they are usually used). But of course you need to remember that this is more of a proof-of-concept, for “combat” applications, you will have to do as expected with 5 capacitors.
')
It is made by loot - the roads are 0.25-0.3 mm, which is not fatal, although it requires a little skill (at the end of the ends, it is not 0.1 mm). It is recognized, sewn and even cale without problems :-) The cost price of such a handkerchief is less than 100 rubles (let me remind you, this ARM costs 28 rubles at retail in terraelectronics).

Scheme and layout for Eagle - attached . However, do not swear at the curve of the MK symbol - drew as best I could - still looking for the full library of STM32 chips.


In working condition it looks like this. Unwashed flux, of course, immediately catches the eye - it was necessary so that the legs would not be shortened: everything becomes covered with liquid flux like LTI-120 and heats up - the solder is automatically stretched over the legs, and there are no short circuits. LTI-120 does not conduct much of a current, so there is no practical sense to wash for the “home” board, but it is always a pity for alcohol :-)

I emphasize once again - all this is quite realistically done at home, with an iron and a regular soldering iron (with controlled temperature, and not 200W, of course). 4-layer board is not needed, no soldering station with a hairdryer is needed.

For programming, download the demo version of IDE keil (debugger / compiler / editor) - for small mic works without restrictions (but I can’t give a direct link, look). We take the test program ready here , and it remains only to replace the code in main () (and change the file with the settings via the wizard so that the PA1 foot is the output and works as an internal generator - see the Configuration WIzard tab below when editing the settings file):
int main (void) { unsigned int hash = 0; int i = 0; stm32_Init (); // STM32 setup while (1) { for(i=0;i<50000;i++) hash=(hash*hash+1234567)/hash+hash+87654321; GPIOA->ODR = (GPIOA->ODR & (~2)) | ((hash&256)?2:0); } // end while } // end main 

Configure JLink: We install drivers for it, then in Keil: Flash-> Configure Flash Tools. On the Utilities tab, select JLINK, and click Settings. On the Flash Download tab, add the Programming algorithm "STM32F10x Low-Density Flash".

Now build the project, and in the menu we execute Flash-> Download, we reload the board - and ... it works. And by the way, without departing from the cash register, you can stop the program with a debager, set breakpoints, look at variables - everything is like in the best houses.



Are you still buying 8-bit AVR-rki for 200 rubles each? Then ARM goes to you!

Source: https://habr.com/ru/post/125994/


All Articles