Madelon LPC development board

Hardware incubation. See also our in development projects wiki.

Re: Madelon LPC development board

Postby Squonk » Thu Jan 12, 2012 2:15 am

Sorry, maybe we switched to a private conversation here, this wasn't intended.

Okay, let's summarize all that!

After finding the early PCB of an LPC1343-based board into the wiki, some improvements have been suggested (better ESD/EMI protection, smaller voltage regulators, an SWD debug connector...), still keeping the hacker-friendly DIP40 form factor.

Then we discussed the development of a debug/flash programming tools based on this board.

In former microcontroller, there used to be either vendor-specific debug/programming interface using the fewest possible number of wires, or JTAG-like interfaces for the largest microcontrollers having more pins available.

Then ARM Ltd. came out with the Cortex CPU core, which has been integrated into all the new SoC from NXP/ST/TI, etc.

Unfortunately, each vendor turned into proposing its own solution for debugging/programming using a vendor-specific serial in-circuit debug interface over USB.

What you should realize here, is that by this mean, they try to lock you to their product with their proprietary debug protocol, pushing you to use their (or their partner's) commercial dev tools... But this way, they also prevent free/open solutions from being used!

This is a shame, as the lowest-level SWD interface common to all these chips has been initially defined by ARM Ltd. and is (almost) standard over all these SoCs.

What is bad too on the host computer side, is that these proprietary tools require the installation of a vendor-specific piece of software to dialog with these vendor-specific hardware debug interfaces, using a gdbserver protocol "proxy" (frontend) in the case a GNU toolchain is used (a lot of vendor solutions are in fact GNU-based!).

So, the idea here was to integrate the gdbserver protocol (frontend) and the SWD low-level interface (backend) with just a thin software mapping layer in-between into the LPC1343 board, turning it into a vendor/OS-agnostic Cortex debug interface.

Moreover, if the low-level SWD backend can be replaced by a JTAG or any other vendor-specific backend, we have then an even more general microcontroller debug interface, requiring no software to interface with gdb.

Like Aln pointed out, this is very close to what st-link did for the ST products for the lowest part, just integrating the gdbserver protocol in it.

I am pretty sure there is more than that to do, but let's be optimistic!
Squonk
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Apr 10, 2011 3:23 pm

Re: Madelon LPC development board

Postby miceuz » Wed Apr 11, 2012 4:41 pm

I've built the microbuilder reference design. I really like it and hate it at the same moment. On one hand, the board could be much smaller and maybe etchable at home if pins weren't logically layed out, on another - i'm already designing a second "shield" for it, so maybe have main board this big allows you to make extensions for it without shortage of space.

Another thing i don't like with microbuilder is that they user parts that are hard to source. Why user sot-23 eeprom, when you have plenty space on board to use so-8 eeprom.

Regarding design by Dangerous prototypes - theres no diodes near programming button - that is really a nice feature to have, but it comes with a drawback - you need a voltage monitor, to hold reset for you while board boots. I've tried the board without voltage monitor (because again, it is one of those pin incompatible rare types) and it was entering into programming mode upon usb cable connection (without external power) until i've added voltage monitor. Tried to replace it with a cap, but nah, it either didn't work or worked buggy.

I'm gonna be ordering a PCB revision of microbuilders design with more widely available parts soon.
miceuz
Newbie
Newbie
 
Posts: 5
Joined: Wed Apr 11, 2012 4:28 pm

Re: Madelon LPC development board

Postby Squonk » Sun May 13, 2012 6:22 am

miceuz wrote:Regarding design by Dangerous prototypes - theres no diodes near programming button - that is really a nice feature to have, but it comes with a drawback - you need a voltage monitor, to hold reset for you while board boots. I've tried the board without voltage monitor (because again, it is one of those pin incompatible rare types) and it was entering into programming mode upon usb cable connection (without external power) until i've added voltage monitor. Tried to replace it with a cap, but nah, it either didn't work or worked buggy.

Now that I built an LPC1343 board with the same diodes as on the MicroBuilder board, I understand what you mean: without external power and thus supplying power from USB, when you connect the USB cable, the ISP signal is driven along with the RESET signal, thus causing the CPU to enter ISP mode.

I also tried to add a 100 nF cap across the RESET button: it looks like it is working the first time, but then it is random. So I guess you are right, I need to add a voltage monitor too.

Basically, my board is a 40-pin LPC1343 breakout board with 12 MHz crystal, USB Connect detection and disconnect, MicroBuilder's single-button ISP, ISP Header and the standard LPCXpresso user LED. I added proper USB ESD/EMC handling, all this on a 5x2 cm board. All parts where purchased at Digi-Key, but I am working on the BOM to be able to order the parts from other online distributors that are easier to work with in Europe (Farnell, RS...).

Here is what it looks like:
USBug_KT4.jpg

You can find the corresponding Sketchup 3D Model in the 3D Warehouse.

I plan to release the project as open hardware under CC-BY-SA license soon, as I just soldered the first prototype and that it is working as expected.

Let me know if you are interested in this design!
Squonk
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Apr 10, 2011 3:23 pm

Re: Madelon LPC development board

Postby AdShea » Mon May 14, 2012 3:43 pm

With regards to the voltage monitor requirement, in the past I've had good luck using a schmitt-triggered buffer and an RC-delay circuit to do power up-reset delays. Nice thing is that single or dual package buffers come in SOT-23-6, SC-70, and SOIC-8 from just about every manufacturer.
AdShea
Newbie
Newbie
 
Posts: 14
Joined: Thu May 26, 2011 4:21 pm

Re: Madelon LPC development board

Postby miceuz » Tue May 15, 2012 2:40 am

After building a couple of projects on microbuilders design, i went another way - a quite big board that's expandable by arduino-like "shields" and that facilitates feature export to the case (like case mounted USB connector)

https://github.com/Miceuz/CatNip

I didn't build it yet though, waiting for seeedstudio
miceuz
Newbie
Newbie
 
Posts: 5
Joined: Wed Apr 11, 2012 4:28 pm

USBug LPC1343 Development Board

Postby Squonk » Tue May 15, 2012 5:10 pm

The USBug project is now available at https://github.com/Squonk42/USBug.

Here is a picture of the real prototype (not a rendering of the 3D model!!!):
USBug-012.jpg
Squonk
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Apr 10, 2011 3:23 pm

Re: Madelon LPC development board

Postby cmdrk33n » Sat May 19, 2012 9:11 am

Hi Sqounk, i have a little question about your USBUG schematic:

the BSS84-7-F (Q1) is a "P-Channel Enhancement mode field effect Transistor". So, i never used this kind of Mosfets before and i don't know anything about it.

long story short: can you explain me for what this type of MOSFET's is used for? or give me a few buzzwords? :)

thanks, the commandR
cmdrk33n
Newbie
Newbie
 
Posts: 23
Joined: Mon Feb 06, 2012 3:19 am

Re: Madelon LPC development board

Postby Squonk » Sat May 19, 2012 3:51 pm

The BSS84-7-F (Q1) is just a basic P-MOSFET transistor, acting as an almost ideal switch for the USB LED and the 1k5 USB full-speed device enumeration pull-up resistor on D-. When turned on, Q1 will turn on the USB LED and connect the USBug to the USB bus. When turned off, Q1 turn off the USB LED and disconnect the USBug from the USB bus.

I initially planned to use a standard PNP BJT transistor (2N2097, BC857 or equivalent), but as it requires 2 additional resistors for polarization (1 in series with the base a few kohms, and the other across base and emitter, a few tens of kohms), I lazily swithced to a P-MOSFET which does not require any external component: used as an analog switch, the MOSFET channel has a low–on-resistance switch to pass analog signals when on, and a high impedance when off.

For a P-MOS, the source is the more positive side, and the more negative for an N-MOS.
Squonk
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Apr 10, 2011 3:23 pm

Re: Madelon LPC development board

Postby cmdrk33n » Sun May 20, 2012 2:07 am

thank you :)

