Saturday, February 20, 2016

BSidesPR 2016 Badge prototype

Last year (2015) BSides PR badge was cool but time pass and we need to keep on improving. This year badge is little different. As of when this post is published we only have a prototype, final version can and will change a bit. However key aspects of the board will stay the same. Design files for the board can be found at github.

Lets divide the badge in three areas. The brain, the communication and peripherals.

The Brain:
This badge carries some cool stuff. We went with a STM32F030F4P6 micro controller. This is an ARM® 32 bit Cortext M0 micro controller made by ST and consists of 16Kb of flash memory and it is clocked at 48Mhz. Information and manual can be found at manufacturer web site. It has 1 UART (in use to communicate with pc), 1 I2C and 1 SPI port. SPI port is used for shift registers.



Communication:
The badge can comunicate with the pc via USB. For this it uses a CH340G usb to serial chip. I have been using this chip for so long that I do not remember if linux needs any special driver. But for windows it indeed needs a driver. The chip works with Linux, Windows and MAC after is corresponding driver installation.
For drivers

    • Chinese official web site link
    • Some guy blogpost (has something for MAC, but I have never tried it)
    • Or just go to google and search for CH340G driver


Peripherals:
This baby is packing a few things.

  1. LED matrix
    • 8x8 LED matrix that is controlled from two 595 shift registers
    • One shift register is used for the rows and one for the columns
  2. Buttons
    • In the front it consists of four push buttons
    • The prototype do no have any of these buttons wired up to the microcontroller. Instead pins for the buttons are exposed at JP4 port. Pins are labeled Left, Right, Up and Down.
    • On the back there are two more buttons. One for programming and the other for reset.
  3. I/O exposed pins
    • To the left of the microcontroller a few pins are exposed. Please note the one that says 3.3V it is actually 5V. There pins PA0, PA1, PA2, PA3, PA6 and PB1 are available to be used. Easily can jump wire one of those pins to the buttons to interact with them.
    • On the right (beneath PROTOTYPE) is a ST-LINK port. It can be used for debugging with an external programmer. This is not required for normal programming but if you'll like to see a break point in your code this is the way to go and an external programmer is required. An external programmer can be a cheap ST-Link V2 programmer/debugger and are cheap on ebay.