-1

I am trying to select a particular companies line of ARM Cortex M microprocessors to work with for a project I want to do. Since all the companies license the architecture from ARM Holdings I am wondering how much difference there can be in the hardware between brands? I am thinking the documentation and software productivity and overall experience may be the deciding factor?

I have tried one company and their documentation was lacking! Thousands of pages of fluff about what wonderful stuff they make but very little info on how to use the things.

Mostly I am looking for good documentation. I don't need endless obsolete sample programs that don't compile and use mystery macros and functions! A line that includes a microprocessor with 2 ADC not just multiplexing channels to 1 ADC would be good but I may end up using external ADC.

Would anybody care to say what they recommend and why.

BTW: My history is programming C++, C# in MS Visual Studio for machine tool HMI as well as motion controllers.

Thanks In Advance Chris

Sean Houlihane
  • 1,698
  • 16
  • 22
Adk Chris
  • 95
  • 1
  • 1
  • 6
  • The question is **how much difference there can be in the hardware between brands?** This is not a recommendation (if you disregard the complaint about vendor documentation which is more commentary than a question). The ARM cores have specific needs from the SOC vendor, so this question has an answer. See: [ask]. – artless noise Nov 26 '18 at 17:56
  • The question I was trying to ask was: For a person who has programmed other things but is having great trouble finding information on the basic MCU specific parts of the MSP432 examples is there a company that provides better documentation. I would now modify that to: If I think I need to run a bit of code at regular intervals where would I look to find the commands or bits in registers related to clocks, counters, timers and interrupts. I have found lots of descriptions of clocks & timers but never a comprehensive listing of the commands or bits in registers to implement in code. – Adk Chris Nov 30 '18 at 21:09
  • *clock, counters, timers and interrupts* are always to achieve some end goal. I was thinking more 'Is your application battery powered?'. Does it have an LCD, audio, a touch screen? Will it be using WiFi, HSDPA, etc? These devices have certain data rates and need buses/hardware capable of servicing the devices. Battery powered is a complete system consideration. With some SOC hardware you can avoid buying external chips. For instance bar code decoding can use a timer with capture on edges to get bar lengths making a device cheaper. Also I was saying your question has merit. – artless noise Dec 04 '18 at 15:35
  • My real question was: How you go from reading vague descriptions of features to finding the details of the code to use the features? I am always inclined to focus on the sample code. I have yet to find any direct links between the line 'CS->CTL1 |= CS_CTL1_SELA_2 | CS_CTL1_DIVA_2;' and SLAU356h page 396. Searching for 'CS->CTL1' did not lead me to SLAU356h. I found nothing in SLAU356h that suggested using 'CS->CTL1' was the way to access the bits in register CSCTL1. Once I stumbled across the link it is easy to work with. But I still have not figured out how I was supposed to find this link – Adk Chris Dec 05 '18 at 19:06
  • I like the LPC series from NXP (e.g. LPC1549 -> ARM Cortex M3) because the dev-boards are arduino pinout compatible. – Traummaennlein Apr 17 '19 at 08:26
  • Wow! just looked at the NXP site. Lots of goodies I had know I idea NXP made. How to you find the documentation? – Adk Chris Apr 18 '19 at 03:52

1 Answers1

4

Most of your application has nothing to do with ARM and the cortex-m. Each chip vendor adds its own peripherals (or sometimes purchased) around the arm core. Most of your code is talking to peripherals. The processor core doesn't make the chip, the things other than the processor core make the chip.

You should be able to find a list of parts with the number of peripherals you want, independent of processor core used. While a particular chip vendor may have different uarts across their product line or different gpios, adcs, etc, you can still get a feel for a vendor without having to look at every part on that list as you narrow in.

No vendor has great docs, some do have bad docs, that is part of the exercise. All of them provide libraries, same deal nobody has great libraries, some have bad ones, but the point of the libraries is to hide the details. You need to do your homework and look at the docs, look at that code, can you live with it can you replace it or repair it, or is it better to move on to another vendor or same vendor and an alternate library.

1% of the job is writing the application the other 99% is reading docs and doing experiments to make the peripherals do what you want them to do.

Same brand or different brands with the same name of processor core doesn't mean anything with respect to portability. If you read the arm docs as you should read any of the processor core docs for whatever parts you are evaluating or choosing, you will see that even if 7 vendors have products with the cortex-m0, that core has compile time and runtime options that each vendor could choose from making either the code or the performance incompatible with other chips using a cortex-m0. But the amount of code that would port anyway is a very very small percentage of your project. Most of your project is the not-processor-core stuff.

Note ARM makes a number of cortex-m cores that are not 100% compatible with each other. If you feel the need to go with an ARM core, then narrow in on the one you want, that will narrow your choices as far as available chips goes.

Built in ADCs are there to save on chips, depending on the specs you want, accuracy or performance, you may very well end up with an external ADC which makes the specific microcontroller less important if the ADC and its specs are your primary requirement.

Software productivity, also has little to nothing to do with the processor core. The vendors are going to cobble together an IDE with a compiler and libraries because folks expect that, doesn't make any of them any good nor productive. The text editor alone goes the way of religion and politics with developers, there is no single editor or environment that is perfect for every developer, developers have their ways of doing things and some are compatible and some are not. Some developers can bend some cant. Very rarely do you have to use the tools they provide.

halfer
  • 19,824
  • 17
  • 99
  • 186
old_timer
  • 69,149
  • 8
  • 89
  • 168
  • I appreciate your time and effort. I have been buying demo boards, reading the documentation and working thru sample code from a couple of vendors and increasing levels of chip sophistication. Only after too many hours do I learn that the documentation seems to have been written by graphic artists to impress marketing people who pay by the page. It takes a while to get far enough into the documentation to get a feel for the quality of it. I am asking for the benefit of the experience of those who have gone before me and seen were the sales brochure did or didn’t pan out. – Adk Chris Nov 26 '18 at 16:47
  • You didn't say what your end application was. Does it require video, audio, ADC, accelerometer, etc. Some peripherals can take a lot of CPU power if you start bit-bashing things. Having a SPI controller instead of bit bashing SPI can be fine. See: [ARM BUS](https://stackoverflow.com/questions/28068525/explaination-of-arm-especifically-mobile-peripherals-addressing-and-bus-archit)... How a vendor hooks up peripherals is often critical. The CPUs themselves are made by ARM and they are basically all the same more or less. How the CPU accesses memory is often critical. – artless noise Nov 26 '18 at 17:53
  • End application is hard to explain. Take a 1000 or so analog readings on both of 2 ADC analyze a little and output an integer. I think ADC readings / sec biggest factor. Just moved up ARM M4 system, VERY hard time finding documentation. I have been looking to chip vendor. Should I be looking to ARM Holdings for more info? Or Keil or IAR? I was looking for info on SysTick which I found in TI sample. I found a response on the Keil site that made it look like all ARM CPU use this register? How similar is programming for various ARM M4? So little info, might be looking in wrong place? – Adk Chris Nov 27 '18 at 00:48
  • what chip did you find with no documentation? the major m4 vendors are pretty good. – old_timer Nov 27 '18 at 00:50
  • I am currently looking working thru a book on the MSP432p401R. – Adk Chris Nov 30 '18 at 15:51
  • I am currently looking at MSP432P401R. I didn't say there was not documentation I said there were HUGE gaps in in the information. There are thousands are pages of vague descriptions of wonderful features. Then some sample programs that use functions and macros that I can find no information on. For example I found the line'CS->CTL2 |= CS_CTL2_LFXT_EN;' in a sample program. I can find CS_CTL2_LFXT_EN in the header files if I already know what to search for. How would anyone know what to go searching for and that it is part of what ever register CS->CTL2 points to Where is the list of registers – Adk Chris Nov 30 '18 at 16:04
  • ti is pretty good with their documentation so I am surprised, I so far have not had any issues with the ti msp432 docs as far as bare metal programming goes. to be fair I have not used the adcs...the example problem you describe though has nothing to do with ti's documentation it has to do with someones code you are looking at and connecting the dots to the documentation, and yes particularly now with this horrible cmsis thing it is harder than it used to be,and that plague infects all (cortex-m) vendors as they feel the need to be on the cmsis bandwagon. – old_timer Nov 30 '18 at 16:15
  • Another example, I bricked a board and went looking for the factory reset function. Found tons of things pointing me to some other document. All boiled down to a couple of marginal instructions for obsolete versions of CCS. CCS8 didn't have menu items ect. that were shown in obsolete CCS screen captures. I have asked on E2E.com and answers are not helpful. Just pointed me to another site that linked back to same instructions I had said were not working. I started MCU with the Arduino and ATMEGA and the documentation was great. Is this an industry standard for the ARM Cortex MCU? – Adk Chris Nov 30 '18 at 16:22
  • Don't understand how a line of code can be the cause of not being able to find the documentation for the parts of code. If you saw this code where would you look to find info on the parts of the line? I have looked and I can't find anything that would help me know how to find a way to set the clock to a different configuration. – Adk Chris Nov 30 '18 at 16:25
  • I have programmed other things and found it pretty easy. This hardware is a little different but I don't think it is any harder. BUT the listing of the commands to use the features that I would normally refer to are not anywhere I can find! How are you supposed to go from thinking I need a timer event every 500 milliseconds to the code to make that happen? I have always looked up the timer section and found a list of commands for controlling the timer. I can't find that list of timer commands! I hate to give up but I see no way forward if I can't find the info to start with? – Adk Chris Nov 30 '18 at 16:39
  • commands for a timer? not sure what you mean by that, you write the control registers to set for count up or count down, you set the initial value and rollover/trigger values and so on per the document. just downloaded it and looked at it and as usual ti does a better job that other vendors. there are no "commands" for the timer though it is not designed that way. – old_timer Nov 30 '18 at 17:56
  • I dont have any of my msp432 launchpads handy, will have to go find one, otherwise would bang out an example for you to make one of the timers work. – old_timer Nov 30 '18 at 17:58
  • Don't need another example. I need a list of timer commands / macros / registers to understand and see how to modify the examples I have – Adk Chris Nov 30 '18 at 19:05
  • Doing book that give examples in registers (aka driverLib?) and SimpleLink. SimpleLink: “GPIO_setAsPeripheralModuleFunctionOutputPin(GPIO_PORT_PJ, GPIO_PIN3 | GPIO_PIN2, GPIO_PRIMARY_MODULE_FUNCTION);”. I am guessing the equivalent DriverLink code might be “PJ->SEL0 |= BIT2 | BIT3;” “PJ->SEL1 &= ~(BIT2 | BIT3);”. I can find some info on "GPIO_set..Pin" once I know the name. I can’t find any info on “PJ->SEL1”. I may be barking up the wrong tree. I expected to find what you seem to be describing, a list of bits in registers that control parts of the MSP432. I can’t find that list? – Adk Chris Nov 30 '18 at 22:29
  • So again the issue does not sound like it is the documentation for the device which is what you seemed to be complaining about, instead it is the code provided by the vendor and yes the code they provide is usually pretty scary when you look at it. And not documented in a way to make it usable and reliable. If you are having this issue toss all of their code and work from the documentation for the device. Ti is on the better side of this and provides more info than a number of other vendors. – old_timer Dec 01 '18 at 14:59
  • Still very confused about what you are asking, so looking at some of my simple code. First ti has a tendency to put the address map in the datasheet and the register details in another document, in this case from their website as of today the technical reference manual and the datasheet for this part are two of the four minimum you need (the other two being the arm architectural reference manual and technical reference manual). – old_timer Dec 01 '18 at 15:06
  • so for example from the datasheet I see from reading and then searching that p3.2 has an alternate function which is UCA2RXD uart 2 rx. to do that I need p1sel1 0 and p1sel0 1. Likewise for p3.3 to use the uart 2 tx function for that pin. From the memory map in the datasheet this design apparently doesnt have a separate address space for each gpio port it is all under one base of 0x40004C00. from the datasheet the offset to p3sel0 is 0x2A and p3sel1 is 0x2C. The technical reference manual from ti tells what we already expect from what we see in the datasheet and read-modify-write those – old_timer Dec 01 '18 at 15:16
  • to connect those I/O pins to the uart. From the datasheet the uart base address is found, the msp432 technical reference manual walks you through how to figure out the baud rate, etc...and you just do that. Now you have a working uart. – old_timer Dec 01 '18 at 15:21
  • I use gcc, gas, ld, have tried their tools but prefer not. YMMV. their tools are certainly not required in any way shape or form. – old_timer Dec 01 '18 at 15:22
  • even with decades of experience initializing the clock is a primary source for bricking parts. st has a pin or two to get you out of trouble and into a factory bootloader, others you should do this yourself, before even using the uart, the blink the led stuff should be discovered and then gpio or digital I/O as ti calls it inputs discovered, then make your own safety mode, if pin is high then take the code down one path and low the other. Then one path can start to mess with clocks, even if using libraries, you can get bricked...so either buy a bunch of boards/parts or build a safety net. – old_timer Dec 01 '18 at 15:25
  • the clock system for this part looks well documented in the technical reference manual. remember that 99% of baremetal is reading documentation or writing throwaway experimental code. only a small percentage of the time is writing the application. – old_timer Dec 01 '18 at 15:28
  • for the ADC the diagram shows/implies you can choose any of the clocks. as does the written documentation. ADC register addresses in the datsheet as expected. like the uart to get ADC mode you use the port select bits to switch to the desired function, documented in the datasheet. simple searches in the datasheet show this info, takes 5s to 10s of seconds to find this info. the trm documentation not only tells you which clocks you can choose from it tells you the name of the field in the register so you can search for it and not wade through the registers to find it...better than most docs – old_timer Dec 01 '18 at 15:37
  • a bunch of the other clock controls are there in CTL0. and then you go from there, experiment, read, experiment, read, experiment read. minutes/hours/days/weeks later you have it mastered...bare metal programming...ti is one of the better companies for documentation, usually atmel and st dont do as good of a job despite how well they do. To be fair though there are a few lines of code from tis library that I use as an interview question as to what is wrong with this code...and the libraries from all vendors have continued to go downhill...hopefully its just a fad. – old_timer Dec 01 '18 at 15:41
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/184577/discussion-between-adk-chris-and-old-timer). – Adk Chris Dec 02 '18 at 05:56