i know that the 1k5 on D+ comes from the USB spec (1k5 on D- declares the devica as lowspeed, i think) and that the ARM toggle USB_CONNECT when it is ready to go (after init etc.).
I haven't seen PMOS the symbol with the diode before and thought it was a special kind of MOSFETS, this has kicked me out. but now i got it :D

I currently study your USBUG to learn how to handle ARMs with USB caps.

I hope i understood your schematic correctly:

"R3/R5 will cause the bootloader to boot into USB/MSC
mode if USB is connected, and into UART/ISP mode
otherwise."

so, this two resistors are pushing P0_3 to high, causing the chip to start USB enumeration. If the ISP button is pressed, the chip goes into the "firmware USB upload" mode.
cmdrk33n
Newbie
Newbie
 
Posts: 23
Joined: Mon Feb 06, 2012 3:19 am

Re: Madelon LPC development board

Postby Squonk » Sun May 20, 2012 4:28 am

I see: don't worry, there are a lot of different symbols for the MOSFET transistors: http://en.wikipedia.org/wiki/MOSFET#Circuit_symbols. As I created the part in EagleCad, I took the right one for enhanced P-MOS, with the body-drain diode which is generally omitted (see "Why there is an inherent diode inside the MOSFET symbol?" and IRF AN-1084).

