Cortex-M0 or Cortex-M3?

Hello!

I've worked before with Cortex-M3 on a STM32 Primer during college. Now I'm trying to develop a system and I can't decide what would be the best MCU for it...

The tasks I would need for it to perform are:

-Operate a TFT LCD screen

-Read and write to an SD card (KBytes of info)

-Control a PWM output

-Read 3 sensors (some digital and some analogic)

-Controll a dimmable light (triacs, zero-cross detection...)

-Actuate on relays and transistor switches

-Send info to a webpage via ethernet board

-PID controller (needs to do some divisions, multiplications and sums...)

All this tasks are to be preformed inside a infinte loop, but there is no need to have them working in Real Time.

Do you think that a Cortex-M0 would be good for this or do I need a more powerful microprocessor?

Also, if I start with a M0, how hard will it be to take the same code and make it work on an Cortex-M3?

Thanks!

Parents
  • Very interesting question. The M0 might be able to do it, but I think I'd pick a M3.

    High speed:

    • TFT screen: Not many M0 implementations support this, so if you are making this in software, the M0 might be a little tight.

    Low speed:

    • SD/MMC: In theory, this can be done by any chip that has SPI.
    • Control PWM output: It would be a good idea to at least use a timer here, if it needs to be accurate/fast.
    • Reading sensors.
    • Light control: External Interrupt for zero-cross detection recommended. Timer Interrupt recommended for duty-cycle.
    • Switching relays on/off through transistors.
    • Send to a Web-page: If using a SPI interface Ethernet PHY, this could be done with a M0.
    • PID controller: Multiplication takes 32 clock cycles per instruction on some M0 implementations.

    You do not mention any size requirements, so I assume a LQFP144 or LQFP208 package would be OK.

    Summing it up: If you needed 3 or fewer of these functions, the M0 would probably be an excellent choice.

    But since you're going to stuff all the different functions into the same chip, it might be difficult to fit it all in there at the same time, while keeping the code maintainable. I'm not saying it can't be done, just that it might be a little difficult.

    On the other hand, if you choose a M3, your job gets easier and the operations can be done faster as well.

    If you are coding in assembly language, you'd get the mla and mls instructions, which could be useful for PID.

    Many M3 implementations have support for both SD/MMC and LCD/TFT. As I've been using the LPC series, those are the ones I know the best.

    I recommend you to take a look at the LPC1788. They have support for Ethernet, LCD, SD/MMC, 4 timers (could be used for PWM), motor control (could be used for PWM). The cost is low and the microcontrollers support speeds up to 120MHz (and single-cycle I/O access).

    They come in different packages, including a LQFP144, which can be hand-soldered on a low-cost eBay adapter for prototyping, if you have a good soldering station.

    NXP also makes a LPC4088, which you may find interesting; it features a M4 instead of M3.

    Be sure you choose a package, where you can use all the required features simultaneously.

    A few examples on development boards that you might find interesting: Olimex MOD-LCD4.3 and Open1788.

    Please know that although I'm suggesting this particular microcontroller, it doesn't mean that it's the best possible choice; it does mean that it would be able to do the job at a reasonable cost and that it's fairly easy to work with as well.

Reply
  • Very interesting question. The M0 might be able to do it, but I think I'd pick a M3.

    High speed:

    • TFT screen: Not many M0 implementations support this, so if you are making this in software, the M0 might be a little tight.

    Low speed:

    • SD/MMC: In theory, this can be done by any chip that has SPI.
    • Control PWM output: It would be a good idea to at least use a timer here, if it needs to be accurate/fast.
    • Reading sensors.
    • Light control: External Interrupt for zero-cross detection recommended. Timer Interrupt recommended for duty-cycle.
    • Switching relays on/off through transistors.
    • Send to a Web-page: If using a SPI interface Ethernet PHY, this could be done with a M0.
    • PID controller: Multiplication takes 32 clock cycles per instruction on some M0 implementations.

    You do not mention any size requirements, so I assume a LQFP144 or LQFP208 package would be OK.

    Summing it up: If you needed 3 or fewer of these functions, the M0 would probably be an excellent choice.

    But since you're going to stuff all the different functions into the same chip, it might be difficult to fit it all in there at the same time, while keeping the code maintainable. I'm not saying it can't be done, just that it might be a little difficult.

    On the other hand, if you choose a M3, your job gets easier and the operations can be done faster as well.

    If you are coding in assembly language, you'd get the mla and mls instructions, which could be useful for PID.

    Many M3 implementations have support for both SD/MMC and LCD/TFT. As I've been using the LPC series, those are the ones I know the best.

    I recommend you to take a look at the LPC1788. They have support for Ethernet, LCD, SD/MMC, 4 timers (could be used for PWM), motor control (could be used for PWM). The cost is low and the microcontrollers support speeds up to 120MHz (and single-cycle I/O access).

    They come in different packages, including a LQFP144, which can be hand-soldered on a low-cost eBay adapter for prototyping, if you have a good soldering station.

    NXP also makes a LPC4088, which you may find interesting; it features a M4 instead of M3.

    Be sure you choose a package, where you can use all the required features simultaneously.

    A few examples on development boards that you might find interesting: Olimex MOD-LCD4.3 and Open1788.

    Please know that although I'm suggesting this particular microcontroller, it doesn't mean that it's the best possible choice; it does mean that it would be able to do the job at a reasonable cost and that it's fairly easy to work with as well.

Children
More questions in this forum