Author Topic: My first ARM/LPC design, critic requested.  (Read 29793 times)

0 Members and 1 Guest are viewing this topic.

Online zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
My first ARM/LPC design, critic requested.
« on: October 08, 2014, 04:44:31 am »
I am switching from atmega328p to NPX LPC11u35 as my generic MCU. As a sanity check I am designing a general purpose prototype PCB that will be the base for my application specific PCBs. Attached below are a low resolution image and a PDF with the schematic. Do you any problem? Would you change it in anyway?  Anything I can drop (the design is supposed to be minimal).  BTW, I created manually the MCU symbol so should not be trusted. 

The optional portions in the diagram are for USB connectivity (with and without a debugger), debugger port, and external power.  I will debug it with an LPCXpresson Link 1 board.


https://www.eevblog.com/forum/microcontrollers/my-first-armlpc-design-please-critic/?action=dlattach;attach=112199




Thanks,
zapta

« Last Edit: October 08, 2014, 04:51:37 am by zapta »
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28101
  • Country: nl
    • NCT Developments
Re: My first ARM/LPC design, critic requested.
« Reply #1 on: October 08, 2014, 09:28:57 am »
I see no real problems. Just be sure you checked the pins twice. BTW I never use an extra FET to pull the 1.5k resistor up. I connect it to a microcontroller pin directly.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6576
  • Country: nl
Re: My first ARM/LPC design, critic requested.
« Reply #2 on: October 08, 2014, 12:46:33 pm »
no expert on these lpc chips but just a few thoughts:
1) are you sure 100nF decoupling is enough on the Vcc pins of the micro?
I mean even an 8 bit STM8s wants 2u locally on its powersupply pins. In my limited experience, too low local decoupling of a microcontroller can cause stability issues when using it's GPIO's to source current (sinking is usually ok).

2) the reset circuit of a micro usually has some delay in the form of a RC , maybe i missed it but i can see only the pullup resistor?
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28101
  • Country: nl
    • NCT Developments
Re: My first ARM/LPC design, critic requested.
« Reply #3 on: October 08, 2014, 01:20:18 pm »
This chip has internal POR.

Edit: more capacitance wouldn't hurt. I usually have 1uf 0603 on one VDD pin and 100nf 0603 on the other.
« Last Edit: October 08, 2014, 01:54:27 pm by nctnico »
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #4 on: October 08, 2014, 01:35:41 pm »
Being a fan of minimum configurations I think the FET, reset PU, and additional bypass caps are not required. Playing around with no bypass on LPC812 tells me the internal regulator and silicon bypass are doing a good job but probably foolish to not use at least one 100nf. I have to laugh at some of the complicated and unnecessary reset circuits people attach to modern chips like PIC/AVR. Most of this comes from 1980s mindset when internal reset timers were rare. Of course the other side is it's easy to leave off components that are not required but harder to install them if there's no pads.

From noise immunity lab testing it also seems tying reset high can be a big mistake. Much worse than leaving it open.
 

Online zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #5 on: October 08, 2014, 02:45:42 pm »
I see no real problems. Just be sure you checked the pins twice. BTW I never use an extra FET to pull the 1.5k resistor up. I connect it to a microcontroller pin directly.

The datasheet says that if the MCU is not USB powered, the transistor is required. I plan to experiment with it more. Also considering having connecting the resistor to a PIO output that have the inverted state of the CONNECT output (e.g. a periodic IRQ that reads the CONNECT pin and writes the not/state to the new pin). This may save a transistor and a few resistors.


1) are you sure 100nF decoupling is enough on the Vcc pins of the micro?
I mean even an 8 bit STM8s wants 2u locally on its powersupply pins. In my limited experience, too low local decoupling of a microcontroller can cause stability issues when using it's GPIO's to source current (sinking is usually ok).

I am not sure. Where can I find information? I saw the same combination of 0.01 and 0.1 caps in a Embedded Artists board.  Also, should I look for a specific kind of capacitors?  (I plan to have 0402 size).


2) the reset circuit of a micro usually has some delay in the form of a RC , maybe i missed it but i can see only the pullup resistor?

The pullup resistor is on the upper right corner. Do I need it? The datasheet says that reset can be left unconnected in some conditions.

I saw an example of an Embeded Artists board where they had a MIC6315 between the button and the LPC11U35. Not sure why they need it, maybe debouncing the reset button?  I went with a minimal approach I also used with atmega328p.


Being a fan of minimum configurations I think the FET, reset PU, and additional bypass caps are not required. Playing around with no bypass on LPC812 tells me the internal regulator and silicon bypass are doing a good job but probably foolish to not use at least one 100nf. I have to laugh at some of the complicated and unnecessary reset circuits people attach to modern chips like PIC/AVR. Most of this comes from 1980s mindset when internal reset timers were rare. Of course the other side is it's easy to leave off components that are not required but harder to install them if there's no pads.

