ai.rs blog

Artificial Intelligence – Technology Blog

How to flash Hackaday Badge 2018

Hackaday organized wonderful conference in Belgrade in May 2018. Traditionally, each participant received special Badge that is this time small computer. Badge is based on 32bit Microchip PIC as CPU, supports writing in customized BASIC. It is ideal to be used as a small serial terminal with keyboard and display. But to do so, you need support for “kin” BASIC function which is not working in firmware v1.00. So you need to flash new firmware! But hey, because Voja is old school and prefers Microchip controllers, USB2Serial cable is not enough! :( Hope next time they will choose ESP32

You need to get PICkit3 USB adapter. (thank you Boris!) Here are the next steps for all electronics fun that do not use Microchip PIC regularly.

  • 1. Download and install MPLAB X IDE (v4.15)
  • 2. Connect PICkit3 to Hackaday badge as shown below
    Notice that left pin is unconnected!

    (read more here)

  • 3. Get latest firmware (now it is v.1.04) here
  • 4.Open MPLAB IDE, choose 32bit MUC, Device PIC32MX370F512H

    Microchip Hackaday badge cpu

  • 5.Choose firmware file (badge1.X.production.hex), select “Program”

  • 6. After success, notice v1.04 in the bottom right corner :D

    Now let’s test badge as serial console!

    Wiring Diagram:
    * Badge Pin Ground (GND) –> Ground on serial cable
    * Badge Pin TX (C14) –> RX on serial cable (White in this example)
    * Badge Pin RX (C13) –> TX on serial cable (Green in this example)
    * Important: Leave voltage disconnected (Red in this example)

    On your computer (Mac/Linux) type:
    screen /dev/tty.XXXYYY 19200
    where XXXYYY depends on what USB2TTL adapter you are using and OS installed.

    On Badge Write BASIC code that will transmit typed keys over serial port:
    10 cls
    15 wait 500
    20 PRINT MyTerminal
    30 k = kin 1
    40 out k
    50 goto 10

    Everything that you type on badge will be transmitted/seen on computer!

    Here is log file of MPLAB X IDE while flashing you badge…
    PicKIT3 log:

    2018-06-14 15:10:09 +0200 – Completed loading IPE.

    2018-06-14 15:13:40 +0200 – Loading hex file. Please wait…
    Loading code from /Users/mac/Documents/FPGAhackaday/FlashBadge/basic-badge-master/firmware/badge1.X/badge1.X.production.hex…
    Warning: /Users/mac/Documents/FPGAhackaday/FlashBadge/basic-badge-master/firmware/badge1.X/badge1.X.production.hex contains code that is located at addresses that do not exist on the 11AA010.
    Code incompletely loaded.
    2018-06-14 15:13:40 +0200 – Hex file loaded successfully.

    2018-06-14 15:15:11 +0200 – Loading hex file. Please wait…
    Loading code from /Users/mac/Documents/FPGAhackaday/FlashBadge/basic-badge-master/firmware/badge1.X/badge1.X.production.hex…
    Warning: /Users/mac/Documents/FPGAhackaday/FlashBadge/basic-badge-master/firmware/badge1.X/badge1.X.production.hex contains code that is located at addresses that do not exist on the 11AA010.
    Code incompletely loaded.
    2018-06-14 15:15:11 +0200 – Hex file loaded successfully.

    *****************************************************

    Connecting to MPLAB PICkit 3…

    Currently loaded firmware on PICkit 3
    Firmware Suite Version…..01.26.56 *
    Firmware type…………..Midrange

    Now Downloading new Firmware for target device: PIC32MX370F512H
    Downloading bootloader
    Bootloader download complete
    Programming download…
    Downloading RS…
    RS download complete
    Programming download…
    Downloading AP…
    AP download complete
    Programming download…

    Currently loaded firmware on PICkit 3
    Firmware Suite Version…..01.51.08
    Firmware type…………..PIC32MX

    Target device was not found (could not detect target voltage VDD). You must connect to a target device to use PICkit 3.

    *****************************************************

    Connecting to MPLAB PICkit 3…

    Currently loaded firmware on PICkit 3
    Firmware Suite Version…..01.51.08
    Firmware type…………..PIC32MX

    Target voltage detected
    Target device PIC32MX370F512H found.
    Device ID Revision = A0
    2018-06-14 15:21:16 +0200 – Loading hex file. Please wait…
    Loading code from /Users/mac/Documents/FPGAhackaday/FlashBadge/basic-badge-master/firmware/badge1.X/badge1.X.production.hex…
    2018-06-14 15:21:16 +0200 – Hex file loaded successfully.

    2018-06-14 15:21:20 +0200 – Programming…

    Device Erased…

    Programming…

    The following memory area(s) will be programmed:
    program memory: start address = 0x1d000000, end address = 0x1d0797ff
    boot config memory
    configuration memory
    Programming/Verify complete
    2018-06-14 15:22:00 +0200 – Programming complete
    Pass Count: 1


    Scan to read
    Scan the QR Code
    QR Code Generator
    Be Sociable, Share!

  • Leave A Comment

    Your email address will not be published.