??? 11/29/09 05:43 Read: times |
#171298 - My LPC936 ISP experience |
I am currently evaluating the LPC936 using the MCB900 board for a consumer product.
One of my requirements calls for a low cost way to program the chip by running a DOS batch file. I would like to share my experience on how I implemented it. There are five steps needed to program the chip in a real "No Touch" mode a) Way to activate the boot loader b) Get it to enter to the ISP mode after 1st power up c) Reset the chip to go to power up d) Download hex file e) Reset the CPU to run the new code Implementation a) I send a unique string to the com port and in my firmware used a UART message parser to invoke the boot code. To make this work with a dos batch file I wrote a DOS console program that runs by typing- startboot com3 9600 BOOT - at the DOS command prompt b) To get the chip to go to the ISP mode, I used the LPC NoTouch code well documented here and elsewhere c) To reset the chip I used the software Reset bit (AUXR1=0x08) and implemented after calling the "no_touch()" routine. d) To download the hex file I used Flash Magic-fm.exe... e) Resetting the CPU after downloading the new code was bit challenging to me, setting the Watchdog function in configuration register did not reset the chip. I ended up using the Reset MCU ISP function documented at the end of Table 112 in the LOC936 user manual. I implemented this by simply sending :00000008F8 to the serial port by calling my comport function from DOS :startboot com3 9600 :00000008F8. Please note that I don’t claim that this is the best way. I did it this way and it is working great for me. With a single call to a .bat file from my favorite editor I am able to program the chip. If anybody is interested I can post more details. Regards, Nathan |