Posts

Showing posts from 2018

ARM sinus lookup tables 5x faster than math.h - TM4C123GXL Cortex M4F

Image
Lately, I was working with IIR filter so in CMSIS repo I saw look-up table with sinus value. I was wondering how much faster it works then math.h sinus function. The name of the function which uses a lookup table is arm_sin_f32() which is part of  arm_math.h Lets first compare results calculated with the lookup table and math.h sin function. Result2 are from the lookup table (arm_sin_f32() -> arm_math.h) and result1 are from sinus function (sin() -> math.h). From results is seen that after decimal point 4-5 digits are similar so take care with that.  I have done an iteration of 100 000 calculation and I was measuring the time needed for math.h sin and got 9726 [ms], and for arm_math.h 2006 [ms] which is almost 5x time faster.  In the photo below I added sinus wave for both calculations. Blue is result1 and red is result2. You can see they overlap.  You can check the code on the link . 

Patch PCB antenna 7 dBi WiFi

Image
Recently I was looking for a small lightweight, at least 6 dBi gain antenna. At mouser web page I have found 25x25x4 mm patch ABRACON APAKN2504-S2448-T antenna for PCB with 7 dBi gain. I was surprised by this very nice antenna design. So I order two of them. When they arrived I was not sure how to connect to WiFi device so I started googling. There was no any special explanation how to connect it on the 50 Ohm cable, only how to connect it with 50 Ohm impedance PCB link. So I decide to connect it this way with 50 Ohms pigtails. After I connected it, I have tested it with a WiFi router, and they work very well. Figure 1 - Soldered antennas Figure 2 - Front side of antennas Figure 3 - Testing antenna with WiFi router  I will use the antenna with the u.fl connector together with CC3220SF-LAUNCHXL :)

Eclipse + Black Magic Probe + Embsysregview

Image
Is there a chance to use the Black Magic Probe with Eclipse and see the peripheral registers. Short answer: Yes it is. For peripheral registers, you will need the Embsysregview Eclipse plugin. If you have a problem to install it check my last blog post .  How setup BMP? Go to: Run -> Debug configurations -> GDB Hardware Debugging and select New Launch configuration on the top left corner. Select everything as it is on images (my example is for miniblink, you do it for your). Image 1 - Main

Embsysregview - Eclipse plugin and how to install it

Image
In the last couple of days, I was trying to install Embsysregview for my Pixracer (STM32F427VI) to do debugging with Black Magic Probe, but it wasn't possible to install it because there is a problem inside download links when you trying to do it over Eclipse marketplace. Image 1 - Error when you try to install Embsysregview from Eclipse market

Cortex-debug powerful extension for VSCode

Image
In the process of working on a new example (timer), I had some difficulty to make it work. I've found out it that my current setup for Black Magic Probe doesn't work with interrupts. Luckily, in the process of debugging I have found a very useful tool for debugging Cortex MCUs which supports Black Magic Probe debugger and with it, everything works much better because it has preloaded setup for BMP. The name of the extension is  Cortex-debug . In the time of writing this text version, 0.1.21 doesn't support powering board over BMP (monitor twpr enable) so I modified the source of the extension to enable it. Link to the modified extension is here . If you are Linux user you need to unpack this zip in to /home/your_user_name/.vscode/extensions/ and restart VSCode. Now your Pixracer (or other board) will be power up before you start debugging it. Another useful thing you can do is to add a static name to your black magic probe instead check if it is ttyACM0 or ttyACM1.

Example - miniblink on Pixracer

Image
I have created my new repo pixracer-examples in the hope I'll find a time to create as much as possible examples for Pixracer. For now, I've created miniblink. Link to repo: https://github.com/Igor-Misic/Pixracer-examples Editor: Visual Studio Code (include building and debugging config) Debugger: Black Magic Probe

Config for VS Code debugger and Black Magic Probe + Pixracer

Image
Maybe you like VSC but you don't know how to config. I have tried many different configs and find out this work best for me. I have tested it with miniblink from libopencm3 . Configuration: { "version" :  "0.2.0" , "configurations" : [ { "name" :  "(gdb) Launch" , "type" :  "cppdbg" , "request" :  "launch" , "miDebuggerPath" :  "arm-none-eabi-gdb" , "targetArchitecture" :  "arm" , "program" :  "${workspaceFolder}/miniblink.elf" , "args" : [], "stopAtEntry" :  false , "cwd" :  "${workspaceRoot}" , "environment" : [], "externalConsole" :  true , "MIMode" :  "gdb" , "setupCommands" : [ {  "text"  :  "target extended-remote /dev/ttyACM0" }, {  "text"  :  "monitor tpwr

Pairing TM4C123GXL with VL53L1X and VL53L0X

Image
Here is the git repo where I paired two Time of Flight (ToF) sensors VL53L1X and VL53L0X to the TM4C123GXL development board.

How connect Pixracer with Black Magic Probe

Image
Here is how to connect your Pixracer with Black Magic Probe. You can see images with proper wiring.

Why invest in Croatia

Image
 There is a lot of money fluctuating around, looking for good investment opportunity. But a good percentage of them finish nowhere? In last year I explored a little bit Croatian embedded situation and people inside that field. I discovered one precious information. You can buy all Croatian embedded people very cheap! If you have a good idea and the extra money you can easily open company in Croatia, set salary price over average Croatian salary in this filed and you will have all those people in your company. And what is the best part? you will pay that the half price than in the US or in western Europe! The only thing you need to have is money, a good idea and good knowledge of creating a Business and you are ready to create a large technology company. The average salary in Croatia for the embedded software developer is under  32480 € gross with all expenditures to the state. And believe me, Croatian developers are good developers. As example you can see company Ri

EK-TM4C123GXL - Configure the I2C Module to Transmit a Single Byte as a Master

Image
Name of this blog post is the name of chapter 16.4.1 from ARM Cortex M4 TM4C123GH6PM  microcontroller datasheet (MCU on EK-TM4C123GXL board). It will be showed how to setup I2C1 from scratch. There is a way to do this with functions for set registers parameters but in this blog post, it will be done by writing directly into the register address. It is decided that way because it is the way how drivers are done.   The EK-TM4C123GXL has support for 4 I2C serial computer buses. First, we need to unlock GPIO_PORTA register and I2C1 register. To do that we need to do that over System Control Register addresses.   Image 1 - System Control Register Map 1. Enable the I2C clock using the RCGCI2C register