Author Topic: microchip or atmel ARM's  (Read 22588 times)

0 Members and 1 Guest are viewing this topic.

Offline Simon

  • Global Moderator
  • *****
  • Posts: 15344
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: microchip or atmel ARM's
« Reply #50 on: May 14, 2017, 10:40:05 am »
Well I am assuming that Atmel studio already dos this. For example I refer in my defines to PA1, PA2 etc, not port/pin addresses. What I was planning to do was do the same, I believe that the names carry across from one ARM to another particularly in the same family so I could start with a 32 pin chip and then decide to move my code to the 48 pin version and my code and definitions still work, I noticed this would not have worked so well on AVR with register names or locations of bit in registers being different between an ATtiny24 and the ATmega328,
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 5932
  • Country: nl
Re: microchip or atmel ARM's
« Reply #51 on: May 14, 2017, 12:31:10 pm »
What needs to be documented (and often isn't) is why a piece of software is structured the way it is.
Thats the software architecture and software design documentation which should be finished before any loc is written
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 15344
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: microchip or atmel ARM's
« Reply #52 on: May 14, 2017, 12:33:24 pm »
What needs to be documented (and often isn't) is why a piece of software is structured the way it is.
Thats the software architecture and software design documentation which should be finished before any loc is written
You wanna bet ? 😂


Sent from my Moto G (4) using Tapatalk

 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19924
  • Country: nl
    • NCT Developments
Re: microchip or atmel ARM's
« Reply #53 on: May 14, 2017, 12:36:13 pm »
What needs to be documented (and often isn't) is why a piece of software is structured the way it is.
Thats the software architecture and software design documentation which should be finished before any loc is written
You are right to use the words should be. With good design document you don't need the Doxygen generated crap.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 5932
  • Country: nl
Re: microchip or atmel ARM's
« Reply #54 on: May 14, 2017, 02:12:31 pm »
Ymmv i found doxygen extremely usefull to get a global function and module calls picture on unknown software i had to add code to. It showed some problems with sw eng. Not sticking to the architecture and calling hw peripherals directly in their modules instead of using the hal.
Try that without pictures with over 1 million locs in your devtree.
Then if you have a small sw stack and a one or two person sw team it might be overkill.
 

Offline h00p

  • Newbie
  • Posts: 2
  • Country: us
Re: microchip or atmel ARM's
« Reply #55 on: May 14, 2017, 02:24:48 pm »
Yes well my "C" skills are not that well developed either so I tend to fall over quite quickly when looking at other peoples examples. I need things along the lines of "write this to select 12 bits of ADC resolution". the ADC examples in the document did not make anything clear at all. Like you say I'd have to reverse engineer one of the sample projects at which point I end up decoding the bare metal. I'd love to find a nice higher level environment that truly takes care of this stuff.

Sounds like you'd be very happy with the Teensy 3.x line of dev boards, which are based on NXP Cortex-M4: https://www.pjrc.com/teensy/index.html

Programmed through USB, and virtually every Arduino library is supported, so it's extremely easy to get up and running.  You can use any IDE you want, including the free Arduino IDE (with a free Teensy-specific wrapper called Teensyduino).

To your example, getting data from the ADC is easy.  Treat it like an Arduino and use analogRead() to get 10-bit data, or load up the Teensy ADC library (with a mouse click) and run

ADC *adc = new ADC();
adc->setResolution(16); // 16-bit resolution
int value = adc->analogRead(readPin);

Easy peezy.
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 15344
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: microchip or atmel ARM's
« Reply #56 on: May 14, 2017, 03:50:12 pm »
Yes I have a couple of teensy's but I'd like something I can production use more easily. Plus at some point I'd need to move off the arduino environment and then where do I go?

Sent from my Moto G (4) using Tapatalk

 

Offline danadak

  • Super Contributor
  • ***
  • Posts: 1875
  • Country: us
  • Reactor Operator SSN-583, Retired EE
Re: microchip or atmel ARM's
« Reply #57 on: May 14, 2017, 07:13:35 pm »
Cypress PSOC (ARM core) -

An excample -

https://www.google.com/search?q=cypress+psoc+digital+filter+image&rlz=1C1PRFI_enUS740US740&source=lnms&tbm=isch&sa=X&ved=0ahUKEwj09v6Ei_DTAhVT02MKHcUBAzwQ_AUIBigB&biw=1874&bih=923#tbm=isch&q=cypress+psoc+digital+filter+image+hackster&imgrc=-OyYm9-BDvawAM:

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

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

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



Regards, Dana.
Love Cypress PSOC, ATTiny, Bit Slice, OpAmps, Oscilloscopes, and Analog Gurus like Pease, Miller, Widlar, Dobkin, obsessed with being an engineer
 

Offline donotdespisethesnake

  • Super Contributor
  • ***
  • Posts: 1120
  • Country: gb
  • Embedded stuff
Re: microchip or atmel ARM's
« Reply #58 on: May 15, 2017, 09:38:56 am »
Yes I have a couple of teensy's but I'd like something I can production use more easily. Plus at some point I'd need to move off the arduino environment and then where do I go?

I know your problem, when moving to ARM there is a lot of choice, and there is a lot of new info to sift through. I wouldn't expect newcomers to know that SWD or EDBG are anything to do with debug.

I've tried several of the ARM cortex M0/M3/M4 offerings, in order of "easiness" - a combination of availability of cheap tools, good online info, and built-in bootloader:

NXP LPC812, LPC1343
STM32 e.g. F103, F072
Atmel D10, D20, SAM3S

Infineon XMC1302
Freescale K10,K20

Atmel is not a bad place to start, plus there is also "official" Arduino support for D20. For cheap dev boards, look at http://uk.farnell.com/microchip/atsamd10-xmini/eval-brd-samd10d14a-smart-mini/dp/2451533 or http://uk.farnell.com/atmel/atsamd21-xpro/evaluation-board-sam-d21-mcu/dp/2407175. Those boards come with USB debug (EDBG). For rolling your own, I would get ATMEL-ICE http://uk.farnell.com/microchip/atatmel-ice-basic/debugger-atmel-arm-avr-basic-kit/dp/2407172 Then all you need is Atmel Studio 7.

The other vendors have similar debug boards and free tools. If you are expecting to try a few different vendors I would recommend JLINK-EDU.
Bob
"All you said is just a bunch of opinions."
 

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 273
  • Country: us
Re: microchip or atmel ARM's
« Reply #59 on: May 15, 2017, 12:42:56 pm »
I am late to this, but the reason to use Atmel is that they have a really good dev package and very solid documentation. 

The reason to use ST is because they are a bit better hardware wise (small m4 core package in Atmel? no way...) and they own a huge market share, so there really is no need to worry about stuff being obsolete (not that it is an issue with Atmel).

My biggest reason for liking ST is the cheap debugger. Atmel has one that is relatively cheap, but not as cheap at the ST one. All use ARMs do have SWD or JTAG, so this may be a non issue if you already have a JTAG.

If you really want to get the most out of learning something, you may want to do everything off of the CMSIS library. That way, you learn how to interface with the chip directly without using those painful libraries that some (ahem...ST) manufacturers include. It has the biggest learning curve by far, though. Also, if you move to a different platform, the change will be "easier" (I said easier, not easy).

For learning, just pick platform and start. My first was Freescale. I made LEDs blink and talked I2C and SPI. Using the libraries was easy. When I moved to ST (because of work), it was like a whole new universe. I had to change IDE (Freescale has a decent IDE once you get it going) and it did not work out of the box. The libraries kind of worked, but I ended up just working backwards until I realized that if I just use the CMSIS. I can get it to do exactly what I want, but it takes  A LOT of effort.



« Last Edit: May 15, 2017, 12:54:56 pm by Gibson486 »
 

Offline Gibson486

  • Frequent Contributor
  • **
  • Posts: 273
  • Country: us
Re: microchip or atmel ARM's
« Reply #60 on: May 15, 2017, 01:03:50 pm »
Yes I have a couple of teensy's but I'd like something I can production use more easily. Plus at some point I'd need to move off the arduino environment and then where do I go?

Sent from my Moto G (4) using Tapatalk

You can always buy the equivalent Freescale dev board...the only caveat is that you have to switch between boards when you switch environments.
 

Offline Syntax_Error

  • Regular Contributor
  • *
  • Posts: 204
  • Country: us
Re: microchip or atmel ARM's
« Reply #61 on: May 16, 2017, 02:18:18 am »
Google turned up nothing under that exact title. Do you perhaps refer to this similarly named title: 'Making Embedded Systems: Design Patterns for Great Software'?

https://www.amazon.com/Making-Embedded-Systems-Patterns-Software/dp/1449302149/ref=pd_sim_14_4?_encoding=UTF8&pd_rd_i=1449302149&pd_rd_r=V9TR6BSQ6H70EYM4SFX2&pd_rd_w=92ZUa&pd_rd_wg=Kfilh&psc=1&refRID=V9TR6BSQ6H70EYM4SFX2
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 brucehoult

  • Super Contributor
  • ***
  • Posts: 1735
  • Country: nz
  • Formerly SiFive, Samsung R&D
Re: microchip or atmel ARM's
« Reply #62 on: May 18, 2017, 08:34:53 am »
The problem with a roll-it-yourself is all the detail problems you bump into when something changes (a software version here, an install directory there....) and you don't want that complexity when you're just setting out.  Personally, even now, I prefer a 'clean' gcc/makefile environment to pretty much all the alternatives, but that's not the easy way into this stuff.

"Even now"?

ARM is an absolutely mainstream CPU. It has great support in both major free compilers, gcc and llvm.

For me, I can't imagine anything simpler than using gcc (with make or ninja whatever to drive recompilation), the appropriate tool to talk from the host to the particular dev board (OpenOCD, AVRDude, ADB (Android) or whatever), gdb, and if necessary the appropriate tool to convert an elf file into the appropriate load format for the board (hex, binary, whatever). One job, one tool, and you change only the tools.

I've been programming professionally for 30 years but I've never been able to get my head around Eclipse. It just seems nuts to me. Visual Studio or XCode are a bit better, but still waaay too "magic" and impenetrable for my taste. Let me choose my own editor (that's another job, so another tool ...)
 

Offline westfw

  • Super Contributor
  • ***
  • Posts: 3302
  • Country: us
Re: microchip or atmel ARM's
« Reply #63 on: May 18, 2017, 08:12:37 pm »
Quote
I can't imagine anything simpler than using gcc...
I agree with you almost 100%
Where "just use gcc" starts to fall apart is when you start needing multiple cross compilers.  Sure, you can download the arm version of gcc or llvm, but then you need to get the correct .h files defining peripherals for the chips you're using, and maybe a different set of newlib build options (the arm download does already have newlib, which is something.  But ... maybe not the version you need...) (or maybe a different libc or libgcc or libm.)   And linker maps and a possibly bewildering array of compiler options so that it won't end up generating instructions that don't work on your chip.   And perhaps other stuff as well.  And then it would be nice if you had some sort of logical directory/file structure for the tools so that if you switch chips, you can add the second vendor without messing up the first.  And if your OS of choice isn't development-friendly (*cough* windows), you probably have to install make separately, and programmer tools separately, and a bunch of other stuff that makefiles commonly use...
A chip-vendor-packaged IDE will do that for you; for a single vendor's chips.  Keil or IAR will do that for you, for $$$$.
You probably need to download the vendor's IDE just to extract the chip .h files anyway.
Grr.
 

Offline nctnico

  • Super Contributor
  • ***
  • Posts: 19924
  • Country: nl
    • NCT Developments
Re: microchip or atmel ARM's
« Reply #64 on: May 18, 2017, 08:47:43 pm »
Hmm... I'm using GCC but never have any of those problems.
There are small lies, big lies and then there is what is on the screen of your oscilloscope.
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 5932
  • Country: nl
Re: microchip or atmel ARM's
« Reply #65 on: May 18, 2017, 09:13:54 pm »
Against all warnings and hate threads and other anti ST campaigns I decided for a next project to just try out the CubeMX / SW4STM "experience"  ;D
Bought a few nucleo 476 boards and downloaded a lot of stuff from st.com
Yesterday evening I spent two hours installing and watching some youtube movies instead of reading 5000 pages of manuals  ;D
I am old school but lets do this the 21st century way, leave the books and follow the video.
This evening another three hours watching some youtube instruction movies and just went for it.
Downloaded and installed the packages for the STM32L4 family and tried to create a blinky.
First tries failed miserably because I choose the nucle board layout with tons of peripherals that are not configured ok it seems or I have to do some extra stuff.
So followed the kid on the video erased all pins and defined a couple of pins for the simple experiment.

Total of five hours and I have a blinky, MX generates the code for whatever toolchain you want (IAR,Keil, SW4STM and some other stuff), i choose the SW4STM and can now compile, run and debug.
Yeah, I am totally happy actually after all the hate threads I read earlier. Total code size for my debug blinky is 5kB which can be considered large (although I think it is peanuts if you look at everything that needs to be initialized) yes but hell my $7 chip has 1MB , who gives a *(&^ ?
Then the clocksettings are a miracle, you can just see the page from the datasheet as a GUI, experiment with all the settings and directly see if something is going wrong (out of the correct parameter space) and let MX correct it automagically. Beautifull, I can't see why someone does not love this.

The thing I do not like is the comment in between where the user can put its code, rather ugly but necessary if you want MX to change something and re-generate the rest of the code.
Perhaps in a few weeks when I am struggling with some peripherals my experience will change but for now I am really puzzled why there is so much anger against this 100% cost free toolchain.
 

Offline Sal Ammoniac

  • Super Contributor
  • ***
  • Posts: 1149
  • Country: us
Re: microchip or atmel ARM's
« Reply #66 on: May 18, 2017, 09:19:15 pm »
ARM is an absolutely mainstream CPU. It has great support in both major free compilers, gcc and llvm.

If you have performance requirements, you should benchmark the available compilers before choosing one. The free compilers may not be the best performers for your particular application.

According to my benchmarking, I found that the IAR compiler generated the fastest code, followed by Keil (the original compiler), then GCC, and finally LLVM in last place. The IAR generated code was about 12% faster than GCC in my tests.
Complexity is the number-one enemy of high-quality code.
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 15344
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: microchip or atmel ARM's
« Reply #67 on: May 19, 2017, 07:05:58 am »
if only I could find where to download STM cube etc, this is why I shy away, if they can't even give you the stuff without you have to search high and low will they have bothered to make it usable ????
 

Offline poorchava

  • Super Contributor
  • ***
  • Posts: 1584
  • Country: pl
  • Troll Cave Electronics!
Re: microchip or atmel ARM's
« Reply #68 on: May 19, 2017, 07:25:28 am »
I've worked quite alot with STM32F4 and SAM4 for cuite complex projects and I'd compare them in a following way:

SAM4SAM7:
-simpler peripherals than STM32F4
-typically less current consumption than similar STM32F4
-IDE is free, quite easy to use (being based on Visual Studio)
-MUCH simpler and less powerful DMA engine than STM32F4
-timer module can only be described as completly f***cked up.
-SAM7x parts at 300MHz are the fastest ARM microcontrollers on the market, until STM32H7 goes into full procduction
-ADCs have overall better analog specs (INL, DNL, noise etc) than STM32s
-literally the first uC where I was able to get I2C up and running in and hour or so without any issues. At the cost of I2C module simplicity
-f***cked up pinouts, eg SPI pins scattered all over one side of a QFP

STM32F4/F7:
-complex peripherals with many configuration options like injected ADC conversion modes, ADC interleaving, timer chaining etc
-FMC / FSMC if great for driving graphical LCDs, RAM, FLASH or simply fast uC-uC communication
-some have DSI controllers
-Very powerful DMA engine
-some have a 2D graphics accelerator which is essentially a 2D-array oriented DMA engine with some simple math functions (eg add x to all calues in array etc)
-typically cheaper for similar flash and RAM capacity than Atmel
-lots of free IDEs, but neither one of them is a proffesional grade tool that would compare with Visual Studio. STM32s are supported by VisualGDB though. STM's "own" IDE is made by a 3rd party, based on eclipse and is a pain to use IMO.


I love the smell of FR4 in the morning!
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 15344
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: microchip or atmel ARM's
« Reply #69 on: May 19, 2017, 07:42:21 am »
ok but I am looking at M0 here and I can't even find any ST software on their fucked up pointless website.
 

Offline gmb42

  • Regular Contributor
  • *
  • Posts: 194
  • Country: gb
Re: microchip or atmel ARM's
« Reply #70 on: May 19, 2017, 11:41:15 am »
Relatively easy, home page (http://www.st.com), from the menu Tools & Software then in the submenu Software Development Tools, then on that page use the Product Tree menu, open the STM32 Software Development Tools item and click on the STM32 IDEs link.

You should end up [http://www.st.com/en/development-tools/stm32-ides.html?querycriteria=productId=LN1200]here[/url] which has a list of 22 items to select from.

Or just Google "STM32 IDEs" which gets me the same page as the first link.
 

Offline brucehoult

  • Super Contributor
  • ***
  • Posts: 1735
  • Country: nz
  • Formerly SiFive, Samsung R&D
Re: microchip or atmel ARM's
« Reply #71 on: May 19, 2017, 11:48:02 am »
ARM is an absolutely mainstream CPU. It has great support in both major free compilers, gcc and llvm.

If you have performance requirements, you should benchmark the available compilers before choosing one. The free compilers may not be the best performers for your particular application.

According to my benchmarking, I found that the IAR compiler generated the fastest code, followed by Keil (the original compiler), then GCC, and finally LLVM in last place. The IAR generated code was about 12% faster than GCC in my tests.

I write compilers and JITs for a living, including on various flavours of ARM from IoT to smartphones. I seldom see more than 1% or 2% difference between gcc and llvm on real programs.

I don't know what your benchmark is, but if you see that big a difference then it's probably either:

- a microbenchmark where a single instruction plus or minus makes the difference.

or

- non-equivalent code generation models, ABIs, or optimisation levels.

You should probably write the critical loop or function in assembler anyway if the last 10% is so important to you.
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 15344
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: microchip or atmel ARM's
« Reply #72 on: May 19, 2017, 12:08:13 pm »
Relatively easy, home page (http://www.st.com), from the menu Tools & Software then in the submenu Software Development Tools, then on that page use the Product Tree menu, open the STM32 Software Development Tools item and click on the STM32 IDEs link.

You should end up [http://www.st.com/en/development-tools/stm32-ides.html?querycriteria=productId=LN1200]here[/url] which has a list of 22 items to select from.

Or just Google "STM32 IDEs" which gets me the same page as the first link.

And STM cube etc is not on the list, of what is on the list I have no idea of what I need, this is why I just looked at the SAM D20 as I have the IDE with no messing about and I am familiar with Atmel datasheets. I have since learned that D21 is a better series and that D20 was a mess because it was their first one.
 

Online Kjelt

  • Super Contributor
  • ***
  • Posts: 5932
  • Country: nl
Re: microchip or atmel ARM's
« Reply #73 on: May 19, 2017, 12:40:26 pm »
ok but I am looking at M0 here and I can't even find any ST software on their fucked up pointless website.
Sorry to say but you sound like a young kid that does not get his toy to run after 5 minutes.
If that is the effort you want to invest in this endeavour I would quit now, because there are very heavy storms ahead on the ARM seas (5000+ pages of datasheet/refmanual/prog manual/arm core etc.)

First you have to get an account on the st site before you can download any software.
Then spent a few hours of reading about the topic, watching youtube or the stm forum and you know exactly what you need and if you still don't get it read my above post:

Choose the chip you are going to need, select it on the st site and with tools/software/download you can find everything exept the last sw4stm you get that on the ac6 site (same account as st).
- CubeMX
- STM32F0 or L0 HAL
- SW4STM
and an stlink debugger (added to most dev boards already).
 

Offline Simon

  • Global Moderator
  • *****
  • Posts: 15344
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: microchip or atmel ARM's
« Reply #74 on: May 19, 2017, 12:48:25 pm »
ok but I am looking at M0 here and I can't even find any ST software on their fucked up pointless website.
Sorry to say but you sound like a young kid that does not get his toy to run after 5 minutes.
If that is the effort you want to invest in this endeavour I would quit now, because there are very heavy storms ahead on the ARM seas (5000+ pages of datasheet/refmanual/prog manual/arm core etc.)

First you have to get an account on the st site before you can download any software.
Then spent a few hours of reading about the topic, watching youtube or the stm forum and you know exactly what you need and if you still don't get it read my above post:

Choose the chip you are going to need, select it on the st site and with tools/software/download you can find everything exept the last sw4stm you get that on the ac6 site (same account as st).
- CubeMX
- STM32F0 or L0 HAL
- SW4STM
and an stlink debugger (added to most dev boards already).


I don't have a problem with taking the time when taking the time is due, but I am on the page about the software and there is no link, yes I have an ST account and was signed in.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf