Turning an mbed circuit into a custom PCB

OK, so I have a nice little circuit that I have plonked my mbed into and it all works fine. So what next?

I have reached this point with my final year university project and want to finish it of and migrate the mbed core components (namely the LPC1768 micro) onto my own board. I figured that it was best to start documentin this from the beginning as if I leave it all to the end I will almost certainly forget something important!

So the first port of call is to figure put what I really need to take from the mbed. Using Chris Styles' notebook page prototype-to-hardware for reference I work out that there is quite a lot I can get rid of namely Ethernet, JTAG, and the USB stuff (because I will use an FTDI32RL chip for the comms instead).

As I don't have the full version of Eagle I will use the free version. This limits me to a board smaller than 80 x 100 mm and only 2 layers. Also using this free version only 1 schematic sheet can be used, so I have to redraw Chris' work on a single sheet. Along with the required mbed components I also add in my circuit components to form a super circuit!

I planned to put a link to this file here but can't figure out how to add the file to this page :(

Instead here is a screen grab...

From this schematic I start to layout the board. Because nothing on the board is high frequency I'm not too constrained as to where thing need to go. I aslo add on a 5-pin Molex header to allow programming of the chip. This header consists to GND, UART0 TX & RX (LPC1768 pins 98 & 99), ISP (pin 53) and NRESET (pin 17). So a few hours later the board is laid out and I get...

So on the left is the view from the component side (top copper, holes, vias, pads, silkscreen) and the solder side on the right - nicely flood filled with a ground plane.

So I'm planning to get some nice PCBs spun via PCBTrain or someone. They will want some CAD files to manufacture the PCB. I found this webpage detailing how to use Eagle to get the required files. After I have read through it and followed the instructions I end up with 10 or so files that I can send away to get a board spun.

I decide to get the PCB made at PCBTrain, send of the required files and wait for the boards to come in...

And 5 days later they do...

So the first thing to do is out down the minimum components to get the LPC1768 running. So I solder down the LPC1768 IC and it's decoupling caps, the +5 & +3.3V regulators, the crystal and it's 18pF caps, the 100nF cap and 10k resistor for the reset line, the 100k pull up for the ISP.

At this point the board looks like this...

