In the project tree, create a Modbus Slave group and add the following files from the Freemodbus library there:Īnd do not forget in the options of the project to indicate to the compiler the following paths to the library directories. Choose our microcontroller and library components that we need: Then Keil will do everything herself.Īnd so create a new project. This is done by a simple double click on the file. To create projects in Keil on the microcontroller from Milandr, you first need to install the software pack. In order not to reinvent the wheel, let's take the Freemodbus cross-platform free library and port it for our microcontroller. The first task set to itself was to connect the controller to the SCADA system using the Modbus protocol. Later we will use it for programming and debugging. When connected to an alternative JTAG interface, everything worked like a clock. I didn’t want to understand this, since there is also JTAG-B. Apparently, after flashing the line of the JTAG-A port is redefined to another functional purpose, although in the program the port B on which the JTAG-A is located was not even initialized. This ended the joy, since after the firmware the microcontroller worked, although it seemed to stop the debugger. After searching the Internet for the request: “JTAG - SWD adapter”, it was found that the SWDIO line is connected to JTAG-TMS, and SWCLK to JTAG-TCK and “Wonder!” Everything worked, the test program was flashed into the microcontroller. Keil supports it “out of the box”, but the microcontroller, although the documentation says that it supports the SWD interface, but forgot how to connect what to mention. I didn't want to program UART, so I decided to use the ST-Link v2 in-circuit programmer / debugger, or rather its clone from an unknown Chinese manufacturer. We will use the development environment from Keil - MDK ARM uVision 5.0 the standard Peripherals Library + software pack is distributed by the microcontroller manufacturer to it. Etching occurred in a solution of peroxide and citric acid by eye and took about an hour, surprisingly the quality of the conductors was acceptable the first time, which pleased us.Īnd so the board is created, all components are unsoldered, it remains to be programmed. For a couple of hours, a PCB drawing was made in Sprint Layout, printed on Lamond high density paper and transferred to fiberglass laminate. The microcontroller is a microcircuit made in a LQFP64 plastic case with 0.3mm wide pins and with a spacing of 0.2mm between them, which made it impossible to create a printed circuit board of acceptable quality using LUT technology, but experience has confirmed the opposite. All possible options are presented in the table: The choice of the program loading method is determined by the logic levels at the outputs of PF4, PF5, PF6. The microcontroller allows you to select the program download method via one of two serial interfaces UART or JTAG / SWD, while JTAG allows you to debug the program in the microcontroller. Also set the smd switch to select the integrated bootloader mode. I think for the initial experiments with the microcontroller is enough. I stopped at a minimum of components: a stabilizer at 3.3V for power supply from the USB port, a quartz resonator at 8 MHz, a miniUSB connector, a reset button, pull-up resistors and sip connectors. To begin with, it was necessary to develop a schematic diagram of the debug board and decide on the components. In general, protection from static electricity at altitude.Ī label and a product selection protocol go to the microcontroller, which is very pleasant. The microcircuit lies in a cassette made of thick aluminum foil, which is wrapped with foil paper, laid with foam rubber, and the whole “sandwich” in a cardboard box with inner walls covered with foil. The microcontroller comes in a package that the Chinese will envy with AliExpress. I got into the hands of a Russian microcontroller K1986BE92QI produced by PKK Milandr JSC with 32-bit RISC core ARM Cortex-M3 128kB Flash and 32kB RAM, I immediately wanted to study and test it in action.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |