Recurring Neural Network

Two days ago I found this nice post at Hackaday about a guy who create a program to generate music:

Neural Network Composes Music; Says “I’ll be Bach”

He used Long Short Term Memory networks (LSTM) a kind of Recurring Neural Network (RNN), then I started to search more about these subjects and found some interesting links that I want to share with you:

Understanding LSTM Networks:

The Unreasonable Effectiveness of Recurrent Neural Networks:

Recurrent Neural Networks Tutorial:

I hope you enjoy reading about it. When I got something about it working on microcontrollers I will post here.

Nice Tutorial about RFID 125KHz encoding

Are you trying to decode the Manchester protocol of 125KHz RFID cards?

Well, there are many documentations in the Internet explaining how to do that, but this one is the most didactic tutorial I have found:

Other sites about RFID:

How to read HID cards:

Tips: SD Card Detection on NuttX

Today I got SDCard over SPI working on NuttX and already submitted the patch to mainline:

Now you also can test SDCard using the STM32F103-Minimum board.

This post is to explain how NuttX’s SDCard driver does to ignore the Card Detect pin on modules that doesn’t have it. Yes, my module doesn’t have CD pin, see:

Initially I was getting this warning message:

WARNING: No card present

And when I tried to mount the SDCard it reported error -19. Well, error -19 is “ENODEV”, that means: “No such device”.

Then analyzing the source code of the driver (at nuttx/drivers/mmcsd/mmcsd_spi.c) I found this:

  /* Check if there is a card present in the slot.  This is normally a matter is
   * of GPIO sensing and does not really involve SPI, but by putting this
   * functionality in the SPI interface, we encapsulate the SPI MMC/SD
   * interface

      fwarn("WARNING: No card present\n");
      slot->state |= MMCSD_SLOTSTATUS_NODISK;
      return -ENODEV;

Hmm, interesting! NuttX can use the return of spi_status() function to inform that card is present. Interesting, I was going to mess with the card detection thread/callback, saved by the bell!

Then all I did was to include:

  if (devid == SPIDEV_MMCSD)
       status |= SPI_STATUS_PRESENT;

inside the stm32_spi1status() at nuttx/configs/stm32f103-minimum/src/stm32_spi.c!

This is a simple and clever solution, like everything else in the NuttX!

Compiling the Circuit Simulator kTechLab

I was searching for a circuit simulator for Linux and found kTechLab.

There is not a built package for Ubuntu (I’m using Ubuntu 16.04) then I compiled it from source code:

$ git clone
$ cd ktechlab/
$ sudo apt-get install libqt4-dev
$ sudo apt-get install kdelibs5-dev
$ mkdir build
$ cd build
$ cmake ..
$ make
$ sudo make install

Then I just execute:

$ ktechlab

And kTechLab starts in all its glory!

How to get the machine origin with LINUXCNC

Today I tested the LinuxCNC controlling all 3 stepper motors (one for each axis) connected on TB6560-4V3 board.

Everything worked as expected, but zeroing the HOME axes manually is very boring. Then I decided to search how to do it automatically.

I found this nice post exampling the process:

I will need to connect the switches limiters (end-stoppers) to my CNC first to get it working. BTW I decided to post about it with the link to original post because it could be useful for other people.

CNC: Wire Limit Switches

I’m finishing my CNC building and now I need to wire the Limit Switches (End-stops).

My CNC initially will be controlled by TB6560-4V3 board, then searching for more information about how to connect the end-stops I found this nice tutorial:

Their TB6560 board is a little-bit different from mine (they are using older model), but almost all (if not all) information could be applied to my board as well.

So, let me go ahead and stops these motors at its end!