I also decide to solder on a 5 way header for the ISP interface to make life a little easier. The next thing to do is download a few programs namely Flash Magic and bin2hex (or if your running a 64-bit system use this bin2hex instead

With these 2 downloaded and installed the first test is to communicate with the LPC1768 on the PCB. To do this go to Chris Styles' notebook page prototype-to-hardware and copy the code from the 'Communicating with the LPC1768' section, create a new program in the mbed complier and paste the code into main.cpp.

Complie the code and download it to the mbed. The wire up the mbed to Chris' instructions, namely...

mbed         LPC1768
============================

p30(isp)     P2.10  (pin 53)
p29(reset)   nReset (pin 17)
p28(TX)      RXD0   (pin 99)
p27(RX)      TXD0   (pin 98)

Now install the serial drivers for the mbed (if you havn't done this already) and fire up teraterm or hyperterminal (make sure the terminal program is set to 19200 baud rate). Power up the LPC1768 PCB, connect the terminal program to the mbed com port and type '?'

With a bit of luck you should see...

If you see this then you have comms to your custom board! A second sanity check is to fire up Flash Magic. Select device as 'LPC1768', COM Port as your mbed port (19 in my case), and Baud rate of 19200. Reset you mbed and go to the ISP tab and then 'Read Device Signiture...' you chould see something like...

Proving you have comms (note: this will fail a read if you havn't reset the mbed!)

I guess the next thing is to load a program onto the LPC1768. To do this write the program in the mbed complier and compile the normal way, but save it to the same directory as BIN2HEX. Then open the MS-DOS command propmt.

I hate DOS, I can never remember the commands, because of this I put both the BIN2HEX program and my freshly complied file into the defalut DOS directory so I don't have to navigate around anywhere!

Finally cahnge the name of the file you want to download onto the LPC1768 to something short (<8 characters). In the command prompt window type BIN2HEX XXX.bin XXX.hex where XXX is the filename of your complied file. You should see...

And the converted file should appear in the same directory. So you now have the hex file required to put onto the LPC1768, you just need to get it on there!

The last bit is to use Flash Magic to get the hex onto the IC. This is done by setting us Flash Magic as above and in the Step 3 box browsing to the location of your newly created hex file. Tick 'Verify after programming' in step 4 and then click start. The program should flash over (literally - watch the LEDs on the mbed!) in 30 seconds or so.

Then your program should run. I tested this with a program to flash an LED, then took a photo,

This is obviously not my finished circuit, but it shows that the LPC1768 is up and running. I now need to solder up the rest of the board and flash down the full code. I'll do that on Monday...

Fishing the PCB...

With a functioning LPC1768 the remaining work on the circuit continued. The FTDI chip for USB communication was the first to be soldered on and tested. A simple ‘Hello World’ program that printed to HyperTerminal was compiled and tested. When the PCB was then plugged into a USB port the FTDI IC installed a driver on the PC which allowed communications between the LPC1768 and PC.

The same approach was taken for the ADC and H-bridge along with their respective ancillary components. This type of methodical assembly and testing was to identify any potential problems with any of the circuit sub-systems at the earliest opportunity.

After all the subsystems had been individually tested the full program was loaded onto the LPC1768 using exactly the same process as described above.

Finally the time had come for a full system test. I was surprised that the circuit worked first time (very unusual for me!). I guess this should not be too much of a shock, it is afterall the same code and MCU that I have been developing for a while now, it just looks a bit more professional...


20 comments

21 Mar 2010

cool!

13 Apr 2010

Thanks for sharing this, I'd realised early on that this was going to be the difficult bit (translating the chip to a real PCB). Not quite as user-friendly as PICs etc which fit in nice chip-holders, so this is useful stuff! Ta

06 Aug 2010

Cool !

Very nice work !

Exactly what i need ;-) adding Ethernet and Sdcard and the dream come true !

For SdCard i think it's easy (SPI),  to Ethernet, LPC1768 need a PHY interface. It's DP83848J on mBed, but tricky to solder !!

Someone have already use another PHY ? if yes does it's compatible with the mBed TCP lib ?

Thank you.

23 Feb 2011

any chance we can get a better picture of your schematic?  I'm looking to create a production type board and was hoping to put an FT232 on serial0 and program it directly over USB rather than messing with ISP.  I have a few other ARM boards that program with regular serial on port 0.

Nice article!!!

 

 

01 Mar 2011

user Matt Clement wrote:

any chance we can get a better picture of your schematic?  I'm looking to create a production type board and was hoping to put an FT232 on serial0 and program it directly over USB rather than messing with ISP.  I have a few other ARM boards that program with regular serial on port 0.

Nice article!!!

 

 

Hi Matt,

Sure, send me a private message and I'll e-mail you the eagle files.

Martin

15 Jun 2011

I to am looking to roll my design into a PCB. My project is a temperature data logger with a USB interface using a FTDI 232BL much like the Olimex MT7020 except I plan on using the LPC1768. I also need an SD interface to do unattended data logging.

Any idea what the custom IC on the MBED is with the markings MBED Interface? I suspect it's another NXP processor with dedicated program to interface with the LPC1768.

Would it be possible to get copies of your Eagle design files?  My email is pete.klemm@esysr.com

 

17 Jun 2011

I don't know what the mbed 'magic' IC is but I think it has more to do with the way new programs are loaded and run on the LPC1768 than anything important. If you follow the process described here then you can run mbed code on a custom circuit (but granted flashing new code onto the micro is a little harder than drag and drop!)

I have E-mailed you the design files you requested - good luck with your project

08 Feb 2013

user David Patterson wrote:

I have a question reguarding what to tie a few pins to.  I am making a PCB with FTDI header and then using a FTDI to usb cord.  I'm not sure what I should tie: TRST_N, TDI, TMS,TCK,RTCK,TDO,RSTOUTH.  Since I'm not using JTAG can I just tie these to ground or do some need to be tied to power.

Well TRST, TDI and TMS are JTAG input pins that should be pulled HIGH (the M0 has internal pull-ups and they can be left floating - but the M3 needs them setting). The TCK is also JTAG and could probably be left floating but I would pull LOW to be safe. Use 10k - 100k resistors or if you are NEVER going to use them just tie to the rail!

Leave TDO and RTCK floating (both JTAG outputs). That leaves RSTOUT which is an output that indicates the reset state of the device - leave this floating as well unless you want to know what teh device is doing fot some reason.

Martin

05 Mar 2013

Your article is great and helpful!

03 Apr 2013

Hi we're possibly looking to make a bespoke board but as we're using the httpserver library we've html to have stored and a config file. I can only guess we'd need the 2mb of storage currently on the mbed. Is there a circuit of suitable memory that could be used thats not SD card- we dont want the html to be easily changed.

We also have a config file for the device which needs stored in memory.

Mark.

22 Oct 2013 . Edited: 21 Jun 2014

 

thanx

21 Aug 2014 . Edited: 21 Aug 2014

Hi Martin. A very interesting project.

I would also like to see the Eagle files of your project (I'm learning Eagle, and I am more interested in mbed than arduino).

Could you send your Eagle files to me also ?

jonnev(att)gmail.com

27 Aug 2014

Hy Martin.

 

This is exactly what I need....

Could you please mail me the eagles files?

Really nice job!!!

My e-mail: costamlucas(at)gmail(dot)com

Nice regards!!!

Lucas

20 Oct 2014
Hi Martin I am working on a project in which i need to interface TFT Display(3.2") and CAN protocol. Can you please send me the Eagle files please?I really need it. My email id:prashantkumar1521@gmail.com Thank you i advance. Best ragards.. Prashant Kumar
05 Nov 2014
Hi, Martin can you mail me the eagle files? Thank you edwinc12104404@tas.tw
17 Mar 2015
hello Martin, could i also ask for the eagle files please? my email is lilla@outlook.com thank you very much
15 Nov 2015
Thank you for information, Could you please mail me the copies of your Eagle design files? My email : trip3dart@yahoo.com Daniel
21 Nov 2015 . Edited: 21 Nov 2015
Hi Martin, Copies of your Eagle design files would be appreciated. xxxxxxxxxxjohnl@gmail.com
16 Dec 2015
Martin I am interested in a variation of your design. Could I get your eagle files for it? I would like to import those into to DesignSpark. I may also be interested in contracting you to do some customization of a design for my specific project. Please send me your contact info and I can talk to you more about that. Thanks Louis Ashford
07 Mar 2016 . Edited: 07 Mar 2016
Files can be downloaded from this dropbox link Happy prototyping! Martin

You need to log in to post a comment