Regarding R3/R5, they form a 1/10th voltage divider to protect the LPC1343's "USB_VBUS" input pin (PIO0_3, pin 14). Although this pin is 5V-tolerant and have a maximum rating of +5.5V and that the USB spec on VBUS is 5V +/- 5% (i.e. from 4.75V to 5.25V), it is not uncommon to see higher transient voltages during cable connection (up to 10V, see LTC3455/LTC3455-1 datasheet, figure 6 page 18). Practically, because of the 1µF/16V C2 capacitor and L1 used on +5V, it does not reach +6V. So although not strictly mandatory, the voltage divider is recommended!

And yes, if ISP is activated either by pressing the "ISP" button, or because the internal ROM does not see any valid application in Flash memory, the PIO0_3 (USB_VBUS) is checked to determine whether the UART or USB interface will be used (see "LPC1311/13/42/43 User manual (v.4.0)", section 21.4 page 320 and figure 63 page 325).

However, this causes an issue when you plug in the USB cable when you have no external power supply: the USBug enters ISP mode unless you press the RESET button! This is because the RESET needs to be maintained low for a while after VCC is applied. I tried to add a capacitor to correct this, but it not reliable, as explained above. I am waiting for some MCP130T-315 voltage supervisor parts that should do the trick.

Although simple, the schematic contains some other "finesses", like the ESD/EMC filters/protections around the USB connector, or the decoupling capacitors. I was thinking of adding a description into the GitHub project wiki...

Don't hesitate if you have any further questions!
Squonk
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Apr 10, 2011 3:23 pm

Re: Madelon LPC development board

Postby Squonk » Wed May 23, 2012 4:09 pm

A small update to let you know that replacing the R1 RESET pull-up by an MCP130T-135 in SOT23-3 package fixed the problem with the USBug entering ISP mode upon USB cable insertion without external power supply.

So, I will probably include this mod into the next Rev. B board design. I may also include:
  • change the P1 ISP header from R/A to vertical, as it is easier to find
  • change J1 Hirose USB connector for one with standard post spacing, also easier to find
  • change Y1 crystal for one that is easier to find
  • change L1 footprint to 0603 vs. 0805
  • disconnect J1 USB connector pin 4 (ID) from GND, as we are not OTG
  • add a resetable fuse on VBUS
USBug-013.jpg
The MSP130T-315 voltage supervisor hack
Squonk
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Apr 10, 2011 3:23 pm

Re: Madelon LPC development board

Postby cmdrk33n » Thu May 31, 2012 1:11 am

Hello squonk,

i was a little bit confused about the lpc1343 symbol in your eagle lib. there is a JTAG port that i couldn't find in the datasheet.

Thank you for sharing your great project :)
cmdrk33n
Newbie
Newbie
 
Posts: 23
Joined: Mon Feb 06, 2012 3:19 am

Re: Madelon LPC development board

Postby Squonk » Thu May 31, 2012 2:35 am

Actually, the LPC1343 does not have a JTAG interface, but it features an SWD (Serial Wire Debug) interface as all ARM Cortex CPUs. The SWD appears only briefly at the top left of the chip block diagram in the datasheet. You have to read the comprehensive LPC1311/13/42/43 User manual (v.4.0) chapter 22 to find out more about this.

The SWD physical interface is using 3 signals at most (not counting GND):
  • SWDCLK (SWD Clock)
  • SWDIO (SWD I/O)
  • optionally SWDO (SWD Output) for trace output

On the LPC1343 itself, these pins are multiplexed with other functions, and as there may be many functions on the same pin, symbol designers generally omit some as the string is getting to long...

On the debug connector, these pins can be shared with the standard JTAG signals as explained on ARM's website here.

If you are interested, more details on the SWD protocol itself can be found in this 3-part tutorial.
Squonk
Jr. Member
Jr. Member
 
Posts: 94
Joined: Sun Apr 10, 2011 3:23 pm

Previous

Return to Project development, ideas, and suggestions