A new series of lessons. Study the STM32. Lesson 0
So taught we taught стм8, but we cannot stop, and who read the blog probably already saw that was very long ago already acquired STM32F4Discovery Board with STM32F407VG processor on Board. Actually with this card I will start to log the small steps into the world of STM32.
Yes, many may exclaim, — WHY? after all, there are long along and across the studied Megami with Atmel, Arduino and other almalatina and PIC etc.))). Someone even noted that ЅТМ32это stuff and need to go for expensive brother processors from Freescale, and the like. But then nobody calls something to jump on something to change. I like the products of STM all of its sides, and the fact that she captivated the world — this is its merit, as his Windows took over the world of computers. I'm here to teach STM32 , and who does not like it, go complain to your yard)))
Why СТМ32 not ATmega 2560 or AtXmega. To begin with, to start with, I advise you to see the prices. Here is a small example for comparison
СТМ32F030F4P6 -the kid in the lineup. Case TSSOP20, (48 MHz 16 KB Flash, 4 KB SRAM, 4 timers 16 bit, 11 channels 12-bit ADC 1 SPI, I2C and USART). Yes, of course, hard at first in this case to put on the Board, and the distance between tracks of 0.25 mm may be too hard to make, but this is just the cost.
Its price — 21грн
Now let's try to find an alternative at least for simple type parameters memory
Attiny2313 — 36 UAH (1KB flash)
Atmega8 — 27 UAH (8KB flash)
Атмега16 — 52грн (16K flash)
STM8S003K3T6 — 21грн (8KB flash)
ATX Megi did not write as their price can not be folded
And now the whole thing Turkey-baste 32 bit math in a single cycle and get something that will not stop technical progress.
Who does not want to learn, one could in principle do all the logic to collect, it will work, but what if we all developed already.
So, what we all need to work with the STM32.
First — bought or processor, or as in my version — debug STM32 Discovery Board. I took one of the older boards in the line, so to say to have a "top" gun)) It then still useful.
Programmer
Who took — Discovery — to programmer. As in this case, the Board itself in addition to the debug and even performs the function of the programmer. You only need a USB->microUSB cable to work with a debug Board.
For those who have no Discovery — for ridiculous money purchased here is a programmer ST-LINK V2 mini
Also, for starters you can do a simple bootloader on the basis of UART Converter (FT232RL and the like), and fill the firmware via the UART, through ST-LINK Utility
Development environment
There is a choice of several options
IAR is a long — known but not paid (the free restriction code)
CooCox + GNU compiler — free option (one of the best)
Keil uVision 4\5 — paid, but possible options))
STM also made not quite long ago great decision STM32CubeMx program to set up all peripherals in any controller and receiving the finished project. the only thing simple this program cannot export the project in CooCox, but this is easily solved with a small dancing with a tambourine. BUT — SOLVED.
STM32CubeMX
This decision has become available since the release of the HAL library, which allows us for any STM32 processor with minimum changes to write the initialization of all of our peripherals, configure clocking, etc.
In the lessons I start with Keil and CooCox if you still like it — I will do your homework for the two environments.
At this point I think the entry can be finished (and what can I add on stuff). In the next lesson, Уроке1, we will study our program STM32CubeMX and create the first project of Hello World — blinking LEDs.
Thank you for your attention. Click the thumbs up!
So, coke has got the accelerometer
The good people are already mudholes and realized that schmultzy put 2 LIS302DL (pryamougolnogo IN the square case.) In General it is necessary to understand, but I will say one thing only feeeee... dancing with a tambourine to reconcile with HAL, all the rest is of course kind of like more beautiful than keil. I might twist one and another and try to understand whether to bother on a particular compiler...
trying at the moment to have an accelerometer on Board kokosowski examples from the repository. The balalaika...
The values do not change for the life of me.
Pieces for the machine. And recently became convinced that there are alternatives to industrial solutions.
It is the processor . It works according to the written program . And where you put it and that will make to do it is a private matter ))) One of the simplest examples www.drive2.ru/b/2142289/ it is Possible for a car to deliver, it is possible to switch on the TV or lights in the toilet ))
Yes it is clear that the crafts, the question is, is the chip tuning of the engine? or a bigger subwoofer doing?
This article is for wrapped ))) Get a bag of happiness when something is done and it works . This is for example how to make a model of a high-rise building out of sticks, duct tape and something else . And when the customer wrote boiling water with delight, probably experiencing the same feelings ))))
like all words written in Russian letters... but like on a Chinese website visited with the characters. do not understand anything, but liked the style enjoyable.
Waiting for the lessons, my boss at work makes learning programming a stm, but I have the 300 series. But basically all seems. About six months ago it got to the transmission via uart, now a bit forgotten, just read the lessons! Thanks!)\
Don't like keil, I use eclipse+iar. Coconut is basically the same Eclipse.
What I don't like in STM-vskih stones, so it is documentation, at the same TI much easier.
As it was the case, with the same debug Board dabbled with EEPROMs tidy Passat)
Working on lesson number 1. Today I will lay out how to create a project in the cube, and move it to the coconut and blinked diode.
Well, you see, and you were afraid . Now you only have to make the right decision in the direction of the coconut )))
well, again it depends. I in STM to dig in the scrap, but mater"Alec rules finger the top sticking out )))
2313 were made on a 5-transactions, but looking to build that, as for me every sculpts that are familiar
raspberry is as expensive as for this decision... стм32 head — so, 9 channels enough? processor stmf030f4p6 — savepic.org/7582180.jpg
here you can see people in the thread, but I just have a noob question.
in your opinion what protovol database better, faster and easier :)) I know it's difficult combined
to do multichannel ADC, say, 5-10 channels with a normal resolution and log
STM, raspberry or maybe something else ?
binka dull and slow
When moving to 16 and 32 bit Datasheet've realized that's not it, they are more sharpened by the media, but STM just under the car theme is very good, and a lot of brains now doing on the basis of STM. But in General, the core of them all one.
rusefi.com/wiki/index.php?title=Main_Page
rusefi.com/forum/viewforu...9e073540ccfe76d6d94090d8f
And can a reference on a thread of a similar project with the ECU? Interested) I was thinking Raspberry Pi's to master, the price is not very different from STM, and features a lot more. For comparison, Raspberry Pi — $ 2500 STM32 Discovery — 1500 R. average on Ebay. Correct me if I'm wrong.
Well, let's just say the network has a free project engine ECU (evolving) it was under this charge. So probably him and swung. But that's for the distant future. This monster can be used to build everything from home servers to monachovo brain to auto\aircraft\helicopter etc)))
I have a question — what do you build on it together?) Also like think about buying and learning this beast, but the hands are not reached. The speed of it are good, and the price I was not happy. I can't see anything what could not have done mega)
I also recently started working with semkami. Good controllers. I will follow with interest.
To collect for the machine projects on the STM32 controller. It is time to move on to serious projects not every morgalla\the tweeters
and what purpose? just study? or something to collect, for example, for the machine?
I know — very convenient feature! But thank you for reminding me, it is necessary to add to article
By the way, don't know or may not know, if the cube she had some leg to the periphery (e.g. USART1), you can hold down Ctrl and tyknut on this leg, and the cube will show at what pace you can reassign this leg USART1
CEMA73
Absolutely, choosing a microcontroller for a specific task, you need to imagine that it will be required at the moment and how you can develop the project on the current hardware. Again, if we make the simplest project, such as the extension turns, all we need is to monitor the status of the legs of the controller and, depending on a couple of conditions to change at a specified time as the other leg. Suppose we chose to тини13. And it will be enough even if you develop the project to the time delay state of one or the other leg. More in the extension of turns to do. With this task more than to cope with тини13. Besides, even the smallest, 32 nogi стм8 (in LQFP housing, TSSOP20 not consider :) ) we will create more inconveniences than 8-Nogaja тини13.
Another example: do the devil-box, which will over CAN-bus to communicate with the ECU and something to show, display, count, and so on... In this case will be much easier to use STM8AF6269 due to the built-in driver CAN and LIN bus (only need to agree on levels). While tiny and mega just so these tires will hook up hard.
For simple projects moved to the STM8 as they are at least 2 times cheaper with more capability. to write a project flashers under it — elementary.
severely), the doctor told in a mortuary means in a mortuary! The pasta just has no choice ))
that any small spoon, such as for mustard etc .Sometimes the reverse side (flat) tweezer)))
most dreary is the application of paste to the Board on the pads. Need a stencil of the mind to do, and then do one of the buzz Board to do. Well I have the old paint with a syringe with a cut needle.
Unpleasantly surprised — the failure rate of products from the first batch ;-) due to cold soldering, bad tires, or something :-)
Thank you! somehow did not think to try. All the time only used it for the inverse problem
it is a matter of habit already. I use solder paste. Put circuits, heated — ready, next fee and it.d.
manually soldering more difficult, especially if you need 10-20 pieces for the evening to collect
ALL4SWAP
Yes, in this project 8-nogi stone great benefit. By the way, why not consider SO20? In some cases it is better to have bigger legs and all settings are set via eeprom a stupid jumper, then selected clear just when looking at the cost, and even the dumbest user can easily change without quests in the style of dandy joystick (up-up-down-start-game 2 — COMBO!)
TSSOP-20 taxis))
And here is let the developers decide how and what it is better to do :) Someone prefer one, someone else... As they say, many people have many opinions :)
Someone makes the tuning buttons(oops). For example, the signaling STARLINE whole setup is button with j, and the indication of the selected menu items and values for those items displayed on regular diode signaling. The setting is on the table, and as these things often are configured once and for a long time, then this option is acceptable. And settings are stored in any case in EEPROM, either external or internal, either in one sector of flash [for example have no built-in STM32 eeprom].
Yes, in this project 8-nogi stone great benefit. By the way, why not consider SO20? In some cases it is better to have bigger legs and all settings are set via eeprom a stupid jumper, then selected clear just when looking at the cost, and even the dumbest user can easily change without quests in the style of dandy joystick (up-up-down-start-game 2 — COMBO!)
Absolutely, choosing a microcontroller for a specific task, you need to imagine that it will be required at the moment and how you can develop the project on the current hardware. Again, if we make the simplest project, such as the extension turns, all we need is to monitor the status of the legs of the controller and, depending on a couple of conditions to change at a specified time as the other leg. Suppose we chose to тини13. And it will be enough even if you develop the project to the time delay state of one or the other leg. More in the extension of turns to do. With this task more than to cope with тини13. Besides, even the smallest, 32 nogi стм8 (in LQFP housing, TSSOP20 not consider :) ) we will create more inconveniences than 8-Nogaja тини13.
Another example: do the devil-box, which will over CAN-bus to communicate with the ECU and something to show, display, count, and so on... In this case will be much easier to use STM8AF6269 due to the built-in driver CAN and LIN bus (only need to agree on levels). While tiny and mega just so these tires will hook up hard.
Why not стм8 then? After all, a simple project can suddenly escalate into a slightly less simple, and the price is comparable.
I agree :) But in this case I mean that STM for the simplest of projects is not the best choice, and that we must choose from something simpler :)
for the simplest project better microchip
it can withstand more abuse before you die
Success in learning :-) I want to meet all rechasim: "ameeeeeeeen" and the like. STM, it's cool and for the money has many hardware peripherals, the stuff is powerful and voluminous (in terms of memory). And all she seemed good, But sometimes you really need to make a SIMPLE project where you really only need a diode to blink (and other stuff type of relux smooth ignition, extensions, turns, etc.) and then at an opportune choice has Datasheet (тини13, 2313, mega and someone like that), and everything is more complicated and more serious easier and faster to do on the STM. I govoryu as people working in this area :-)
stm cool stuff, especially F4. The IDE I recommend eclipse + GCC or coconut (it is on the basis of Eclipse made) in Keila poor text editor
5 years ago moved from avroc on стм32 and peaks 24 and 32, there are a variety of designs on these percent: USPD my nook color modemy, Ethernet transmitters, 433 MHz radiomodem, computers, metering devices commercial. Aurki this last century. A couple of years ago, talked with Yuri Panchula, one of the developers of cores to peak 32 and he said what we have in Ukraine and Belarus are taught in the institutes initially Arki and transplant then someone is very difficult, my programmers move without problems and is now very happy!
She will succeed! Important in STM to carefully read the documentation. After all, the whole power of the periphery, except that sometimes, in order to configure as you want, have pretty to smoke manuals.
Himself sitting on STM. Very best thing! Atmeg difficult to climb, but then all happiness :)
Comment has been deleted
for each application their tools. Performance of f4 and f7 is sufficient for most applications except video perhaps. But if you consider the price then your good option. About the editor, the choice of someone that is convenient, after Eclipse in Keila in the past century feel
Comment has been deleted
Well, maybe easy for you, it's fine, my programmer is also easy to move. When dealing with developers from all over the Union very difficult for many to move from AVR to pic or STM 32 24 and 32.
Comment has been deleted
reliability is paramount and the price ol the series is less than that of cheap workstations
Comment has been deleted
I'm more for the controller software doing it, so Eclipse already familiar.
Comment has been deleted
As shown by years of practice developments the reliability of the peaks apart from the competition, and cheap Armagh Klipat all and Sundry, where they are convenient somewhere not, for each percent your device and project. Prices mnogoseriyki including special different even from those you see on the manufacturer's website in the last row! And the topic here is not about the peaks, about a lesson on STM 32 so I'll bow out.
that's for sure! while current master of piano))) although I understand that notes where it would be easier
there is a cap! here is the current me with my stuff to sort out)))) and then there are 4 tidy, 2 living rooms and 2 full Pajero... when I mate this part to read if I don't have time to sleep))))
Catch up until later forum-corolla.com/forum80/thread1538.html Sit with us on the train, and then fall behind )))
After all of prochange and comments, I realized that I was even a soldering iron can't keep )))
Not a fact, not a fact.Manual for dummies from beginning to your basics so to speak, and how what is programmed and what it's used for.
Oh damn my friend, I do not understand what is written here and why this is needed=)I Guess creepy vumnye.
switched to STM32 with the Atmega is much easier, cheaper and faster. Very happy
I mean — if the training for a person to be humo sapiens is not in vain called himself
But maybe we're getting old, so the selection criteria for me was to study architecture over time, not gone (that knowledge in the trash not to throw). For this reason, I chose ARM and STM32 in particular, and not by comparing the frequency memory. At the time, tired of MK in principle, therefore, left to examine the FPGA — they are also universal and knowledge of them is not lost in time and during the transition, for example from Altera to Xilinx.
But the environment STM32CubeMx on the contrary — very much. In the first place so that you can all iron, all these fuzy that was to Atmel to configure visually and quickly. Plus, making sure that everything is correct (there is a lighting error). What setting clock frequency is! Separately want to say about FREE RTOS — parallel processes there are easier to create than on a PC.
In General, for what I don't love MK: need to read heaps of documentation (datasheets), the need for a lot of information to keep in mind, the sequence of work and impact of other software adding new blocks to the old. What type of made a light bulb, second, third, fourth and added all died. In short, all these problems are solved by the developers of the STM and can now focus on solving the problem, instead of struggling with the piece of iron.
We will continue to wait!
Comment has been deleted
try version control to use, as a significant commit... and immediately see step by step what he was doing.
ALL4SWAP
Miracles do not happen
No wonder STM automotive series is quite different money
Microchip has a deserved reputation of indestructible stone. What is this STM going to find out empirically
and car series — as I remember you have a Datasheet — it's just the inputs and outputs are additionally protected by external buffers from short-circuit to earth and Pitalovo and stands for nothing do you remember which manufacturer (some series of milandre toli toli niiet) power Manager — in short anything — goes Z condition on the inputs-outputs, but otherwise was a licensed clone of microchip felts felts Datasheet. but mikruhi for the gold price in the literal sense of the word.
it was all ancient chips. especially the wide application of type avrov and microchip. now it is not profitable — let them harness more of the position of producers.
stm32 max 3.3 volt
And done they're probably more "subtle" manufacturing process than pic12/16/18
Two facts from the life of the microchip: withstands foot if the output short-circuit to ground, and short-term if you apply 12V on the input or output leg. I highly doubt that STM have similar properties.
But of course if you add protection and STM will normally live in the car.
basically take any old melkosopochnika, the same of K155, before they necrocom can also the odds to give.you have normally protected inputs-outputs, similar to do it from the STM and everything will be beam.
STM-Ki 1.8-5вольтовые, i.e. in principle should be OK. if not as a conventional processor to speed through currents (why are those almost all the time working in transition mode and guzzle energy into heat as the heaters), you're fine.
Miracles do not happen
No wonder STM automotive series is quite different money
Microchip has a deserved reputation of indestructible stone. What is this STM going to find out empirically
this is long before C-C-szenczi happened. just microchip and al-stranded really just snickering at the domestic markets, which drew attention to this market and other players.
the fact that no other except the STM is until their marketing departments and strategic planning to sleep. by and large the core of cortexa simple, the cost is just no, and if STM in this segment will reach any significant volume, then begin a battle of the titans version N. M and will be dumping, then again all fall off, will stay 2-3 manufacturer in this market. prices grow. this was also seen on the PC market for 20 years. how many CPU and GPU manufacturers left, of sonicmega at least 2/3 of the market for 2! and to the point.
Good stone
I do not know the sanctions or that, but from suppliers wonderful miracles are happening, 32-bit 48мгц STM is in 2 and more times is cheaper than an 8-bit microchip and have the same miserable Datasheet