My goal is to have minimal but realistic design that I can use for real applications. Not a theoretical minimal in lab conditions.

The FET *may* be required if the board is powered by external power, not sure. If it's powered from USB then it connects upon reset and everything is fine. If it's already running by external power, I guess it's need to connect as soon as it detects VBUS. Also, if you use the reset pin, I think it will not reconnect if the resistor is permanently connected. I need to experiment with it more.

From noise immunity lab testing it also seems tying reset high can be a big mistake. Much worse than leaving it open.

Can you explain?  Is it sufficient, for real world designs, to just have the reset button without the pull-up resistor?
 

Online zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #6 on: October 08, 2014, 02:57:42 pm »
BTW, I am also developing a companion library with basic functionalities  (all required libraries are in a single lpcxpresso project for easy installation). The hello world is here

https://github.com/zapta/arm/blob/master/lpcxpresso/hello_world/src/main.cpp
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #7 on: October 08, 2014, 03:36:29 pm »
Can you explain?  Is it sufficient, for real world designs, to just have the reset button without the pull-up resistor?

From what I can tell majority of "real world" designs do not have a reset button. In any case if there is one and even if located feet or meters away a 10k pullup will make little difference. However in that situation a cap might help.

But to answer your question maybe 12-15 years ago a client who built welding equipment was having trouble with intermittent resets on an Atmel 90s8515 based product he designed. After spending thousands trying to solve the problem he hired me in desperation (had to be desperate to stoop that low, LOL).

At great expense high end HP microwave pulse and spectrum analysis equipment were rented but really the most effective tool was a homegrown spark chamber. Lots of research on electromagnetic induction vs electrostatic etc.. It was amazing how strange and elusive that reset sensitivity was. Finally after trying many circuit and shielding configurations the best solution turned out to be cutting pin one off the MCU. Resets still occurred but orders of magnitude less than with IC, R, C, or RC add-ons and deemed acceptable for his situation. Tying directly to VCC was about an order of magnitude worse than the RC stuff. Maybe not so much ground loop issues but more like "VCC loop".

Many years later Atmel replaced the part with ATMEGA8515 version and the problem went away almost entirely. Similar issues with 90s1200 back then but almost non-existent with newer MEGA8, MEGA328, and TINY series. So bottom line, I am convinced no circuit is the best circuit for AVR parts and probably PIC too. Maybe not obvious to those from the days of Z80 and 8051 but it looks to me like modern chips benefit greatly from those internal reset timers.

So like I hinted if a circuit is fully exposed (NOT recommended for "real world" designs) and you are worried about careless poking with screwdriver or finger then a cap will help. Not so much the 10k pull up which isn't that different compared to the internal 30k.

BTW in some of my "lab" experiments poking with a finger or tool to reset turns out to be very convenient. Not something I would recommend for commercial designs though. :)
 

Online zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #8 on: October 08, 2014, 04:21:08 pm »
So like I hinted if a circuit is fully exposed (NOT recommended for "real world" designs) and you are worried about careless poking with screwdriver or finger then a cap will help. Not so much the 10k pull up which isn't that different compared to the internal 30k.

Thanks paulie. The reset button is only for development configuration so the reset resistor may be redundant. I will try it with my test board and will make it optional (according to the datasheet it is required for low power applications that use standby mode).

What do you think about the MCU bypass capacitors, would would be a solid 'real world' configuration?
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #9 on: October 08, 2014, 05:08:43 pm »
I don't have direct experience with LPC11u35 but after recently doing a lot of testing with LPC812 and others a single 100nf looks good to me. In any case 10uf and 22uf chip caps are available in same package. When a new chip arrives the first thing I try is to see if it runs without any bypass at all. I even have a few different lengths of cables to power from my 5v/3v supply (USB/serial dongle). One of the things I liked about LPC was they ran fine with no bypass unlike STM and PSOC. It's silly to run without any cap at all but these experiments do sometimes give an indication of the limits.

Another thing that was nice was having all bits on one port instead of scattered and also the serial bootloader. The virtual drive thing sounds very attractive too so I'm curious how that works out for you. Even though they are not within my original one dollar range these advantages over the cheapies do temp me.

 

Online zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #10 on: October 08, 2014, 05:58:40 pm »
I don't have direct experience with LPC11u35 but after recently doing a lot of testing with LPC812 and others a single 100nf looks good to me. In any case 10uf and 22uf chip caps are available in same package. When a new chip arrives the first thing I try is to see if it runs without any bypass at all. I even have a few different lengths of cables to power from my 5v/3v supply (USB/serial dongle). One of the things I liked about LPC was they ran fine with no bypass unlike STM and PSOC. It's silly to run without any cap at all but these experiments do sometimes give an indication of the limits.

Another thing that was nice was having all bits on one port instead of scattered and also the serial bootloader. The virtual drive thing sounds very attractive too so I'm curious how that works out for you. Even though they are not within my original one dollar range these advantages over the cheapies do temp me.

Just checked this appnote and it suggests to start with 0.1uf so I think I will drop the 0.01uf.  That's also what I had with the atmega328p (16Mhz crystal and internal speed).

As for the USB loader, it works very well and useful for firmware upgrade by users. After you create the axf file, you run another utility that creates the (signed?) binary. Then you plug the board to the USB port while pressing the ISP button. This causes a standard drive with one file (the current firmware) to appear on your computer. You copy the binary file to that drive (the file name doesn't matter as far as I can tell) and you are done. No tools, special cables, no software required by the user.  Since you are using command line scripts, you can just automate the entire process.

I can send you a populated board once they will be ready.
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #11 on: October 08, 2014, 07:12:40 pm »
I can send you a populated board once they will be ready.

I was going to ask about getting a blank PCB but if you have extra chips it would be very exciting to get one pnp. I would insist on compensating for parts and shipping. I suspect it would be a bargain compared to those $50 development boards on Ebay. Are you planning on OSH or Seeed studio or the like?

It didn't occur to me until now that the virtual disk would use binary. Being an ARM s19/hex fanboy so far and not having dealt with true binary yet I'm not sure about that AXF business. Keil wants personal info and registration before download which annoys me. Do you know if GCC can produce AXF or any other type of file that is compatible? It seems to do a good job of compiling for that chip. How about conversion utilities?
 

Online zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #12 on: October 08, 2014, 07:32:44 pm »
I was going to ask about getting a blank PCB but if you have extra chips it would be very exciting to get one pnp. I would insist on compensating for parts and shipping. I suspect it would be a bargain compared to those $50 development boards on Ebay. Are you planning on OSH or Seeed studio or the like?

It didn't occur to me until now that the virtual disk would use binary. Being an ARM s19/hex fanboy so far and not having dealt with true binary yet I'm not sure about that AXF business. Keil wants personal info and registration before download which annoys me. Do you know if GCC can produce AXF or any other type of file that is compatible? It seems to do a good job of compiling for that chip. How about conversion utilities?

Will let you know when it will be ready (no problem sending a populated one). Everything I am doing is open source but I have no plan on selling it in any way. People can later take the eagle files modify them to do useful stuff.

I suggest to install the LPCXpresso IDE. It installs all the tools you need (compiler, linker, axf to binary, etc). Create a simple project and build it. Then use the makefiles it generated to see what was actually going on and then cut your own optimized minimal scripts. The IDE is very handy in this regard, I can build the entire project using a simple make command.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6576
  • Country: nl
Re: My first ARM/LPC design, critic requested.
« Reply #13 on: October 08, 2014, 08:16:48 pm »
I am not sure. Where can I find information? I saw the same combination of 0.01 and 0.1 caps in a Embedded Artists board.  Also, should I look for a specific kind of capacitors?  (I plan to have 0402 size). 
Strange normally this information is in the datasheet or usermanual but I am also unable to find it with a quick scan, a whole chapter on the oscillator capacitor requirements but nothing on the Vdd decoupling, strange.

Personally (but every engineer has its own thoughts) I would stick for capacitors with 0805 or 0603 and keep the voltage much higher then the operating voltage due to the capacitance  degrading over voltage variation.
Dave did a fundamentals friday on this recently and here is also some info:
http://www.maximintegrated.com/en/app-notes/index.mvp/id/5527
So I would use 16V or 25V smd capacitors if you stick with the 100nF value just to be sure. If you go higher with the capacitance you can lower the voltage, check the datasheet of the capacitor.
 

Offline SirNick

  • Frequent Contributor
  • **
  • Posts: 589
Re: My first ARM/LPC design, critic requested.
« Reply #14 on: October 09, 2014, 11:08:18 pm »
No pull-up on ISP En?
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28101
  • Country: nl
    • NCT Developments
Re: My first ARM/LPC design, critic requested.
« Reply #15 on: October 10, 2014, 01:26:50 am »
I usually put a pull-up on that pin out of habbit from the but the Cortex Mx devices from NXP all seem to have pull-ups enabled on all pins by default. At least I haven't come across one where that was different.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #16 on: October 10, 2014, 05:13:38 am »
No pull-up on ISP En?

I am looking at the EA lpc11u35 board which is a semi official Dev board. It doesn't have a pull up, just a 2k series resistor which I presume to protect pio0_1 if used as an output.
 

Online zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #17 on: October 10, 2014, 05:16:32 am »
I usually put a pull-up on that pin out of habbit from the but the Cortex Mx devices from NXP all seem to have pull-ups enabled on all pins by default. At least I haven't come across one where that was different.

Is it safe to remove the reset pull up resistor?
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #18 on: October 10, 2014, 05:43:05 am »
Maybe not all pins have default PU. My LPC812 running an endless loop has P0_10 & P0_11 floating. Also might be a good idea to put one on reset if the spec sheet says some sleep modes require it. I tried some sleep modes and it was pulled up internally but maybe not all modes were tried. Even 0603 or 0805 don't take up much space and they cost almost nothing. Like I said before it's easy to leave unpopulated but hard to solder to pads that ain't there.
 

Offline Brutte

  • Frequent Contributor
  • **
  • Posts: 614
Re: My first ARM/LPC design, critic requested.
« Reply #19 on: October 10, 2014, 05:45:38 am »
all required libraries are in a single lpcxpresso project for easy installation). The hello world is here
Ok, so there is another
thing you should be LPC-aware of*
7. LPCXpresso uses project format that is incompatible with Eclipse GNU ARM plugin.
 

