Author Topic: i'm starting to learn arm cortex-m  (Read 1416 times)

0 Members and 1 Guest are viewing this topic.

Offline saeed.GHTopic starter

  • Newbie
  • Posts: 4
  • Country: us
i'm starting to learn arm cortex-m
« on: August 24, 2017, 07:30:07 am »
what way is better for start learn ARM cortex-m ?
what  language is better c or c++ ?
 

Online Mechatrommer

  • Super Contributor
  • ***
  • Posts: 11640
  • Country: my
  • reassessing directives...
Re: i'm starting to learn arm cortex-m
« Reply #1 on: August 24, 2017, 08:25:24 am »
what way is better for start learn ARM cortex-m ?
what  language is better c or c++ ?
english or english :palm: kidding. what is better? yes either c or c++ ... but of course you will see some avionics guys chiming in ;D no pun intended...
Nature: Evolution and the Illusion of Randomness (Stephen L. Talbott): Its now indisputable that... organisms “expertise” contextualizes its genome, and its nonsense to say that these powers are under the control of the genome being contextualized - Barbara McClintock
 

Offline saeed.GHTopic starter

  • Newbie
  • Posts: 4
  • Country: us
Re: i'm starting to learn arm cortex-m
« Reply #2 on: August 24, 2017, 08:29:17 am »
I am a newbie.
please help me.
 

Offline abraxa

  • Frequent Contributor
  • **
  • Posts: 377
  • Country: de
  • Sigrok associate
Re: i'm starting to learn arm cortex-m
« Reply #3 on: August 24, 2017, 09:42:23 am »
How old are you, Saeed?
 
The following users thanked this post: stmdude

Offline stmdude

  • Frequent Contributor
  • **
  • Posts: 479
  • Country: se
Re: i'm starting to learn arm cortex-m
« Reply #4 on: August 24, 2017, 09:56:32 am »
When you're starting out, you should use the language that _you_ are most knowledgeable in first, as long as it will work at all on an MCU.

Once you've gotten things working, you can switch languages to fit your needs (performance, power, code-size, etc, etc), but when you're _just_ starting out, your main objective is to get something working, and you don't need an extra hurdle to achieve that goal by using a language that you're not comfortable in.

 
The following users thanked this post: saeed.GH

Offline LabRat

  • Contributor
  • Posts: 15
  • Country: gb
Re: i'm starting to learn arm cortex-m
« Reply #5 on: August 24, 2017, 10:06:34 am »
Hi Saeed,

I had similar queries when I started out in Cortex-M programming.  Not so much a question of "better" but what would fit best into what I was trying to achieve.
C is almost an exact subset of C++ and so you generally get a bigger toolset with C++.  If you have experienced functional or object oriented programming in the past this may also push you towards C or C++ respectively.
Most embedded programmers use C and as such the bulk of embedded code is written in C.  Some sources will talk about C++ compilers not being as optimised as C compilers but from what I understand this is not really the case.
It may also depend on what development environment you wish to use.  MBED is great for beginners and many of the libraries are written in C++ so would be easier to follow and use if you understood what was happening from a language perspective.  I'm just getting my head round Eclipse (a different IDE with ARM plugins) at the moment.

I plumped for C++ as I was more comfortable with object oriented design, wanted to start with MBED (though you can write code on MBED with C) and as I code for myself had free choice.

Hope this helps.
 
The following users thanked this post: saeed.GH

Offline metRo_

  • Regular Contributor
  • *
  • Posts: 90
  • Country: pt
Re: i'm starting to learn arm cortex-m
« Reply #6 on: August 24, 2017, 12:07:31 pm »
 
The following users thanked this post: chris_leyson, saeed.GH

Offline chris_leyson

  • Super Contributor
  • ***
  • Posts: 1541
  • Country: wales
Re: i'm starting to learn arm cortex-m
« Reply #7 on: August 24, 2017, 12:22:00 pm »
I've been playing with a few Arm Cortex-M processors just out of curiosity while I'm between jobs, need to move on from Microchip PICs. I would say pick whatever language you are most comfortable with, in my case it's C because I'm not an embedded software guy but I can see the advantages of C++.
NXPs MBED is cheap and easy to get started with but lacks debugging. BTW NXP have recently released MCUxpresso tool suite with support for Kinetis processors.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: i'm starting to learn arm cortex-m
« Reply #8 on: August 24, 2017, 12:26:47 pm »
Step 1: choose your microcontroller, the major difference between manufacturers is in the peripherals not in the arm core.
Step 2: choose or get the IDE belonging to the choosen microcontroller and its HAL software
Step 3: See which language the software is written (>80% chance on C).

So you are asking about step 3 which language you should start, that IMO is opposite to the direction you should follow.  :)
 
The following users thanked this post: saeed.GH

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: i'm starting to learn arm cortex-m
« Reply #9 on: August 25, 2017, 11:11:52 am »
Consider PSOC, tools, compiler free.

For me what stands out is -

1) Routability
2) Fast 12 bit SAR A/D and slow 20 bit DelSig
3) DFB (Digital Filter Block) that is dual channel, handle FIR or IIR filters, or DFB
can be used as a GP fast processor block, similar to RISC block
4) MSI logic elements GUI based and/or the UDB Verilog capability. Eg. the FPGA
like capability
5) Onboard Vref
6) IDAC, VDAC, OpAmps (up to 4), comparator, mixer, switch cap, analog mux....
7) LCD,  COM, UART, I2C, I2S, One Wire, SPI, Parallel, LIN, CAN, BLE, USB
9) Custom components capability, create with schematic capture or Verilog
10) DMA to offload processes like filters, COM, Display
11) ARM M0 (PSOC 4) or M3 (PSOC  5LP) or 8051 core(PSOC 3) or M0+/M4 dual core PSOC 6
12) Extensive clock generation capabilities
13) All components supported by extensive prewritten APIs

https://www.element14.com/community/thread/23736/l/100-projects-in-100-days?displayFullThread=true

http://www.cypress.com/documentation/code-examples/psoc-345-code-examples

Great video library

Attached component list.  A component is an on chip HW resource.

Free GUI design tool with schematic capture, "Creator". Components have rich API library attached
to each component. Compilers free as well.

PSOC 4 is low end of family, consider 5LP parts as well. PSOC 4 also has arduino footprint boards (pioneer) as well. PSOC 6 dual core M0+/M4.

https://www.elektormagazine.com/labs/robot-build-with-cypress-psoc

http://www.cypress.com/products/32-bit-arm-cortex-m-psoc



https://brightcove.hs.llnwd.net/e1/uds/pd/1362235890001/1362235890001_5241352463001_2606504288001.mp4?pubId=1362235890001&videoId=2606504288001



Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 
The following users thanked this post: saeed.GH

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 4036
  • Country: nz
Re: i'm starting to learn arm cortex-m
« Reply #10 on: August 25, 2017, 12:52:24 pm »
what way is better for start learn ARM cortex-m ?
what  language is better c or c++ ?

Assembler, surely, otherwise you won't see any difference between ARM and AVR or whatever.

Note that Cortex M uses the Thumb2 instruction set only.

If you don't know either C or C++ and you want to do low level programming then start with C first and learn it well and learn how it maps to the machine: registers, memory, instructions.

That said, I almost always use the C++ compiler, even if I'm programming using only features found in C. The results will be identical, but using the C++ compiler gives the options of using both C and C++ libraries. Ability to create and use more powerful libraries is the major reason for C++ to exist.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf