ARM is complicated ...?

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

    I decided to try to prove that this is far from the truth, and I made a scarf that is easier to make: 1 sided, 1 mandatory capacitor (it’s not necessary to have a stabilizer), 1 resistor, one 3.3V stabilizer, and finally the youngest STM32: STM32F100C4T6B - 16kb flash, 4kb SRAM, 48 legs, Cortex-M3 (!!!) with DMA, debug on the fly, 32 * 32 + 32-> 32 for 1 clock and all other joys for 28 rubles.

    It is programmed / debugged through the Chinese J-LINK for $ 24but I did not unsolder the entire JTAG connector: 5 contacts on the board capture only 2 necessary SWD contacts (serial wire debug), and the JLINK ohm pin for determining the supply voltage (the used contacts from the programming cable are tinted to the right so that such a circuit works so that it needs to be common ground at the computer and the board - the easiest way is to get a powered circuit from USB). Appnaut strongly recommends a separate capacitor for each leg of power - however, I did not see any noise on the power at the farthest legs of the power supply above 50-100mV up to 2ns despite the fact that I use only 1, so you can live, especially considering that it’s sensitive the core is powered by an internal stabilizer (however, it must be borne in mind that the supply roads are somewhat thicker than they usually use). But of course you need to remember that this is more a proof-of-concept,

    It is made of 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, this is not 0.1 mm). It is recognized, sewn and even debugged by key without problems :-) The cost of such a scarf is less than 100 rubles (recall, this ARM costs 28 rubles at retail in terraelectronics).

    Schematic and wiring for Eagle - attached . However, do not swear at the MK symbol for the curve - I painted as I could - as before, I am looking for a complete library of STM32 chips.


    In working condition, it looks like this. The unwashed flux of course immediately catches your eye - it was needed so that the legs would not be short: everything is covered with a liquid flux like LTI-120 and heated - the solder automatically stretches over the legs, and there are no short circuits. LTI-120 does not conduct much current, so there is no practical reason to wash it for a “home” board, but it’s always a pity for alcohol :-)

    Once again, I’ll emphasize that all this is really done at home, with an iron and an ordinary soldering iron (with adjustable temperature, not 200W of course). A 4-layer board is not needed, a soldering station with a hairdryer is not needed.

    For programming, download the demo version of IDE keil (debugger / compiler / editor) - for small microns it works without restrictions (but I can’t give a direct link, look for it). We take the test program ready here, and it remains only to replace the code in main () (and change the settings file through the wizard so that the PA1 leg is the output and works from the 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 we build the project, and in the menu we execute Flash-> Download, we reboot the board - and ... it works. And by the way, without departing from the checkout you can stop the program with a debugger, set breakpoints, see variables - everything is like in the best houses



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

    Also popular now: