Author Topic: Moving into 32-bit MCU  (Read 26644 times)

0 Members and 1 Guest are viewing this topic.

Offline MAntunesTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: pt
Moving into 32-bit MCU
« on: May 20, 2017, 10:58:09 pm »
Hi guys!
I've been using the PIC24FV16KM202 with the Microstick dev-board for all my school and personal projects for a while, but I would like to learn something new and move to a 32-bit MCU.

The natural flow of thing would be to move on to a PIC32, but I would like to have your opinion on this.

I've been searching for a while and what I would like is:
 - ease of setup/programming;
 - relatively cheap dev-board (I don't care about Arduino headers or similar);
 - the more peripherals the better, and easy to use.

I do mostly control stuff.

I've been searching and came across a lot of brands/series:
 - STM32
 - PIC32MX
 - Atmel SAM
 - NXP LPC

Which do you think will be the best the best bet? What are the pros and cons of each one?

Thank you!
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3137
  • Country: ca
Re: Moving into 32-bit MCU
« Reply #2 on: May 20, 2017, 11:33:18 pm »
Your Microstick may support some of the small PIC32 as well. Look at the docs.

If you program in C, it won't be much different. 32-bit MCUs typically require more setup, but the compiler/IDE will absorb most of it.
 

Offline MAntunesTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: pt
Re: Moving into 32-bit MCU
« Reply #3 on: May 20, 2017, 11:54:08 pm »
Your Microstick may support some of the small PIC32 as well. Look at the docs.

If you program in C, it won't be much different. 32-bit MCUs typically require more setup, but the compiler/IDE will absorb most of it.
Unfortunatly not, my Microstick is this one: http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=DM240013-2
So I'd have to get another dev-board like the Microstick II.
And yes, I program in C.

Wanna the most flexible device on 32 bit?

http://www.cypress.com/documentation/development-kitsboards/cy8ckit-043-psoc-4-m-series-prototyping-kit

https://www.youtube.com/user/CypressSemi/videos

I thought about PSoC also. But would it be the best bet to learn about MCUs and their peripherals?
Their IDE, being mostly graphical, seems to make everything too simple (?). And if I needed to work with another MCU, at work/school, I would have to learn everything again.
That's only my opinion and I may be wrong.

Also, I'd like to know if there are any good tutorials/books about these MCUs (the ones I mentioned in my first post).
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Moving into 32-bit MCU
« Reply #4 on: May 21, 2017, 01:20:54 am »
Your Microstick may support some of the small PIC32 as well. Look at the docs.

If you program in C, it won't be much different. 32-bit MCUs typically require more setup, but the compiler/IDE will absorb most of it.
Unfortunatly not, my Microstick is this one: http://www.microchip.com/Developmenttools/ProductDetails.aspx?PartNO=DM240013-2
So I'd have to get another dev-board like the Microstick II.
And yes, I program in C.

Wanna the most flexible device on 32 bit?

http://www.cypress.com/documentation/development-kitsboards/cy8ckit-043-psoc-4-m-series-prototyping-kit

https://www.youtube.com/user/CypressSemi/videos

I thought about PSoC also. But would it be the best bet to learn about MCUs and their peripherals?
Their IDE, being mostly graphical, seems to make everything too simple (?). And if I needed to work with another MCU, at work/school, I would have to learn everything again.
That's only my opinion and I may be wrong.

Also, I'd like to know if there are any good tutorials/books about these MCUs (the ones I mentioned in my first post).

You setup the logic and analog peripherals in a graphical manner, but you still have to actually write code and program the ARM portion. That's the same as any other ARM MCU.

You don't even need to use Cypress' software to do that, if you don't want to; you can download any ARM toolchain and IDE you want, in fact PSoC Creator is using gcc-arm-eabi-none as the backend compiler, which is pretty much the standard. Also, their IDE is pretty good in and of itself.

Basically the "Schematic Editor" portion of PSoC Creator is used to setup and wire together the flexible analog (op-amps, ADCs, DACs, filters, etc.), logic (and/or/xor/not/flip-flops, etc.), communication blocks (SPI, UART, I2C, etc.), clocks and I/O pins.

Once everything is wired together you write code, program and debug in the same software, outside of the Schematic Editor mode. So in that regard it's just like any other IDE and compiler.

So yes, setting up and wiring together the peripherals is easier than most MCUs, but code is code.

Also, every MCU has a different set of peripherals anyway. A Cortex M4 part from ST will have a completely different memory map and set of registers than one from TI with the same CM4 core. (TI, NXP, Cypress, ST, etc. all buy the same IP from ARM, that is the MCU core itself, then they add their own set of peripherals; that's what makes each part from each vendor unique.)

So you'll always have to learn new stuff when moving between vendors; that knowledge is never portable.
« Last Edit: May 21, 2017, 01:32:00 am by timb »
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 2153
  • Country: gb
Re: Moving into 32-bit MCU
« Reply #5 on: May 21, 2017, 01:29:19 am »
look at the ST NUCLEO stuff = specially the 144 series.

you can get a 200MHz+ F746 for about 25Euro's with 144pins and ethernet and USB-OTG complete with a USB ST-LINK programmer on the board.
i dont think that can be bettered!
http://www.carminenoviello.com/2016/01/22/getting-started-stm32-nucleo-f746zg/
 8)
 

Offline MAntunesTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: pt
Re: Moving into 32-bit MCU
« Reply #6 on: May 21, 2017, 11:30:19 am »
look at the ST NUCLEO stuff = specially the 144 series.

you can get a 200MHz+ F746 for about 25Euro's with 144pins and ethernet and USB-OTG complete with a USB ST-LINK programmer on the board.
i dont think that can be bettered!
http://www.carminenoviello.com/2016/01/22/getting-started-stm32-nucleo-f746zg/
 8)


Yes, I've looked at the STM Nucleo boards, especially at the smaller ones, that you can put on a breadboard. I don't really need the power of a Cortex M7, a M0+ would really be enough for what I do right now.
But STM has me somewhat devided. The parts are cheap (so are the dev-boards) but for what I have read, they are less straight forward to program.

Does anyone know how does STM compare to NXP or Atmel SAM in terms of ease of programming?



You setup the logic and analog peripherals in a graphical manner, but you still have to actually write code and program the ARM portion. That's the same as any other ARM MCU.

You don't even need to use Cypress' software to do that, if you don't want to; you can download any ARM toolchain and IDE you want, in fact PSoC Creator is using gcc-arm-eabi-none as the backend compiler, which is pretty much the standard. Also, their IDE is pretty good in and of itself.

Basically the "Schematic Editor" portion of PSoC Creator is used to setup and wire together the flexible analog (op-amps, ADCs, DACs, filters, etc.), logic (and/or/xor/not/flip-flops, etc.), communication blocks (SPI, UART, I2C, etc.), clocks and I/O pins.

Once everything is wired together you write code, program and debug in the same software, outside of the Schematic Editor mode. So in that regard it's just like any other IDE and compiler.

So yes, setting up and wiring together the peripherals is easier than most MCUs, but code is code.

Also, every MCU has a different set of peripherals anyway. A Cortex M4 part from ST will have a completely different memory map and set of registers than one from TI with the same CM4 core. (TI, NXP, Cypress, ST, etc. all buy the same IP from ARM, that is the MCU core itself, then they add their own set of peripherals; that's what makes each part from each vendor unique.)

So you'll always have to learn new stuff when moving between vendors; that knowledge is never portable.

OK, I think I understand you.
So what would you recomend to a "beginner"?
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 2153
  • Country: gb
Re: Moving into 32-bit MCU
« Reply #7 on: May 21, 2017, 12:41:56 pm »
when you say "ease of programming", do you mean writing the code, or uploading to the device?

http://electronut.in/stm32-start/
 

Offline MAntunesTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: pt
Re: Moving into 32-bit MCU
« Reply #8 on: May 21, 2017, 01:08:11 pm »
when you say "ease of programming", do you mean writing the code, or uploading to the device?

http://electronut.in/stm32-start/

Actually both, but mainly writing the code.
When I search for STM32 programing it all seems very confusing due to all the aproaches you have (Standard Peripheral Library, CubeMX, etc).
 

Offline timb

  • Super Contributor
  • ***
  • Posts: 2536
  • Country: us
  • Pretentiously Posting Polysyllabic Prose
    • timb.us
Re: Moving into 32-bit MCU
« Reply #9 on: May 21, 2017, 01:32:24 pm »
look at the ST NUCLEO stuff = specially the 144 series.

you can get a 200MHz+ F746 for about 25Euro's with 144pins and ethernet and USB-OTG complete with a USB ST-LINK programmer on the board.
i dont think that can be bettered!
http://www.carminenoviello.com/2016/01/22/getting-started-stm32-nucleo-f746zg/
 8)


Yes, I've looked at the STM Nucleo boards, especially at the smaller ones, that you can put on a breadboard. I don't really need the power of a Cortex M7, a M0+ would really be enough for what I do right now.
But STM has me somewhat devided. The parts are cheap (so are the dev-boards) but for what I have read, they are less straight forward to program.

Does anyone know how does STM compare to NXP or Atmel SAM in terms of ease of programming?



You setup the logic and analog peripherals in a graphical manner, but you still have to actually write code and program the ARM portion. That's the same as any other ARM MCU.

You don't even need to use Cypress' software to do that, if you don't want to; you can download any ARM toolchain and IDE you want, in fact PSoC Creator is using gcc-arm-eabi-none as the backend compiler, which is pretty much the standard. Also, their IDE is pretty good in and of itself.

Basically the "Schematic Editor" portion of PSoC Creator is used to setup and wire together the flexible analog (op-amps, ADCs, DACs, filters, etc.), logic (and/or/xor/not/flip-flops, etc.), communication blocks (SPI, UART, I2C, etc.), clocks and I/O pins.

Once everything is wired together you write code, program and debug in the same software, outside of the Schematic Editor mode. So in that regard it's just like any other IDE and compiler.

So yes, setting up and wiring together the peripherals is easier than most MCUs, but code is code.

Also, every MCU has a different set of peripherals anyway. A Cortex M4 part from ST will have a completely different memory map and set of registers than one from TI with the same CM4 core. (TI, NXP, Cypress, ST, etc. all buy the same IP from ARM, that is the MCU core itself, then they add their own set of peripherals; that's what makes each part from each vendor unique.)

So you'll always have to learn new stuff when moving between vendors; that knowledge is never portable.

OK, I think I understand you.
So what would you recomend to a "beginner"?

The PSoC is a good place to start for any skill level I think. Their driver library is very easy to use and all the components have full documentation (on PDF no less) showing you what all the code functions do along with how to setup the components themselves in the schematic view.

I'd recommend picking up the $10 PSoC 5LP kit to start with. It's their high end chip, which can plug right into a breadboard and includes a little USB programming dongle. It might just be the best deal going right now, in terms of dev kits.

I can also recommend TI's LaunchPad line of boards as a very good value; their hardware is very easy to use, too. Look at the Tiva C LaunchPad if you want speed (it's a Cortex-M4) and the MSP432 for low power (it's a CM0).
Any sufficiently advanced technology is indistinguishable from magic; e.g., Cheez Whiz, Hot Dogs and RF.
 

Offline Syntax_Error

  • Regular Contributor
  • *
  • Posts: 204
  • Country: us
Re: Moving into 32-bit MCU
« Reply #10 on: May 21, 2017, 08:33:22 pm »
Check these out:

https://www.youtube.com/playlist?list=PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM

Videos use the TI Stellaris/TivaC Launch Pad board with ARM Cortex M4F. The videos are very informative.
« Last Edit: May 21, 2017, 08:37:26 pm by Syntax_Error »
It's perfectly acceptable to not know something in the short term. To continue to not know over the long term is just laziness.
 

Offline daflory

  • Contributor
  • Posts: 16
  • Country: us
Re: Moving into 32-bit MCU
« Reply #11 on: May 21, 2017, 08:51:05 pm »
If you're already using MPLABX and the PIC24, then the PIC32 would be the easiest. You already have the tools and know how to use them; at most you'd just need to download the PIC32 compiler.
I have not found the PIC32 to be harder to get started with (at the blinking LED level) than the other PIC's. Of course the PIC32 has tons of complex features but learning to use those is not obligatory and is just a matter of studying the data sheets and programming guide.

Microchip has a nice selection of inexpensive PIC32 dev boards on their MicrochipDirect online store. If you are a student with an .edu email you can get 25% off last time I checked.
« Last Edit: May 21, 2017, 09:02:10 pm by daflory »
 

Offline MAntunesTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: pt
Re: Moving into 32-bit MCU
« Reply #12 on: May 21, 2017, 09:42:57 pm »
Check these out:

https://www.youtube.com/playlist?list=PLPW8O6W-1chwyTzI3BHwBLbGQoPFxPAPM

Videos use the TI Stellaris/TivaC Launch Pad board with ARM Cortex M4F. The videos are very informative.

Thank you very much. Will give them a look!

The PSoC is a good place to start for any skill level I think. Their driver library is very easy to use and all the components have full documentation (on PDF no less) showing you what all the code functions do along with how to setup the components themselves in the schematic view.

I'd recommend picking up the $10 PSoC 5LP kit to start with. It's their high end chip, which can plug right into a breadboard and includes a little USB programming dongle. It might just be the best deal going right now, in terms of dev kits.

I can also recommend TI's LaunchPad line of boards as a very good value; their hardware is very easy to use, too. Look at the Tiva C LaunchPad if you want speed (it's a Cortex-M4) and the MSP432 for low power (it's a CM0).

Thank you very much! Will give that PSoC board a look! It certainly looks cheap for what it offers!


If you're already using MPLABX and the PIC24, then the PIC32 would be the easiest. You already have the tools and know how to use them; at most you'd just need to download the PIC32 compiler.
I have not found the PIC32 to be harder to get started with (at the blinking LED level) than the other PIC's. Of course the PIC32 has tons of complex features but learning to use those is not obligatory and is just a matter of studying the data sheets and programming guide.

Microchip has a nice selection of inexpensive PIC32 dev boards on their MicrochipDirect online store. If you are a student with an .edu email you can get 25% off last time I checked.

Thank you for your opinion! I have to search a bit about the several PIC32 series (MX, MZ, MM, MK).

Any other opinion is more than welcome.
 

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: us
Re: Moving into 32-bit MCU
« Reply #13 on: May 22, 2017, 05:28:05 pm »
Lots of the info you find on ST is old info, so be careful what you read. With cubemx, it is actually not a horrible platform for a beginner. You still need to dig deep (for example, getting PWM out to work out the box is not that straight forward and they have the worst I2C examples I have ever seen). No matter which platform you choose, you are going to hit a wall at some point and you will need help. That is just how it is.

The one thing I will say is that everyone is pushing towards a HAL and trying to ditch the standard libs. That is sort of the trend at the moment. For example, ST has ditched the standard lib and now has a low level lib in their place, which is essentially just the standard lib rewritten in some cases, but they still want you to use the HAL. Go figure. 
 

Offline stj

  • Super Contributor
  • ***
  • Posts: 2153
  • Country: gb
Re: Moving into 32-bit MCU
« Reply #14 on: May 22, 2017, 05:31:27 pm »
quick question:
what programming language do you use?
 

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 324
  • Country: us
Re: Moving into 32-bit MCU
« Reply #15 on: May 22, 2017, 05:42:12 pm »
C
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3137
  • Country: ca
Re: Moving into 32-bit MCU
« Reply #16 on: May 22, 2017, 06:05:56 pm »
Thank you for your opinion! I have to search a bit about the several PIC32 series (MX, MZ, MM, MK).

MX is, sort of, a base model. They have a little bit older MK-4 core and there's a big variety - different sizes and different periphery specializing at USB, Ethernet, CAN etc.

MZ is a performance chip. Can run at 250 MHz. It has FPU, DSP and core which can use MicroMips. But, IMHO, the CPU runs faster than periphery can handle. It still has very nice performance features such as 3 MHz ADCs, high speed USB etc.

MM is more like PIC16 with 32-bit MicroMips core. The most practical one unless you want lots of memory (such as for Graphics) or speed.

MK is very new, just released. I haven't seen it yet. But it has MicroMips and DSP, double USB, and I think the set of periphery is better than in MX.
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: Moving into 32-bit MCU
« Reply #17 on: May 22, 2017, 06:31:12 pm »
MSP432 is a decent choice if you don't need hundreds of MHz or USB.  The launchpad is cheap, TI provides examples showing how to use basically all of its peripherals, and it can be programmed using open source tools (gcc, make, etc.) on Mac, Linux, or Windows.  No IDEs or special programming environments necessary.
 

Offline carljrb

  • Contributor
  • Posts: 24
  • Country: ca
Re: Moving into 32-bit MCU
« Reply #18 on: May 22, 2017, 11:56:11 pm »
and the MSP432 for low power (it's a CM0).
The MSP432 is actually a Cortex M4F part, just like the Tiva C. It's a low power oriented part, like the classic MSP430 series. Whereas Tiva is the high performance, "full featured" option (higher clock speeds, more memory, peripherals like USB OTG, CAN, etc). There's a very limited selection of MSP432 MCUs (2 models total), whereas digikey lists nearly 300 different TM4C parts.

The price difference between both dev boards (MSP-EXP432P401R and EK-TM4C123GXL) is pennies, so one might as well pick the better suited part. Otherwise, it's the same dev tools (free as in beer CCS or whatever you prefer), good libs (MSPWare or TivaWare), same decent RTOS (TI-RTOS or many 3rd party options), etc. It really comes down to low power vs performance/features.

Edit: if you can afford the $30, the EK-TM4C1294XL is a very nice board, especially after soldering the CLP headers on the side. The NUCLEO-F767ZI from ST Micro looks quite nice too (about $5 more but for a Cortex M7 part) but I didn't get to try it.
« Last Edit: May 23, 2017, 12:01:46 am by carljrb »
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Moving into 32-bit MCU
« Reply #19 on: May 23, 2017, 06:05:52 am »
MZ is a performance chip. Can run at 250 MHz. It has FPU, DSP and core which can use MicroMips. But, IMHO, the CPU runs faster than periphery can handle. It still has very nice performance features such as 3 MHz ADCs, high speed USB etc.
PIC32MZ even got a MMU onboard and can run full-blown Linux. It is more likely that it would be smarter to use PIC32MZ as a MCU, couple it with some PSRAM and SPI NOR Flash, load U-Boot into the Flash (Microchip should default to this) and launch a Linux kernel from there.
 

Online JPortici

  • Super Contributor
  • ***
  • Posts: 3452
  • Country: it
Re: Moving into 32-bit MCU
« Reply #20 on: May 23, 2017, 06:23:44 am »
All those multi 100 mhz chip runs much faster than the peripherals, the high speed is just there to crunch numbers.
Re: new parts It's been about a year but "soon" 32MZ DA with display controller should come out. that is going to be interesting. Anyway, page is up and everything. still no datasheet
Also, there is the pic32wk (which is inside microchip's wifi modules) you can find a datasheet but no product page

MK is for industrial stuff (which is great!!) even though i could see myself use one for our automotive modules (4x CAN and a crapton of timers, IC and PWM, which our current dspics of choice lacks)
in this case i am thankful that the core speed is that higher than the peripherals so that everything can be in order before the next operation

Sadly, no high speed (sub ns resolution) pwm like in one of the aforementioned dspic (this is an if-only moment, just like if only the mx had 12 bit adc)
datasheet is there http://www.microchip.com/design-centers/32-bit/architecture/pic32mk-family
yeah, seems like the peripherals are better,
 pic24 : pic32mx = dspic : pic32mz/mk

Keep in mind that these high speed mcus also have caches, which may give unexpected results in first projects.
then i suggest you set up your projects + clock tree with harmony so that you have the startup code ready and then give it the middle finger and access the peripherals directly if you can
this at least is what i'm doing, because i'm not expert enough in pic32 to write my own startup code yet (i've only played with them so far, nothing for work)

unfortunately these new cores are very pricey, i don't know how much it's worth it to use them instead of arm counterparts
though arms with all those peripherals, M4F/M7 core are not being sold for peanuts either
 

Offline technix

  • Super Contributor
  • ***
  • Posts: 3507
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: Moving into 32-bit MCU
« Reply #21 on: May 23, 2017, 06:55:46 am »
All those multi 100 mhz chip runs much faster than the peripherals, the high speed is just there to crunch numbers.
Re: new parts It's been about a year but "soon" 32MZ DA with display controller should come out. that is going to be interesting. Anyway, page is up and everything. still no datasheet
Also, there is the pic32wk (which is inside microchip's wifi modules) you can find a datasheet but no product page

MK is for industrial stuff (which is great!!) even though i could see myself use one for our automotive modules (4x CAN and a crapton of timers, IC and PWM, which our current dspics of choice lacks)
in this case i am thankful that the core speed is that higher than the peripherals so that everything can be in order before the next operation

Sadly, no high speed (sub ns resolution) pwm like in one of the aforementioned dspic (this is an if-only moment, just like if only the mx had 12 bit adc)
datasheet is there http://www.microchip.com/design-centers/32-bit/architecture/pic32mk-family
yeah, seems like the peripherals are better,
 pic24 : pic32mx = dspic : pic32mz/mk

Keep in mind that these high speed mcus also have caches, which may give unexpected results in first projects.
then i suggest you set up your projects + clock tree with harmony so that you have the startup code ready and then give it the middle finger and access the peripherals directly if you can
this at least is what i'm doing, because i'm not expert enough in pic32 to write my own startup code yet (i've only played with them so far, nothing for work)

unfortunately these new cores are very pricey, i don't know how much it's worth it to use them instead of arm counterparts
though arms with all those peripherals, M4F/M7 core are not being sold for peanuts either
I really would rather see a SDRAM and NAND controller on PIC32MZ DA EBI along with the LCD controller. With LCD controller (and thus a framebuffer) it makes so much more sense to run Linux on this thing. Or at least a PIC32MZ DA MCM chip that connects the SDRAM and NAND controller internally to a SDRAM and a MLC NAND dice (and what was the EBI pins only capable of functioning as LCD interface.) If such an MCM chip can be priced within $5 it can give Raspberry Pi 0 a run for its money.
 

Offline MAntunesTopic starter

  • Regular Contributor
  • *
  • Posts: 99
  • Country: pt
Re: Moving into 32-bit MCU
« Reply #22 on: June 12, 2017, 10:19:42 pm »
Sorry for answering so late.
So, I've decided to go for PIC32...
Just have to choose the line. All of them have curiosity boards except for MK...
Which one would you go for?
 

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1662
  • Country: us
Re: Moving into 32-bit MCU
« Reply #23 on: June 12, 2017, 10:47:07 pm »
Sorry for answering so late.
So, I've decided to go for PIC32...
Just have to choose the line. All of them have curiosity boards except for MK...
Which one would you go for?

MX. It's the most mature.
Complexity is the number-one enemy of high-quality code.
 

Offline ebclr

  • Super Contributor
  • ***
  • Posts: 2328
  • Country: 00
Re: Moving into 32-bit MCU
« Reply #24 on: June 13, 2017, 05:02:56 am »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf