Some questions about the LPC810

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.

sot097-2_3d.gif

In the technical datasheet i can read this :

ARM Cortex M0+ with 4KB flash and 1KB SRAM

  • 2x USART
  • 1x I2C
  • 1x SPI
  • 4x Timers

I Want know if this chip is really able to :

  1. catch interrupt signal
  2. wait after a timer signal (in seconde)
  3. send a real AT command through an USART

For me i think that could be possible.

Did you get experience about this chip ?

Parents
  • 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.

    1. The Datasheet (LPC81xM)
    2. The User's Manual (UM10601)

    Let's see if we can find the answers you're looking for in the User's Manual...

    1. Catch an interrupt signal

    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).

    2. Waiting for a timer.

    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. */

        }

    }

    3. Sending an AT command on the UART.

    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.

Reply
  • 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.

    1. The Datasheet (LPC81xM)
    2. The User's Manual (UM10601)

    Let's see if we can find the answers you're looking for in the User's Manual...

    1. Catch an interrupt signal

    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).

    2. Waiting for a timer.

    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. */

        }

    }

    3. Sending an AT command on the UART.

    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.

Children