Hi the experts,
I'm not sure but i think that chip can realy help myself in my actual projet. i wanna get precisions about this chip.
In the technical datasheet i can read this :
ARM Cortex M0+ with 4KB flash and 1KB SRAM
I Want know if this chip is really able to :
For me i think that could be possible.
Did you get experience about this chip ?
I've worked a little with LPC812 myself, but LPC810 is very similar, the only real difference is the number of pins available.
First of all, there are two PDF files you will want to download.
Let's see if we can find the answers you're looking for in the User's Manual...
I assume that you want a pin-interrupt here. If so, see UM10601, chapter 8, "Pin interrupts/pattern match engine"
This chapter tells us that the feature is available on all LPC8xx parts, and that up to 8 pins can be connected to this feature (providing your device has 8 I/O pins of course).
It also tells us that we can choose between level-sensitive and edge-sensitive pin interrupts. In addition to this, an enhancement has been added, so that the hardware can recognize bit patterns for you if you wish (that's a real cool feature).
This can be done using the WFI instruction in assembly language. If you use C, you can use the supplied CMSIS macro __WFI(), which will make this transparent for you.
To implement this, pick a timer you like. Set it up to generate an interrupt, when it wraps (also called 'when it overflows'). You can supply an empty Interrupt Service Routine, if you wish, but you can also make the interrupt-service routine increment a counter, so you can see that the interrupt actually occurred. This is probably what you would like to do. So in your main loop, you would have something like...
while(1){
__WFI();
/* an interrupt just occurred, let's see if our counter has been updated. Note: it's possible that other interrupts than timer interrupts just occurred. */
oldCounter = counter;
counter = sCounterValue;
if(oldCounter != counter)
{
/* indeed,our counter changed, this is great, we can now do what we wish to do periodically. */
}
This requires two wires: GND and TxD, thus a single UART pin would be enough.
However, you may even be able to also set up an RxD pin, in order to receive a response, so you can check if you'd need to send other commands.
To interface correctly with RS232, you will need a level-converter, otherwise you'll fry your LPC810, and you don't want that to happen. The most well-known level converter is called Max232 - Tayda sells two for $1, and it comes in all kinds of shapes from all kinds of vendors. It requires a bunch of capacitors, but a DIP version can be used with a breadboard.
You'll also be able to find some low-cost ready-to-use modules on eBay, for instance this one or this one.
For the UART to send the AT commands, you'll need to set the baud rate to a valid value. For low baud rates, I believe the internal RC oscillator would be sufficient, but if you need higher baud rates, you'll probably need an external crystal, as the higher baud rates require more accuracy / precision.
Since the LPC810 has very few pins, you'll have to make sure that you can still program the device, once everything is set up.
So you will need to be careful that the /RESET pin is not pulled low. Also it's important that SWCLK and SWDIO is not forced low or high.
To keep the /RESET pin high, you can also add a 4K7 ... 10K pull-up there. For better stability, you can add a 100nF capacitor from /RESET to GND.
If you read section 21.4 in UM10601, you will find that there is a pin, which can make the microcontroller run the bootloader when it's reset.
Thus if you're going to use a push-button (eg. a switch) in your design, it would be a good idea to place the push-button on PIO0_1.
To do so, place a 10K pull-up resistor from VCC to PIO0_1. Connect PIO0_1 directly to the output of your switch. Connect the input of your switch to GND.
That means: When the switch is not held down, the pin will get pulled high (to VCC), and when the switch is pushed, it will be pulled low (to GND).
If we continue reading in section 21.4, NXP also mentions what pins they use for the bootloader. Since you're going to add a UART, it would probably be a good idea to use the same pins, so you can flash-program the device via the UART if you need to. So I recommend using PIO0_0 (pin 8, RxD) and PIO0_4 (pin 2, TxD) for the UART.
Perhaps you need to use the PIO0_3 (SWCLK) and PIO0_2 (SWDIO) pins as well. To be able to In-Circuit program the device, I believe it would be a good idea to add a 560 Ohm resistor between the SWD programmer and the SWCLK pin. Also a 560 Ohm resistor between the SWD programmer and the SWDIO pin. This makes sure that the SWD programmer is not damaged if you have the LPC810 pulling the pins high/low while it's running your firmware.
From the PIO0_3 to your other hardware, you can add a 1K Ohm resistor. Same about PIO0_2.
The 560 Ohm resistors are just rough guesses. If you have problems programming via SWD, keep the 560 Ohm as they are and try changing the 1K resistors to weaker resitors, such as 1K8 or 2K2.
I think that should get you stated without too much trouble.
Hi Jens,
I had already noted the fact of using the PIO0_4 for the UART TX .
Thank you for the warning about the risk of electrical overvoltage on the RS232 modem, but it will not be in my case of modem, but rather a module so I'm already protected against this risk. But I will watch anyway to monitor my electric tensions .
In my case PIO0_1 will be use to external interrupt signal capture.
If I understand what you say. Normally like i have no significant adjustment to make on the chip after her configuration. I concerve the freedom of using GPIO like i want?
If necessary I could reprogram the entire chip .
Also thank you for all this good details (explainations about electronic components).
I will keep you informed
I'm recommending the In-Circuit programming, because while developing, one will need to program the chip a couple of times, as it's rare to get everything 100% correct the first time. -But I'm not saying that's not the case for you; that's just how it is for me.
-But yes, you can use the GPIOs as you want, I just recommend that you keep the boot-pin pulled high, otherwise your program won't start up.
It might also be a good idea to keep the /RESET pulled up, at least until you change its configuration.
(some devices allow you to change the behaviour of the RESET pin permanently, I do not remember if this is the case for the LPC810).
Since it's a DIP, you can of course just program it in a breadboard or a ZIF socket and then insert it into the circuit.
My program will be very very simple so I will not have 50x modifications on the program.
And that's also what I had planned to do for the RESET, never be too careful .
And for the rest I always test on breadboard , it's easier
I fully agree with you on all points.
-Remember to post some status updates on your progress.