Skip to content

Flashing the LPC21xx controller

Robert Harrison edited this page Nov 16, 2016 · 25 revisions

Flash utility: http://www.flashmagictool.com

Settings to be able to communicate with the board: Flash Magic Utility screenshot

An older flash utility for Windows that is known to be working with the LPC2134/01: http://www.lpctools.com/downloads/LPC2000%20Flash%20ISP%20Utility%20v2.2.3.zip

Settings to be able to communicate with the board: LPC Flash Utility screenshot

Note that the XTAL frequency has to be entered for a successful connection to be made. I certainly hope that all ovens have been built with the same frequency XTAL (11.0592MHz which will be entered as 11059 (kHz) in the LPC Flash utility and 11.0592 (MHz) in Flash Magic).

Also the baudrates choices are fairly limited and depend on the chosen XTAL frequency. 57600 is the fastest one that will work with the 11059kHz setting. Using flashmagic I have had some problems getting the connection working at 57600 by changing the baud rate to 14400 it was finally recognised. Interestingly at 9600 it still didn't work.

ISP pinout from left to right if looking at the board so the ISP text can be read: ISP header

  1. n_ISP (connected to GPIO0.14, ground during reset to enter ISP mode)
  2. n_RESET (active low reset input)
  3. TXD0 (UART0 output to host, LVTTL 3.3V)
  4. RXD0 (UART0 input to MCU, LVTTL 3.3V)
  5. Ground (this ground is floating with respect to earth ground in the mains connector and chassis)

Enter bootmode sequence manually

  1. Ground n_ISP
  2. Ground and release n_RESET
  3. Release n_ISP
  4. Activate LPC2000 Flash Utility on the correct COM port
  5. Select Read Device ID and hit OK/Enter to dismiss the "please reset your board now" dialog.
  6. Dump flash or Upload new hex file
  7. Change LPC2000 COM-port to a different port (doesn't matter which one), as otherwise the program will continue to hog the COM port and you can't hook up a terminal program to it.
  8. Pull n_RESET low briefly again to start the software again.
  9. If running this firmware you will have debug output on the same serial port as the programming happened on but at 2Mbps,n81. (Edit. Debug output in the latest firmware appears to be 115200 N 8 1)

It's normal behavior to see both green LEDs on the front panel turn on or flicker when in ISP mode. This is a result of floating pins driving the buffers that drives the optocouplers. This means that both heater and fan may very well run at 100% duty cycle during the few seconds it typically takes to flash the controller. You can fit weak pull-up resistors on both outputs (P0.8 and P0.9) to get rid of the problem, however once the new firmware is loaded you can use the alternate bootload sequence which avoids turning on the fan & heater (discussed next).

Enter bootmode sequence with button press

Firmware versions after 0.2.1 include the following alternate bootload enter sequence, which keeps the fan and heater off during the bootloading process, along with an easier method of entering the bootloader if you don't have USB-Serial that can control n_ISP / n_RESET.

  1. Turn oven off (and wait a few seconds)
  2. Hold F1 button down
  3. Turn oven on
  4. The display should be blank, you can release the F1 button now as it's in bootload mode.
  5. Run bootloader software of your choice (see previous instructions)
  6. Turn oven off/on again to run new firmware

Flashing with linux.

Using this tool: http://sourceforge.net/projects/lpc21isp/, (after entering the bootloader) it's a matter of

./lpc21isp build/T-962-controller.hex /dev/ttyUSB0 57600 11059