Offline Jeroen3

  • Super Contributor
  • ***
  • Posts: 4195
  • Country: nl
  • Embedded Engineer
    • jeroen3.nl
Re: My first ARM/LPC design, critic requested.
« Reply #20 on: October 10, 2014, 05:56:07 am »
Is it safe to remove the reset pull up resistor?
Don't poke the emc devil if you do not have to. For energy saving purposes pullups up to 47k are safe. Above is risky.

Don't remove the usb pullup transistor. It is required to re-enumerate the USB bus after DFU is complete. And since the chip has startup time it is also used to not enable the usb bus until the chip is ready. To prevent failed enumerations.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 28101
  • Country: nl
    • NCT Developments
Re: My first ARM/LPC design, critic requested.
« Reply #21 on: October 10, 2014, 11:01:04 am »
I usually put a pull-up on that pin out of habbit from the but the Cortex Mx devices from NXP all seem to have pull-ups enabled on all pins by default. At least I haven't come across one where that was different.
Is it safe to remove the reset pull up resistor?
I wouldn't do that. Like Jeroen3 wrote: you may get problems with EMC susceptibility. You can always choose not to place the resistor.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online zaptaTopic starter

  • Super Contributor
  • ***
  • Posts: 6289
  • Country: 00
Re: My first ARM/LPC design, critic requested.
« Reply #22 on: October 10, 2014, 09:08:42 pm »
Don't remove the usb pullup transistor. It is required to re-enumerate the USB bus after DFU is complete. And since the chip has startup time it is also used to not enable the usb bus until the chip is ready. To prevent failed enumerations.

The datasheet suggests not to use the transistor for USB power boards.



By DFU, do you mean the USB ISP functionality (that simulated disk drive with the binary image)? I shouldn't be too much trouble for users reconnecting the board after updating the firmware (for debugging I do plan to have it, along with a SWD debugger).  Does this make sense?
 

Offline paulie

  • Frequent Contributor
  • **
  • !
  • Posts: 849
  • Country: us
Re: My first ARM/LPC design, critic requested.
« Reply #23 on: October 10, 2014, 09:23:53 pm »
I can't be sure but don't think that transistor is required for virtual disk operation. Both my Ebay minimum blue and Discovery type  boards only have a jumper to enable the enumeration resistor. They always come up as a disk when it's installed and don't when it's not. My TFT touch super STM development module has an FET there but looking at the gate on a scope the signal never changes.

I'm not a USB expert but Jeroen3s explanation that it's only needed for exceptions makes sense. Not to sound like a stuck record but since we don't know exactly what's going on inside that bootloader probably safer to include questionable components because they can always be left unpopulated.
 

Offline SirNick

  • Frequent Contributor
  • **
  • Posts: 589
Re: My first ARM/LPC design, critic requested.
« Reply #24 on: October 10, 2014, 09:36:46 pm »
Ultimately, there's no difference between a transistor controlled by a SoftConnect pin, and using the SoftConnect pin as the FET pull-up directly.... when the MCU is in a known state.  But, the reason I advocate for external pull-ups and the SC FET is due to the window where the MCU doesn't yet have its wits, but may be electrically present on the USB bus, or subject to external influence in the case of the ISP / reset pull-ups.  Resistors are just so cheap...  :)

Not at all definitive, of course, just my 2c for what it's worth.

As for the bootloader USB disk mode, it would have to announce its presence on the bus somehow.  Might be interesting to see what the DP and DN pins are doing in those cases, if indeed the SC pin isn't involved.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf