EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: SuzyC on August 26, 2014, 03:44:53 pm

Title: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 26, 2014, 03:44:53 pm
Maybe I need to start a new post:  Which processor is the easiest to graduate to from an 8-bit to start doing some highly educated management of my MMMMM's???? I have succeeded in controlling on/off speed/direction of my MMMMM's but I don't have any memory or processing power  to do anything else!!

Right now, as a basis for comparison I have the following "conveniences:"
(1) I can edit, compile and program the 16F886 chip in less than 60-seconds. I simply unplug the DIP chip and pop it into my programmer and bingo!  That's very important to me, since MCU hardware  programing is always full of unexpected surprises!
(2) 5V supply. I cannot help but find it so easy to interface to and do A2D accurate work with and have a high noise-immunity.
(3)I can work with a CCBB (Common Chinese BreadBoard), makes it so easy to construct, modify any idea I have.
(4) I can make multiple PCB's each using a SOIC packaged version of a PIC MCU to make small modules; so each instantiation  is something quite small enough and compact to fit into a tiny space of my robot.
(5) I can always aford'm find and buy a dozen, a large supply of (10x cheaper than Arduino) PICC chips when I blow the #!**$ out of one and still have enough money to buy a new dress at the end of the month. ( I have a large collection of somewhat zorched PICC chips, more than a dozen, in my parts drawer.) So this is what fits my tight budget that relies on salvaging parts form discarded electronic equipment and then buying new only what is necessary, practical and cheap.

 What I don't have is any way to simulate my code. I have to just carefully and tediously examine the unexpected result, study my scope readout and then look over and over my code, then maybe a few hardware spike scope markers, that is all I have to try to make any sense out of whatever I am doing when it almost always does not do what I think it should be doing.  This does certainly slow down my catching up to Japan in robotics.

Right now, if I attempt to use anything more than a few 7-segment approximations of display, and even using only a measly
16 chars of feedback, I quickly exhaust a great deal of the 8-KWords of program memory.

Right now,  if I try to do something interesting with my MMMMM's I cannot because I have run out of memory. Any attempt at a more than a very few floating point calculations to unleash the power of my hare-brained Al Gore Rhythms results in my program memory, processing speed and R/W ram space being sucked dry.

Ok, so I've tried the ATMEGA2560, its got more RAM, but with the ATMEL IDE 6.x.  It  take s'many mouse clicks here and there, and so more than a few minutes to make a minor edit of the source, exit, compile and download the code to the MCU. I'll have gray hair if I have to work that slow! I also don't like the bulk of the Arduino board, it doesn't fit into the tight corners of my robot!


So what works well, is better, I donno????? DO YOU????
 
p.s. If  you don't know yet what a MMMMM is:  look at my previous post. It's my moronic mutl-MCU modular approach to multi-motor management.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: gardner on August 26, 2014, 04:30:29 pm
An ATMEGA1284 has 16K and available in a DIP suited to breadboarding.  Despite the popularity of Arduino for beginners, doing significant software projects using tiny RAM is actually a fairly advanced skill.

If you want more RAM and speed, then some sort of 32-bit ARM is going to be the way to go. You would find moving to an ARM with 64K or 128K hugely liberating.  Maybe consider an Arduino Due or Teensyduino platform.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 26, 2014, 04:47:51 pm
Thanks Gardner,

But I don't know from beans about 32-bit programming.

You say try an ARM..I say "Which ARM?"

I have yet no idea how I might go about learning to setup the hundreds of registers in some 32-bit MCU in a C++ place to wrap my head around, seems so far so far a distant goal.

 I have perused a few ARM offerings by ATMEL, but haven't found anything yet that promises to be always available, cheap, modular (DIP or break out board adaptable to common breadboards), low power consumption, small footprint, doesn't take an ARM and a leg to buy a compiler-IDE-debugger-simulator-chip programmer that works easy and well and cheap. I even see on this same page of this topic forum the post about a guy complaining about not having any availability of an ATMEL MCU. Atmega32U4 Availability Problems

Doesn't 32-bit programming require that every mcu instruction uses 4x the program memory than an 8-bit MCU? How do I learn to graduate from an 8-bit char variable mentality to the 32-bit world of the ARM?

Which ARM does best work to graduate to that has the economy of programming time, as well as the cost conveniences I have described above?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: gardner on August 26, 2014, 05:16:24 pm
I have yet no idea how I might go about learning to setup the hundreds of registers in some 32-bit MCU in a C++ place to wrap my head around, seems so far so far a distant goal.

This is where the low-barrier to entry platforms -- Arduino and Tennsyduino are going to help you.  You don't have to know or learn ANYTHING to get a hello world project going.  They are aimed at school kids and artists, and are very easy to get started with.
The Teensyduino is on a little board that you could stick some headers on and stick it into a breadboard, no problem.

Quote
How do I learn to graduate from an 8-bit char variable mentality to the 32-bit world of the ARM?

You will continue to write C or C++ programs in the usual way.  Nothing much changes there.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on August 26, 2014, 05:37:59 pm
Quote
any memory or processing power

Needing more memory is easy to solve - you can always get a bigger chip.

Needing more processing power requires (or may require) considerable uplifting. A few options for you, each with their own significant challenges:

1) ARM: a lot bigger chips and far more powerful peripherals. Much steeper learning curve and a new set of tools and a new approach to programming. Rarely they are 5v compliant.

2) PIC24 (including the dsPIC chips too): more processing power, slightly steeper learning curve, and similar tools. Marginally more complex peripherals. Many are 5v compliant. Unknown future.

3) advanced 8051: some firms, like Silabs, make amazingly fast 8051 loaded with features. The high end ones surpass many ARM chips in terms of processing power. New tools to learn.

Personally, I find 5v tolerant to be a non-issue for ARM chips. However, the toolchains can be a challenge for a newbie. But it is highly dependent on the individuals involved.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: mikeselectricstuff on August 26, 2014, 05:57:57 pm
Maybe I need to start a new post:  Which processor is the easiest to graduate to from an 8-bit to start doing some highly educated management of my MMMMM's???? I have succeeded in controlling on/off speed/direction of my MMMMM's but I don't have any memory or processing power  to do anything else!!

Right now, as a basis for comparison I have the following "conveniences:"
(1) I can edit, compile and program the 16F886 chip in less than 60-seconds. I simply unplug the DIP chip and pop it into my programmer and bingo!  That's very important to me, since MCU hardware  programing is always full of unexpected surprises!
Why would you mess about unplugging the chip ?
I start to get annoyed when my compile/program cycle exceeds about 10 seconds

Quote
(2) 5V supply. I cannot help but find it so easy to interface to and do A2D accurate work with and have a high noise-immunity.
That ship has long sailed - you will severely constrain your options clinging onto an obsolete standard
Quote
(3)I can work with a CCBB (Common Chinese BreadBoard), makes it so easy to construct, modify any idea I have.
(5) I can always aford'm find and buy a dozen, a large supply of (10x cheaper than Arduino) PICC chips when I blow the #!**$ out of one and still have enough money to buy a new dress at the end of the month. ( I have a large collection of somewhat zorched PICC chips, more than a dozen, in my parts drawer.) So this is what fits my tight budget that relies on salvaging parts form discarded electronic equipment and then buying new only what is necessary, practical and cheap.
PIC is the only option for higher-end parts in DIP - PIC24 and PIC32 are available in DIP, SOIC, SSOP and QFN. And I mean actually available
Most have some 5V tolerant pins if you need it - there are one or two PIC24s that run on 5V.
Many peripherals and devtools will be pretty familiar if you're already using 8 bit PICs

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Jeroen3 on August 26, 2014, 06:04:51 pm
Take a look at the mbed library and its supported parts.

You don't have to use C++, most people refuse this, because it generates larger and slower code.
However, if your design can improve by using specific C++ features such as templates and inhering, it might help you a lot. (objective programming is not limited to C++)

Quote
5V supply
You should forget 5V operating antiques, all chips nowadays do 3 Volts or less with *most* of the pins 5 V tolerant if Vcc applied. (analog excluded)
Find some LDO's.

Quote
I simply unplug the DIP chip and pop it into my programmer and bingo!
You're joking? These days we use SWD or JTAG in circuit debuggers. DIP is also antique.

Quote
(4) I can make multiple PCB's each using a SOIC packaged
NXP still has some soic parts, but lqfp seems the most popular.

Quote
(5) I can always aford'm find and buy a dozen,
This is an issue with 32 bit chips, or at least those used on demo-boards, they're quite expensive on the consumer market.
Fortunately, ST and TI will provider samples. You can basically forget buying NXP parts in low quantities. wvshare sells loose parts.
The loose parts easily cost half your demo board.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SirNick on August 26, 2014, 07:04:32 pm
Consider doing some projects with what you know -- 8-bit AVR ICs -- but using 3.3v and SMD parts.  Wade in the shallow end for a while to show yourself that it's not that scary.

I have bins full of through-hole parts, but as soon as I started using SMD, worlds opened up.  Don't deprive yourself of that.  Same goes for 5v.  You will be shocked how rarely you need 5v I/O when you start using 3.3v.  Most of the time, you're interfacing with parts that are either perfectly capable of 3.3v I/O, or have been level-translated to work at 5v in the first place.

Also, get used to using in-circuit programming.  It should be easy and reliable.  If it's not, you're most likely doing something wrong.  No biggie, it's just a knowledge gap, and that's entirely within your power to fix.  So resolve it and you'll be far better off.  Take some time to figure out what has been tripping you up.  Most of the time, you end up learning through troubleshooting -- which can be annoying when you're trying to accomplish something else.  So, make it a point to accomplish this instead.

After you've gotten the hang of those changes, then start looking into new micros.  Too much at once is a recipe for frustration.  Take attainable steps.  A journey of a thousand miles, and all that.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on August 26, 2014, 08:07:57 pm
Quote
I find 5v tolerant to be a non-issue for ARM chips.

Take a look at the various STM32 copter control boards and see for yourself how little you need for 5v in today's environment.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: zapta on August 26, 2014, 08:42:22 pm
Thanks Gardner,

But I don't know from beans about 32-bit programming.

You say try an ARM..I say "Which ARM?"

I had the same dilemma recently and settled on NXP M0 ARMS. One strong point for me was the availability of a simple to install tool chain. They packed Eclipse and all the plug ins and tools into a single and free package LPCExpresso that installs on Mac, Window and (I think) Linux  http://www.lpcware.com/lpcxpresso. (http://www.lpcware.com/lpcxpresso.)  You can user everything interactively from the GUI or set your own makefile if you prefer.

For example get this board http://www.nxp.com/demoboard/OM13014.html (http://www.nxp.com/demoboard/OM13014.html)  (~$15), hook it to your computer and you can start edit, run and debug (full feature debugger).

(mini rant: I hate complex to install tool chains, especially if I need to download different parts from different web sites or compile the source on my machine (which typically fails with cryptic error message). Single package install is the way to go.).
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: westfw on August 27, 2014, 06:44:46 am
Quote
(2) 5V supply. [including A-D range]
You may be out of luck.  Even the faster 8bit chips are going away from 5V.

(Hmm.  The Cypress PSoC4 (4200) seems to have an IO section that is pretty capable of 5V operation, including the A2D section.
It's had some discussion here as being particularly "interesting", but I don't think I'd call it "easy to graduate to.")
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 01:25:54 pm
Thanks Everyone!

Thanks especially to Westfw for the idea of using Cypress.

What I would really like to work with would be a single MCU that would fit on a tiny break-out PCB that would plug into my breadboard and ultimately into my MMMMM modules and yet could still re-programmed or maybe even debugged in my final tiny PCB modules.

I looked up ARM/Cortex on Wikipedia and was surprised to learn that ARM type chips are made by STM, TI, Cycpress et al.
So much hardware/Development IDE's to choose form.

But to just look at one arm of the problem:

I looked at the Cypress ARM chips available in large quantity at Farnell, there are 100+ to choose from that support +5V and range in price from a little more than a buck to over a hundred each.  The availability is very enticing.
I am especially confused about which chip to start with, which chip that would have the cheapest debugging, programming and adaptability to a breadboard and also then to actually fabricate a small PCB, that is putl the ARM/Cortex chip directly into a tiny PCB that would fit into my MMMMM robot that still would have the hardware support for re-programming it? What support components/chips would be necessary for that to be possible???

How do I get a leg-ahead in this chip to choose to use selection enigma?




Farnell has 4000, 4100, Arm  and ARM Cortex versions in stock, all in flat pac types of packaging that would require some way to put the target MCU into a breadboard or break-out board.

I also see that the PSoc IDE is a free download. What hardware do I need to program or maybe(if it isn't costing an ARM and a leg) a debugger?



Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: nctnico on August 27, 2014, 01:39:22 pm
Maybe the hardest part of starting with ARM is making a choice. From my own experience I don't believe getting an ARM going is harder then getting started with any other microcontroller. It is a matter of reading the documentation while being anxious to get going (like having to wait for someone to finish their dinner prayers).

Everyone has a preference for a certain brand and everyone has a preference for a certain IDE/toolchain. When I started with ARM I looked into devices from several manufacturers, tried making boards with several chips and stuck with the brand which suited me well. Maybe you should do the same: get developments boards from several brands, try several IDEs and see what is the easiest one for you to work with. Getting some hands on experience with various devices allows you to make a well informed decission on what is good for you.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 01:44:22 pm
Thanks Zapta!

I clicked on the link you posted and got this chip pop up at Farnell. It is cheap enough and fast but I couldn't find a link to buying the development board. When I clicked on "order" I got the link to the chip itself at Farnell.

NXP  LPC11U12FBD48/201,  MCU, 32BIT, CORTEX-M0, 50MHZ, LQFP-48

also LPCXpresso Board for LPC11U14 is quite inexpensive and uses JTAG.

Ummm I wonder what JTAG is and how to I work with it?  I have a ATMEL AVR MARKII Main uni usb  to 6-pin header made for the ATMEGA2560 and other ATMEL chips  to directly bypass the Arduino bootloader and download my programs. But would  NXP/TI or Cypress support this USB intergace??? What's a mother to do???
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 01:51:27 pm
Thanks again, nctnico

I appreciate you suggestion, but I have been fooling around with MCU chips as a hobby ever since I broke my leg in the early 90's. I had some encouragement from a boyfriend who gave me a computer complete with the software to do it in the mid 90's. I found this new hobby much more challenging and interesting than knitting winter wool caps for my friends in Florida! My first MCU development boards I got from my boyfriend allowed me to learn about computers and I was working with Z80 and 8086 chips in machine language and even some assembly, but several years later many PIC chips became available and I was quick to try to work with one.

Since then I have worked with just  two PIC  chips, the 16F87x and the 16F88x. I think I am almost an expert about them, but there is still a lot to learn. I learned how to program in BASIC and then with C  all by myself with the help of the internet and a few books. It's been quite a few years since I got my first LED's to blink.

Your suggestion "Maybe you should do the same: get developments boards from several brands, try several IDEs and see what is the easiest one for you to work with. Getting some hands on experience with various devices allows you to make a well informed decission on what is good for you." is a bit more more than a mom could handle!

I've already spent more than  10-years playing around with just two models of  PIC chips!

| would likely spend the rest of my short-enough life going through all these different approaches trying to figure which one next to try, bankrupt my piggy-bank, and not get anything done! By the time I evaluated all the possibilities I would have discovered that the chips they were intended for were already obsolete and my poor MMMMM's would be plagued with rust!
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Jeroen3 on August 27, 2014, 01:54:41 pm
I don't believe getting an ARM going is harder then getting started with any other microcontroller.
It is different. 8 bit toolchains tend to hide the initial boot assembly code through options. While with ARM you (or the ide) have to do this manually. And now you have to enable all peripherals yourself, if do it bare metal. Most people use the drivers supplied by the vendor, since peripherals are more complex.

Quote
What hardware do I need to program or maybe(if it isn't costing an ARM and a leg) a debugger?
Most hobbyists use the demo-board programmer, since genuine debuggers often cost 3 digits.
JTAG is an test interface where each pin can be controlled by the jtag tester. It is "abused" by mcu vendors as programming interface. Atmel isp programmers don't work for ARM. Get a segger or ulink if you want a single device for all targets.

Quote
Farnell has 4000, 4100, Arm  and ARM Cortex versions in stock

Yes, 50 per family or something. For development its usually the flagship chip which is chosen (the best one, as on the demo-boards). Which is scaled down when working to a production design for cost reduction. As beginner you should focus on Cortex M chips only.

If you're looking for a plug&play experience as Arduino you should definitely look at mbed. Or an STM32 with ChibiOS, but the latter might complicate things a bit too much I think.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 02:12:08 pm
Thanks Jeroen3!

I appreciate your suggestions, even though they don't agree with others as which ARM to shake a stick at first!

I am not looking for an Arduino experience, I wanna learn about how to program these chips register by register to get my thingees to work!

I'll take a look at your suggested chips.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 02:26:10 pm
Thanks a million Jeroen3 for your many comments and help!

Which Cortex M chip?

Could you elaborate a little whyfor I should post my bet on Cortex M chips?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: fcb on August 27, 2014, 02:36:41 pm
dsPIC30 family if you really must use 5v.

then migrate to dsPIC33F and dsPIC33E families when you need 3v3 and a bit more grunt.

Learning curve isn't that steep if your used to microchip stuff already.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 02:47:26 pm
Hey, I found a one page, a little lotta stuff available on ebay regarding programming the Cypress ARM

Can anyone tell me if any of it is anything worthwhile/a bargain/stay clear of?

http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1313.TR0.TRC0.H0&_nkw=%09CY8CKIT-002&_sacat=0 (http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2050601.m570.l1313.TR0.TRC0.H0&_nkw=%09CY8CKIT-002&_sacat=0)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 02:54:31 pm
Thanks FCB!


I don't quite understand why DsPIC30 are a great choice, what is this choice quite all about?

Are DSP just some hopped-up  mcu's optimized for analog-digital signal processing.  Why this insteada ARM?

Is the the IDE software available for the Dsp's  free and does it work, easy to work with? What about hardware needed to program these chips or debug them?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dgtl on August 27, 2014, 03:06:49 pm
I would also recommend ARM Cortex-M. Cortex-M is the CPU core series for microcontrollers. Many manufacturers use the same CPU core, the just plug their own peripherals in the same chip next to the ARM CPU core. So once you get used to them, you just need to learn the new peripherals when switching to another ARM Cortex-M vendor's chip.
* I would suggest starting with something that has good vendor support to get the first projects going. Compared to 8-bit controllers, the 32-bit ARM Cortex-M solutions usually do not hide away the low-level stuff - the array of interrupt vectors, initial value of stack pointer, linker script (memory mapping) etc. When using a well-supported chip, you just create a new project in the IDE and you get everything prepared to you (of course you can change things if you need). When using not so well supported chips or third-party tools (ie not the IDE+toolchain from the vendor but for example separate gcc+eclipse+gdb), you need somewhat more work to get the cpu going and it might be too much for the first project. Reasonable selections would include NXP, Atmel, SiLabs (former EnergyMicro), Cypress. NXP LpcXpresso supports Windows,MacOS,Linux; others are Windows-only if anything has not changed recently.
* Do not be afraid of the code that gets automatically added to your project. For 8-bitters it is usually hidden, for 32-bit controllers everything comes into your project. Compared to AVR, the clock settings are not configured by fuse bits anymore; the cpu starts running the code and the code itself configures the clock settings and switches clocks while running. All of that is inserted into auto-generated code. For start, just ignore it and write your code next to it. Later you can explore what gets done and try to do something different if needed.
* The vendor-given code usually includes the "driver" code for most of the peripherals. You may use it to talk to the HW. You may ignore it and write to the registers yourself (and use the vendor's code as a reference). Or you may modify it if you need to. Do not be afraid of that code. You may not like it; you usually don't. Usually it is too complicated; it provides functions to configure everything that you'll never use etc. Things can be done in multiple ways, you do not need that chained-descriptor-dma-controlled-uart-code just because the vendor does it that way. In most of the cases, the simple polling loop or IRQ-based approach works fine.
* Hardware-wise it would be good to choose a board with built-in debugger. Most of the vendors now offer boards that have the chip will be using and in addition to that the debugger. ARM microcontrollers have standardized JTAG or SWD debug interfaces. The PC to JTAG/SWD debug interface is on those boards, so you'll get all the HW you need at once. Depending on the board, it may have a couple of LEDs or something  else as well. Everything is powered from the debugger USB connector, so you just plug the debugger USB and you are ready to upload the "blinky" example project. Later on when you buy separate microcontrollers of the same manufacturer to build your own boards or simple breakout boards for breadboarding, you can detach the connection between the debugger and the uC on the evaluation board and use that debugger to debug another chip on another board. (NXP has even boards that can be cut in half to physically split the debugger half). Usually the debuggers from one uC vendor do not work on chips of another. You can also get a more expensive generic professional debugger (jlink etc), but then you might run into HW and SW compability issues that you don't want for your first project.
* Actually, it is possible to program most of the ARM Cortex M chips without a debugger at all. Most of the chips come with built-in bootloader. Usually it depends on some bootstrap pin of the uc; depending if it is low or high when powered up, the uc starts the code or bootloader. Depending on the chip, the bootloader uses an UART or the USB of the uc (that you usually bring out to a connector anyway for most of the projects); using software provided by the vendor you can just program the chip via that interface. This is usually used for manufacturing; for development it is good to use a debugger that is integrates well to the IDE.

So the simplest way to get started would be:
* buy an LpcXpresso board (doesn't matter which... but unless you need to try a specific uC, get the biggest one you can... the price difference is almost nothing but you'll get 10x more flash space and many more peripherals to play with. For example, 15xx and 17xx are nice to play with.)
* install lpcXpresso software
* connect the board via USB to the PC
* create a new example project (use the blinky demo, for example)
* press the debug button to upload to uC
If you need more HW, get an Embedded Artists Base Board; the lpcXpresso plugs into that and you'll have plenty of things to play with.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: nctnico on August 27, 2014, 03:16:22 pm
I'm not quite sure you really need a debugger. In 25 years I never run into a problem which could only be solved by using a debugger. When it comes to ARM controllers I use the ones from NXP and a serial port to program them. Life can't be any simpler.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 03:16:57 pm
Gadzillion Thanks, dgtl   

I am in AWE! Thank you so much for using some of your valuable time to give me so much helpful information.

Your reply is very comprehensive and I've just read though it once and I am very impressed by your detailed reply!

I will print it out and study it very carefully.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 03:23:06 pm
Thanks again nctnico,

Your advice on debuggers is very valuable.

I am trying to make up my mind, what little is left of it. So many possibilities to choose from.

You say things are simple, could you please reply with info about the exact hardware/software NXP chip to use to make this so?

Where do I buy the parts, the NXP chips?  Ebay?

I found over 200 different NXP ARM chips on Farnell.com.

How can I make a choice?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: charlespax on August 27, 2014, 03:29:35 pm
I've been having fun with MicroPython (http://micropython.org/). It uses an Arm Cortex M4. When I was single I made a MicroPython robot running some rather complex AI to help me select Tinder matches (https://www.youtube.com/watch?v=2QUH5G3t8Qs&list=UUX9LOMwhbSLbRq5VlC_7SRg).
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 03:52:13 pm
Thanks Charlespax,

I think I saw at a local electronics store that they were selling Rasberry Pie mcu kits using Python to code them with, something a little too cute to play with, with WiFi and GNW?

Seems too odd a programming language use to me for hardware on the MMMMM level.

The board you show may not be so easy to find in production now, according to my fast search of the web.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: westfw on August 27, 2014, 03:58:53 pm
Quote
I am not looking for an Arduino experience, I wanna learn about how to program these chips register by register
One problem is that the ARM vendors would have you use their "peripheral libraries", which while they are more complicated than Arduino libraries, aren't really a lot better at exposing "register by register" programming.

Quote
regarding programming the Cypress ARM
Can anyone tell me if any of it is anything worthwhile/a bargain/stay clear of?
Be careful of what you're getting.  Cypress "PSoC" chips are available with 3 different CPUs.
PSoC1 chips has a proprietary Cypress core, the 8bit m8C.  I haven't heard much good about it.
PSoC3 chips had an 8051 core.  SOOO 1980s...
PSoC4 has an ARM CM0 core, and PSoC5 has an ARM CM3 core; these are the ones worth consideration, IMO.  A lot of people have been experimenting with these cheap breakout boards (http://www.cypress.com/?rid=92146 (http://www.cypress.com/?rid=92146) ) and or the "Arduino-shield compatible" "Pioneer" board: http://www.cypress.com/?rid=77780 (http://www.cypress.com/?rid=77780)

(No need to go searching eBay for bargains...)  (Search the forums here for earlier discussions...)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Corporate666 on August 27, 2014, 04:28:27 pm
Suzy,

Allow me to humbly suggest the Cypress PSoC line.  I see someone mentioned it before - I am a huge fan of these chips.  I used to use all Atmel but after some bad experiences, I jumped into Cypress.  I could not be happier with them.  I am not aware of all the features of every other chip (so some of the things below may not be specific just to the PSoC chips), but some things I like are...

-Awesome debugging.  You can step through your code and watch the output pins change and monitor memory locations and variables while stepping.  Makes debugging a breeze.

-Cost.  PSoC3 and PSoC4 chips are pretty powerful (8051 and ARM M0 cores, respectively) but they are in the $1-5 range in small quantities.  Plus they are available from most sellers, and direct from Cypress too.

-Flexibility.  Most chips will have, say, an ADC on one pin, an interrupt capture on another pin, and UART on another pin.  With the PSoC, you drag-and-drop the digital and analog perpipherals you need and you choose which pins those peripherals run on.  Cypress also has great libraries so instead of messing around with calibrating an ADC and using a table or calculation to get a result, you can configure the peripheral to give you the value in the format you want.  So if you are measuring temperature, you could configure it to give you a result in degrees fahrenheit, for example.

I have in my hands a CY8CKIT-049-42XX.  I think they cost around $5 or so.  It's a small board with a USB connector on one end, a PSoC4 on it, a switch and LED, and then just pin header sockets all the way down the board in DIP format.  So you can plug it into your computer and play around with making programs and debugging... and/or you can solder pin headers to it and use it in a breadboard. 

The only downside to Cypress stuff is that because it is not as popular in the hobbyist world, there are less code examples and forums than there are for PIC and Atmel, for example.  But Cypress is making a big push to support the users, so you can go right to the forums on the Cypress.com website and get answers to programming questions right from the company itself, which is pretty awesome.

One other thing - IMO, stay away from PSoC1.  It is the first generation of the MCU+PLD concept... it's old tech and being phased out.  It doesn't have near the configurability of the later PSOC3, 4, 5) chips, and since the PSOC4 came out, they are actually cheaper than the less powerful PSoC1... so IMO no reason to bother with PSoC1, use the later ones.

I don't work for Cypress or have any connection to them, other than being a very satisfied customer.  They have gone above and beyond in giving me samples, dev kits, answering questions and supporting me in my projects. 
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: zapta on August 27, 2014, 05:48:06 pm
Thanks Zapta!

I clicked on the link you posted and got this chip pop up at Farnell. It is cheap enough and fast but I couldn't find a link to buying the development board. When I clicked on "order" I got the link to the chip itself at Farnell.

NXP  LPC11U12FBD48/201,  MCU, 32BIT, CORTEX-M0, 50MHZ, LQFP-48

also LPCXpresso Board for LPC11U14 is quite inexpensive and uses JTAG.

Ummm I wonder what JTAG is and how to I work with it?  I have a ATMEL AVR MARKII Main uni usb  to 6-pin header made for the ATMEGA2560 and other ATMEL chips  to directly bypass the Arduino bootloader and download my programs. But would  NXP/TI or Cypress support this USB intergace??? What's a mother to do???

SuzyC, I think this is the entry in Farnell

http://uk.farnell.com/nxp/om13014-598/kit-dev-lpcxpresso-lpc11u14/dp/2251822 (http://uk.farnell.com/nxp/om13014-598/kit-dev-lpcxpresso-lpc11u14/dp/2251822)

Don't worry about the jtag stuff. Everything just works. The board has two halves that you can be broken apart (but don't do it until things work for you).  One half is the debugger and one half is the target ARM board. Install the LPCExpresso IDE on your OS of choice (Windows, Mac or Linux), download their examples, connect the debugger half to your computer with a standard Mini B USB cable and everything should work, including single step debugging, and register and variable examination. No external power is necessary.

Once the basic stuff works for you and you want to embed it in your project (or design a custom PCB based on the ARM board half), hook the debugger to the target board using a 8 wire cable and then you can debug your own board.

Notes:
1. The board, even before you break it, should fit on a solderless breadboard (you need to solder the 0.1" header, similar to what is done with Arduino's breakout boards). This way you can hook peripherals while experimenting.

2. My board arrived from Digikey with a USB connector also on the target half. I guess this is to experiment with targets that talk USB. Am not sure what part number is what. Mine says "LPC11U14 REV A (c) 2011" on the target half. I got it from Digikey a few weeks ago.

3. NXP has support forums where you can ask questions and get them answered.

4. I am not claiming that this combination is 'the best'. I was just looking for a reasonable one that is easy to install on mainstream OS's, works out of the box with a single install, and comes from a known vendor, just the same experience I had with Arduino. This makes open source project more open and easier to modify by others.





Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 27, 2014, 05:50:21 pm
The only downside to Cypress stuff is that because it is not as popular in the hobbyist world, there are less code examples and forums than there are for PIC and Atmel, for example.  But Cypress is making a big push to support the users, so you can go right to the forums on the Cypress.com website and get answers to programming questions right from the company itself, which is pretty awesome.

Google: 100 projects in 100 days
element 14 did a series of projects based on the PSoC4 targeted to the pioneer board ($25 with arduino headers) and it also has a PSoC5LP that acts as the bootloader but it can be used as well.

The projects should translate well to the prototyping boards ($4+ shipping)
you can buy chips in QFP or QFN or SSOP for $1 each no minimum and free shipping (PSoC 4200)

It's very easy to use and flexible power inputs plus programmable digital and analog makes them pretty powerful.

PSoC 5LP is better, smartchboards has some breadboard ready for $35, there is also a kickstarter that will expand the R-Pi using the 5LP.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: nctnico on August 27, 2014, 05:56:47 pm
IMHO hunting for the cheapest development board or device is not the way to go. Better spend a little bit more on a device which is easier to use.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: djacobow on August 27, 2014, 06:18:09 pm
Doesn't 32-bit programming require that every mcu instruction uses 4x the program memory than an 8-bit MCU? How do I learn to graduate from an 8-bit char variable mentality to the 32-bit world of the ARM?

I didn't see anybody answer this yet. The answer is, no; the instruction size is not necessarily tied to the machine word size. For ARM the basic ISA does have all 32b instructions, but all M* processors have the "Thumb" and "Thumb2" modes, which provide 16b instructions, allowing the compiler to select small versions of the most common/important instructions.

Basically, your code may bloat compared to Atmega 8b AVR which has 16b instructions, btw) but it will not bloat 4x.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SirNick on August 27, 2014, 07:13:10 pm
You're going to get different answers every time you ask "What board should I buy?" so at some point you're going to have to make up your own mind.  Do it based on detailed descriptions of the differences, or based on tutorials you find, or because NXP offers a turn-key system, or because the ST chips are someone's darling, or because you like Atmel's AVRs and want to try their SAMs.

When you're just starting out, it doesn't really matter much, so you won't get it "wrong".  You're not invested and can hop trains at any time.  You're just out a few bones and some time if it doesn't work for you.  Several manufacturers make Cortex M0, M0+, M3, and M4 MCUs.  Pick one -- preferably an M0+ to start since they're simple and cheap.

Here are a couple options though:

http://www.adafruit.com/products/1336 (http://www.adafruit.com/products/1336) -- This is a breadboard-friendly starter kit.  You get a bare NXP LPC 810 in DIP-8, a USB to TTL serial cable, and a handful of parts for $13.  Or buy the parts alone from your favorite supplier.  Adafruit has a tutorial on getting started with this kit, which should make it easy to dip your toes into the ARM pool.  It won't get any easier than this.

http://www.adafruit.com/products/1341 (http://www.adafruit.com/products/1341) -- This is one of the bigger(ish) NXP LPC Xpresso dev boards.  I got one similar to this, if not the same one, from Digikey a little while back.  It's made to be plug-n-play with the LPC Xpresso IDE and community.  If you want community support, NXP would be a good vendor to choose.  Likewise, if you want to dive into the deeper end of Cortex M-series, this would be a decent model to start with.

NXP is one of the more popular vendors along with ST, so it would be wise to narrow your list down to those two unless you have reasons otherwise.  The Atmel offerings are not exactly stellar (some of the NXPs are faster) but their docs are pretty good, and probably feel more familiar to an existing AVR user.  If you want to go that way, you might begin with the Arduino clones that use the SAM chips under the hood.

I would leave Cypress and TI and all the others alone until you have enough experience to decide whether they have something unique to offer.  But, that's just my opinion, and you know what they say about opinions:  Everyone has one, and no one else wants to hear it.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 08:58:12 pm
SirNick, thanks for your opinions!

I personally truly think that everyone has an opinion and I want to hear all of them!


I am going to try to take a look at your hardware suggestions.

Right now I have a pile of printouts about various ARM chips and boards and LPC and I gotta figure out which path to take,
 :phew: :phew:

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 27, 2014, 09:06:33 pm
Thanks djacobow,

For answering my question about the amount of programming memory used on 32-bit chips per instruction.


I have just completely ran out of memory on my MASTER 16F886 mcu, so something new and more powerful has to be found.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Jeroen3 on August 27, 2014, 09:17:31 pm
Quote
I wanna learn about how to program these chips register by register to get my thingees to work!
Be careful what you wish for.
I can recommend you this book. http://www.google.nl/search?q=The+Definitive+Guide+to+the+ARM+Cortex-M0 (http://www.google.nl/search?q=The+Definitive+Guide+to+the+ARM+Cortex-M0) With their sequels for the Cortex M3 and 4.
This is also a good place to add to your bookmarks for all kinds of stuff. http://infocenter.arm.com/help/topic/com.arm.doc.set.cortexm/index.html (http://infocenter.arm.com/help/topic/com.arm.doc.set.cortexm/index.html)

Quote
Basically, your code may bloat compared to Atmega 8b AVR
The available flash also grew in numbers. Thumb mode is used for 16 bit instructions (including 16 bit data) on a usually 128 bit wide flash for faster fetching. (read that book)

To answer your question "What board should I buy?": a board you can afford. Try getting into the serious Freescale parts, or get a Keil demo board, maybe get a loan first.

Of my experience with NXP (11xx, 17xx and 43xx) and STM32F0 and F4's. I can recommend NXP for starters with bare metal programming. NXP uses relatively simple peripherals so a timer consists of a control, counter, compare. ST tries to fit your entire application in a single pair of Basic timers, Advanced timers, PWM timers or you name it. Currently I'm using STM32F4's (ChibiOS :-+), but I cannot imagine what a pain this must be without peripheral driver code.

The main challenge will be the user manual, where the registers are explained. These differ between vendors and it will definitely take some to time before you read them as comics.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Kjelt on August 27, 2014, 09:23:16 pm
I second sirnicks lpc1769 xpressoboard, very nice and worth every penny since you seem to be tight on cash.
It can also be ordered directly from emb. Artists website or farnell 1825878
It can get you started for $30 and if you want further you can expand with base oard etc. It has a 120MHz cortex M3 and 512kB flash should keep you going.
Not satisfied? Anyone will take it of your hands for $15-$20 if still ok, so a good choice to start i think.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on August 27, 2014, 09:50:55 pm
I think you will need to consider the chip, the debugger / programmer, the software and the ide, in making an informed decision:

1) the chip: the core / instruction set doesn't really matter, as long as you code in a high level language like C. I would, instead, look to the peripherals in picking a chip. Make sure that the chip has all the peripherals you possibly need.

Of the most chips people here use, NXP has the least bug, also the least features. ST has the lowest price / flexibility, but somewhat buggy chip. Atmel has well documented chips. TI has the most feature rich chips, but buggy adc.

Most of those chips are LQFP, or worse. Not terribly hand-solder friendly. Some vendors offer TSSOP, or even PDIP (8 or 32 for example).

2) the debugger / programmer: most of those chips can be programmed with "universal" debuggers like j-link (fairly pricey), or vendor-supplied debuggers, like LPCLink, redlink, or st-link. They are much cheaper, especially if you buy clones, and sometimes integrated into the dev boards.

3) the software: if you take a look at the datasheet, those chips have vast number of registers. Many times, you may find it beneficial to use vendor-supplied libraries to simplify the process. Vendor support there ranges from non-existent (almost, like NXP), to somewhat good (ST or TI), very good (Atmel), to excellent (Freescale).

4) the ide: most vendors offer some limited versions of keil or iar, typically limited to 32KB. Two excellent choices are KDS (freescale) and CoIDE - free and unlimited and superb project wizard.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on August 27, 2014, 10:34:47 pm
I would just add that your experience with ARM will depend critically on your ability to program - being comfortable with managing a multi-module project, being able to connect seemingly unrelated dots, being proficient with a modern IDE, .....

To provide you an example, a typical blinky project for me contains about 1000 files and takes up 35MB. The actual code that blinks the LED has maybe 3 - 5 lines and the main() is less than 10 lines. 99.99% of the code in that project is canned and borrowed from prior work or written by the vendor.

So if you aren't sure of your ability to handle that kind of programming, I would suggest that you start with a low-cost, all-in-one package, like one of those ST Discovery boards. They contain a hardware debugger, a chip + some indicators and sometimes sensors. They are also well supported by CoIDE.

Essentially, once you have the board, you just need to download CoIDE and you are ready to go.

The prices ranges from < $10 for the STM32F0 boards to the < $20 for the STM32F3 and then $20+ for STM32F4 boards. Tough to go wrong with those.

If you are into multi-copters, I would recommend the STM32F3 discovery - it has an onboard accelerometer, gyroscope and compass, plus FPU.  Plus tons of flash / memory and lots of speed.

All for just over $10. Very difficult to resist at that price point.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: zapta on August 27, 2014, 11:57:02 pm
This thread demonstrates the Android proposition of a simple introduction to embedded programming.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SirNick on August 28, 2014, 12:03:28 am
Well... careful with trying to start with a chip or board that is out-of-the-box suitable for your project goal.  That makes it tempting to try to learn on-the-fly while also trying to accomplish something useful.  Don't do that.  For a while, you need to focus on learning the ropes.  Blink some LEDs, read some switches and knobs, etc.  Unless you're an expert (and if you were, you wouldn't need our advice here) trying to pull off too much too fast is going to end in frustration.  Crawl, walk, run -- in that order.

The IDE issue confused the heck out of me for a while because it's not often you get much of a choice in 8-bit land.  If you think you got impassioned responses over which MCU to use, try asking about IDEs...

Basically, you should be able to use GCC (if you're willing to set up your own cross-compiling environment), the vendor's own toolchain (e.g., LPC Xpresso), or a third-party IDE like IAR, Keil or Kuckoo.  That other new paradigm -- limited code size or trial periods -- is something else you'll have to deal with.

The vendor environment might be best to start with since they will have provided Getting Started guides, videos, and forums under the assumption that you'll use their canned solution.  The third-party offerings try to be somewhat (MCU) vendor-neutral, but you might have to put in a little effort getting it to work with dev boards and their integrated debuggers.  At some point, you'll just have to try out different options until you find the one you like.  Watch some YouTube videos featuring different IDEs to get a feel for that.

The sheer number of options was the single hardest thing about breaking into ARM development IMO.  It's a fragmented space without a lot of clear direction at first.  You really just have to dive in and acclimate for a while.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: 22swg on August 28, 2014, 08:16:24 am
PIC24FV32KA304 with BOB MPLABX  XC16  PICkit3   ;D
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 28, 2014, 04:50:50 pm
Thanks to Everyone!

Here's what I've got to wrap my head around:

Danyf::

 1) ARM: a lot bigger chips and far more powerful peripherals. Much steeper learning curve and a new set of tools and a new approach to programming. Rarely they are 5v compliant.

2) PIC24 (including the dsPIC chips too): more processing power, slightly steeper learning curve, and similar tools. Marginally more complex peripherals. Many are 5v compliant. Unknown future.

3) advanced 8051: some firms, like Silabs, make amazingly fast 8051 loaded with features. The high end ones surpass many ARM chips in terms of processing power. New tools to learn.

Take a look at the various STM32 copter control boards and see for yourself how little you need for 5v in today's environment.
--------------------------------------
Mikeselectricstuff:

PIC is the only option for higher-end parts in DIP - PIC24 and PIC32 are available in DIP, SOIC, SSOP and QFN. And I mean actually available
Most have some 5V tolerant pins if you need it - there are one or two PIC24s that run on 5V.
Many peripherals and devtools will be pretty familiar if you're already using 8 bit PICs
--------------------------------------
22swg:

PIC24FV32KA304 with BOB MPLABX  XC16  PICkit3
--------------------------------------
fcb:

dsPIC30 family if you really must use 5v.

then migrate to dsPIC33F and dsPIC33E families when you need 3v3 and a bit more grunt.

Learning curve isn't that steep if your used to microchip stuff already
--------------------------------------
Zapta:

I had the same dilemma recently and settled on NXP M0 ARMS. One strong point for me was the availability of a simple to install tool chain. They packed Eclipse and all the plug ins and tools into a single and free package LPCExpresso that installs on Mac, Window and (I think) Linux  http://www.lpcware.com/lpcxpresso. (http://www.lpcware.com/lpcxpresso.)  You can user everything interactively from the GUI or set your own makefile if you prefer.

For example get this board http://www.nxp.com/demoboard/OM13014.html (http://www.nxp.com/demoboard/OM13014.html)  (~$15), hook it to your computer and you can start edit, run and debug (full feature debugger).

(mini rant: I hate complex to install tool chains, especially if I need to download different parts from different web sites or compile the source on my machine (which typically fails with cryptic error message). Single package install is the way to go.).

(and a little later this post:)
http://uk.farnell.com/nxp/om13014-598/kit-dev- (http://uk.farnell.com/nxp/om13014-598/kit-dev-)lpcxpresso-lpc11u14/dp/2251822

Don't worry about the jtag stuff. Everything just works. The board has two halves that you can be broken apart (but don't do it until things work for you).  One half is the debugger and one half is the target ARM board. Install the LPCExpresso IDE on your OS of choice (Windows, Mac or Linux), download their examples, connect the debugger half to your computer with a standard Mini B USB cable and everything should work, including single step debugging, and register and variable examination. No external power is necessary.

Once the basic stuff works for you and you want to embed it in your project (or design a custom PCB based on the ARM board half), hook the debugger to the target board using a 8 wire cable and then you can debug your own board.
--------------------------------------
Jeroen3:

 As beginner you should focus on Cortex M chips only.
If you're looking for a plug&play experience as Arduino you should definitely look at mbed. Or an STM32 with ChibiOS, but the latter might complicate things a bit too much I think.
(and in a subsequent post:)
Of my experience with NXP (11xx, 17xx and 43xx) and STM32F0 and F4's. I can recommend NXP for starters with bare metal programming. NXP uses relatively simple peripherals so a timer consists of a control, counter, compare. ST tries to fit your entire application in a single pair of Basic timers, Advanced timers, PWM timers or you name it. Currently I'm using STM32F4's (ChibiOS :-+), but I cannot imagine what a pain this must be without peripheral driver code.
--------------------------------------
dgtl:


So the simplest way to get started would be:
* buy an LpcXpresso board (doesn't matter which... but unless you need to try a specific uC, get the biggest one you can... the price difference is almost nothing but you'll get 10x more flash space and many more peripherals to play with. For example, 15xx and 17xx are nice to play with.)
* install lpcXpresso software
* connect the board via USB to the PC
* create a new example project (use the blinky demo, for example)
* press the debug button to upload to uC
If you need more HW, get an Embedded Artists Base Board; the lpcXpresso plugs into that and you'll have plenty of things to play with.
---------------------------------------
Westfw:

Be careful of what you're getting.  Cypress "PSoC" chips are available with 3 different CPUs.
PSoC1 chips has a proprietary Cypress core, the 8bit m8C.  I haven't heard much good about it.
PSoC3 chips had an 8051 core.  SOOO 1980s...
PSoC4 has an ARM CM0 core, and PSoC5 has an ARM CM3 core; these are the ones worth consideration, IMO.  A lot of people have been experimenting with these cheap breakout boards (http://www.cypress.com/?rid=92146 (http://www.cypress.com/?rid=92146) ) and or the "Arduino-shield compatible" "Pioneer" board: http://www.cypress.com/?rid=77780 (http://www.cypress.com/?rid=77780)
---------------------------------------
Corporate666:

Allow me to humbly suggest the Cypress PSoC line.  I see someone mentioned it before - I am a huge fan of these chips.  I used to use all Atmel but after some bad experiences, I jumped into Cypress.  I could not be happier with them.  I am not aware of all the features of every other chip (so some of the things below may not be specific just to the PSoC chips), but some things I like are...

-Awesome debugging.  You can step through your code and watch the output pins change and monitor memory locations and variables while stepping.  Makes debugging a breeze.

-Cost.  PSoC3 and PSoC4 chips are pretty powerful (8051 and ARM M0 cores, respectively) but they are in the $1-5 range in small quantities.  Plus they are available from most sellers, and direct from Cypress too.

I have in my hands a CY8CKIT-049-42XX.  I think they cost around $5 or so.  It's a small board with a USB connector on one end, a PSoC4 on it, a switch and LED, and then just pin header sockets all the way down the board in DIP format.  So you can plug it into your computer and play around with making programs and debugging... and/or you can solder pin headers to it and use it in a breadboard.

The only downside to Cypress stuff is that because it is not as popular in the hobbyist world, there are less code examples and forums than there are for PIC and Atmel, for example.  But Cypress is making a big push to support the users, so you can go right to the forums on the Cypress.com website and get answers to programming questions right from the company itself, which is pretty awesome.
---------------------------------------
Miguelvp:

Google: 100 projects in 100 days
element 14 did a series of projects based on the PSoC4 targeted to the pioneer board ($25 with arduino headers) and it also has a PSoC5LP that acts as the bootloader but it can be used as well.

The projects should translate well to the prototyping boards ($4+ shipping)
you can buy chips in QFP or QFN or SSOP for $1 each no minimum and free shipping (PSoC 4200)

It's very easy to use and flexible power inputs plus programmable digital and analog makes them pretty powerful.

PSoC 5LP is better, smartchboards has some breadboard ready for $35, there is also a kickstarter that will expand the R-Pi using the 5LP.
---------------------------------------
SirNick:

http://www.adafruit.com/products/1336 (http://www.adafruit.com/products/1336) -- This is a breadboard-friendly starter kit.  You get a bare NXP LPC 810 in DIP-8, a USB to TTL serial cable, and a handful of parts for $13.  Or buy the parts alone from your favorite supplier.  Adafruit has a tutorial on getting started with this kit, which should make it easy to dip your toes into the ARM pool.  It won't get any easier than this.
http://www.adafruit.com/products/1341 -- This is one of the bigger(ish) NXP LPC Xpresso dev boards. I got one similar to this, if not the same one, from Digikey a little while back.  It's made to be plug-n-play with the LPC Xpresso IDE and community.  If you want community support, NXP would be a good vendor to choose.  Likewise, if you want to dive into the deeper end of Cortex M-series, this would be a decent model to start with.
NXP is one of the more popular vendors along with ST, so it would be wise to narrow your list down to those two unless you have reasons otherwise.  The Atmel offerings are not exactly stellar (some of the NXPs are faster) but their docs are pretty good, and probably feel more familiar to an existing AVR user.  If you want to go that way, you might begin with the Arduino clones that use the SAM chips under the hood.

I would leave Cypress and TI and all the others alone until you have enough experience to decide whether they have something unique to offer.






Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 28, 2014, 05:03:39 pm
Oh Dear!

I don't know SLP from SLR(my camera)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: zapta on August 28, 2014, 05:06:03 pm
OP, when you drive toward a fork in the road, often it doesn't matter much if you choose the right or left side, as long as you don't hit the tree in the middle.

;-)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Jeroen3 on August 28, 2014, 05:25:12 pm
When you drive toward a fork in the road, there is little chance a road will make a u-turn. You might need some course correction in the future though.
Just choose one of the roads your cart seems to fit on, comfortably.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 28, 2014, 05:59:01 pm
I guess that means if I havta choose between SLP and SLR I must at all cost avoid SLQ. :-DD
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Corporate666 on August 28, 2014, 08:22:33 pm
I would humbly add that most MCU's are largely similar in how they are programmed, so if you take away "advanced" stuff like memory management, speed, MIPS and the like, it pretty much comes down to the development environment, availability of parts, price of the chips, support and what the chips can do (peripherals).

The basic C code is not going to be much different whether you're using an ARM, 8051, AVR or something else.  What else is available (peripherals) and how easy those features are to use is going to make a big difference.

I hate to keep sounding like a shill for Cypress but I think this is where the PSoC really shines.  You can configure the chip and give your pins names and set them as I/O's and such.  So a program to turn on an LED when a button is pressed becomes

if (Button() == 1) { LED() = 1; }

It's similar when using ADC's, timers, PWM's and such.  Drag and drop them on your design, tell them which pins to input/output to, configure the component and then use the built-in API/library to easily use the peripherals. 

If you get more advanced, you can write your own Verilog and make your own components. 

You don't need to mess with logical operators or setting registers and such. 
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: zapta on August 28, 2014, 08:29:59 pm
I hate to keep sounding like a shill for Cypress but I think this is where the PSoC really shines.  You can configure the chip and give your pins names and set them as I/O's and such.  So a program to turn on an LED when a button is pressed becomes

Can you describe the development environment. Is it free, does it run on Linux/Mac, is it a single package install, does it have decent features (GUI, C code cross reference, debugger, etc).  Cypress is not that popular for ARM (I am relying on that graph in the other PIC vs ARM thread) but maybe just as good. I already got a ST board, then switched to NXP but wouldn't mind to try another one.

OP, another option you have is to wait for the upcoming Arduino ZERO (ARM based) or use the existing Arduino DUE (also ARM based).
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on August 28, 2014, 08:37:34 pm
Quote
Here's what I've got to wrap my head around:

A lot easier if you have a board to play with.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Corporate666 on August 28, 2014, 11:50:52 pm
I hate to keep sounding like a shill for Cypress but I think this is where the PSoC really shines.  You can configure the chip and give your pins names and set them as I/O's and such.  So a program to turn on an LED when a button is pressed becomes

Can you describe the development environment. Is it free, does it run on Linux/Mac, is it a single package install, does it have decent features (GUI, C code cross reference, debugger, etc).  Cypress is not that popular for ARM (I am relying on that graph in the other PIC vs ARM thread) but maybe just as good. I already got a ST board, then switched to NXP but wouldn't mind to try another one.

OP, another option you have is to wait for the upcoming Arduino ZERO (ARM based) or use the existing Arduino DUE (also ARM based).

-As far as I know it's Windows only (although it seems to run fine under wine, etc)

-It's 'free'.  I put that in quotes, because you get a license for the Keil C compiler free with the software, but each year you have to re-register and get emailed a code

-Single package to install everything, although it does install the "PSoC Programmer" which the IDE uses to program the chips.  The programmer can be run separately if you just want to program a chip, it doesn't need the IDE even installed

-I don't have a ton of experience with different IDE's, but I really like the PSoC IDE.  There is two... PSoC Designer and PSoC Creator.  Designer is only for the old legacy PSoC1 product.  Creator is for PSoC3, 4 and 5.  There is a world of difference between the two... Creator and PSoC3/4/5 is how you would design a SoC if you were starting from scratch.  Designer is how it would be done if you were trying to kludge some PLD stuff onto an MCU.  Which is pretty much exactly how it went... PSoC3/4/5 are clean-sheet designs.  PSoC1 is the first iteration from many years back.  The Creator IDE supports full debugging - breakpoints, memory location and variable watches, stepping into and through code blocks, etc.  All of that is supported in the PSoC3/4/5 chips without any debug versions or external hardware required.  I find the GUI itself pretty good but again I don't have a ton of experience.  I'd say it's easily better and more powerful than the Atmel IDE (the only other one I have much experience with). 


I still have an NXP board sitting around that I never got to... maybe some day when I get more time :)  Like I said, the great thing about the PSoC is the chips are sort of like a canvas, and you drag-and-drop the peripherals you like.  I have a PSoC3 with 30 PWM's on it controlling an LED array.  I've got others where I messed up my board layout and accidentally ran signals to the wrong pins but was able to just reconfigure my peripherals to run on those pins instead - saved my ass a few times.  Cypress is always coming out with new libraries/peripherals too... so they have stuff like UART's, DMX controllers, various LED lighting and color mixing methods (including color correction through optical feedback), etc.  It sounds complex, but for example if you want to measure temperature, they have a temperature object you drag and drop into your design, configure it (i.e. pin to read from, range, etc) and then you get a full API and can just say "if (myTemp.CurrentTemperature > 50)" instead of having to calculate anything or scale ADC values, or even having to know how to use an ADC in the first place.

I started with PSoC1 which had a lot of quirks and bugs.  PSoC3 was like driving a Lambo when all you've driven before was a 1984 Ford with 200,000 miles.  PSoC1 there is a single GPIO interrupt for read or write that runs for all pins.  PSoC3/4/5 you just drag and drop a pin component onto your design, drag and drop an interrupt component... double click and set the pin to input, pulled low and "interrupt on high" and draw a line to the interrupt component, then add your code to the C file the interrupt component created and you're done. 

That PSoC dev kit I posted earlier CY8CKIT-049-42XX was something like $5 from Cypress and the IDE is free.  If you're at all interested, I'd give it a shot.  I fell in love with these chips and I use them whenever I can unless I *really* have to use something else.   And even then, Cypress is pretty cool to work with... I was using a competing chip for $0.29 and the cheapest PSoC was $1.10.  They said "no problem, we'll drop your price to $0.29". 
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 29, 2014, 12:23:33 am
Just to add one thing, Creator 2.0 and Creator 1.0 where open sourced and you can download it (haven't done that myself) the current one Creator 3.0 doesn't seem to be open source but I haven't burn the CD image so maybe, since the iso is way bigger than the installable app.

The source provided supports ARM and the 8051 so it should have support for the PSoC4 at least and maybe to the PSoC5 (not the 5LP that substituted the 5).

Not sure what chips Creator 2.0 supports or how the IDE differs since I've been only using it since Creator 3.0.
Also not it's C only but I believe there is a work around to enable C++, but haven't had a need to do so yet.

Creator 3.0 will export the projects to eclipse kiel and some other, don't recall.

It does have an internal regulator too and it can operate in different power mode configurations, check the datasheet for details, at least this is for the 4200 series haven't looked at the details of the 5LP yet.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 29, 2014, 12:50:19 am
Miguelvp:

What website do I visit if I want to buy the Smartboards you mentioned in your helpful post?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 29, 2014, 01:13:39 am
http://www.schmartboard.com/index.asp?page=products_dev (http://www.schmartboard.com/index.asp?page=products_dev)

but they seem to be back order :(

Details:
http://www.schmartboard.com/index.asp?page=products_dev&id=652 (http://www.schmartboard.com/index.asp?page=products_dev&id=652)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 29, 2014, 01:42:05 am
There are also others:

http://www.cypress.com/psoc5lp/?source=CY-ENG-HEADER (http://www.cypress.com/psoc5lp/?source=CY-ENG-HEADER)

click under kits and you'll see third party kits, but the smartchboard looked like the best of the bunch.

but you can get a PSoC 4200 prototyping board for just $4 + shipping (will cost more than the boards)
Edit: shipping is $4 for 2 day fedex in the US.

http://www.cypress.com/?rID=92146 (http://www.cypress.com/?rID=92146)

The 4100 in there doesn't have analog but has programmable digital, the 4200 has both.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: zapta on August 29, 2014, 01:58:28 am
Corporate666, thanks for the detailed information. Just look at some of their chips. The ones with larger flash (128k, 256k) seems to be on the expensive side. This one though looks very interesting http://www.digikey.com/product-detail/en/CG7999AA/CG7999AA-ND/4729049 (http://www.digikey.com/product-detail/en/CG7999AA/CG7999AA-ND/4729049)  $1 in unit quantities, 32K flash, 4K RAM, 48Mhz.

I am doing all my computing on a small 11" Mac OSX that I carry everywhere. I would hate to have to use a different computer for the IDE. Arduino, LPCExpress and Eagle give single package installs that run natively on my computer. I wish Cypress would do the same.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 29, 2014, 02:29:01 am
This one though looks very interesting http://www.digikey.com/product-detail/en/CG7999AA/CG7999AA-ND/4729049 (http://www.digikey.com/product-detail/en/CG7999AA/CG7999AA-ND/4729049)  $1 in unit quantities, 32K flash, 4K RAM, 48Mhz.

That will be the QFN that cypress offers for also $1 no minimums and free shipping worldwide:

http://www.cypress.com/?id=2218 (http://www.cypress.com/?id=2218)

I ordered 20 of the QFN by mistake They came on nice cases with 6 each and one with just 2. I wanted the SSOP, so I reordered 10 of the SSOP and 10 QFP

I'll use the QFNs eventually but the QFP has 4 extra pins and the SSOP has less but easier to solder :)

Edit: the $1 per chip offer expires at the end of September btw.

http://www.cypress.com/events/?event=psoc4promotion&utm_source=Homepage&utm_medium=Banner&utm_campaign=PSoC4USD1 (http://www.cypress.com/events/?event=psoc4promotion&utm_source=Homepage&utm_medium=Banner&utm_campaign=PSoC4USD1)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: zapta on August 29, 2014, 02:33:31 am
That will be the QFN that cypress offers for also $1 no minimums and free shipping worldwide:

http://www.cypress.com/?id=2218 (http://www.cypress.com/?id=2218)

I ordered 20 of the QFN by mistake They came on nice cases with 6 each and one with just 2. I wanted the SSOP, so I reordered 10 of the SSOP and 10 QFP

I'll use the QFNs eventually but the QFP has 4 extra pins and the SSOP has less but easier to solder :)

Edit: the $1 per chip offer expires at the end of September btw.

http://www.cypress.com/events/?event=psoc4promotion&utm_source=Homepage&utm_medium=Banner&utm_campaign=PSoC4USD1 (http://www.cypress.com/events/?event=psoc4promotion&utm_source=Homepage&utm_medium=Banner&utm_campaign=PSoC4USD1)

I see, this is a special limited time price. Too good to be true, though the 32K flash is on the low side.

BTW, nothing wrong with QFNs. You can solder them by hand. You just need good tacky flux, thin solder tip and some magnifier.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 30, 2014, 12:24:17 am
I see, this is a special limited time price. Too good to be true, though the 32K flash is on the low side.

BTW, nothing wrong with QFNs. You can solder them by hand. You just need good tacky flux, thin solder tip and some magnifier.

So I got the chips today, the SSOPs came in a small tube section cut to length.
The QFPs however came in a big ass tray (8x20) with a supporting tray on top (also 8x20) to keep the chips in place, all that to ship just 10 chips in a package that could hold 160 chips securely. They sure loose money on these, since they are pretty much shipped as samples instead of production. I was expecting the QFPs to come on the same type of packaging ast the QFNs, on little cases holding 6 each.

Edit: They all came (SSOP, QFN & QFPs) in vacuum sealed antistatic thick non translucent bags, each with humidity indicators to indicate if you need to bake the parts if exposed to too much humidity.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Kjelt on August 30, 2014, 11:24:51 am
That,s because the whole free shipping sample system is intended for businesses that will buy hundred of thousands , millions if the chip is used in their products.
Not for hobbieists that use ten of them in their gadgets.
Each semicon company has their own way of doing this, if you are an active member and part of a big company with a lot of sales you are asked actively if they can ship you their newest $200+ dev board for free ;) unfortunately another of my colleagues has this opportunity, leaving the rest of us often drooling about all the goodies he gets.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on August 30, 2014, 07:19:30 pm
Can anyone tell me the advantage (disadvantage is cost=$99) CY8CKIT-002 PSoC® MiniProg3 to start work with the
PSOC4200 eval kit even though it has already a built-in USB interface to program?

Is it that I could have use of more program code space because I would not need bootloader code with the MiniProg3?

Would the MiniProg3 allow me to  compile and program and debug the PoSC4200 much quicker?

Much easier to program the breakout part of the project eval board once it is already soldered into a project?

What is the size of the bootloader..since the whole program max is 32K ?

Is there a chance this same MiniProg3 device could be also used with PoSC 5xxx series later on?





Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 30, 2014, 08:39:01 pm
Can anyone tell me the advantage (disadvantage is cost=$99) CY8CKIT-002 PSoC® MiniProg3 to start work with the
PSOC4200 eval kit even though it has already a built-in USB interface to program?
The MiniProg3 (which I don't have) allows you not only to deploy the code without the bootloader but it also allows yo to directly program and debug your code. The bootloader approach won't let the IDE step through code.

I do have a Pioneer dev kit ($25) that has a 4200, it uses also a 5LP programmed to be the debugger interface so it allows me to step and deploy code as if I was using the MiniProg3. At $90 I can live with using that to debug code and use the prototype boards without being able to step through the code.
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107202;image)
On the MiniProg it will say MiniProg3 instead of KitProg.
Edit: No idea if I could use the Pioneer to program the prototype kits, that would be cool if I could get a programming header that is compatible, will have to look into the pioneer datasheet since it has a lot unpopulated headers including the 5LP programming header.

In action:
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107204;image)
More info on the MiniProg3 and alternatives:

http://www.cypress.com/?rID=38154&source=shop (http://www.cypress.com/?rID=38154&source=shop)
http://www.cypress.com/?rID=2543 (http://www.cypress.com/?rID=2543)
http://www.cypress.com/?id=4&rID=52895 (http://www.cypress.com/?id=4&rID=52895)

Is it that I could have use of more program code space because I would not need bootloader code with the MiniProg3?

The nice thing about PSoC modules is that they include datasheets, and of course the bootloader has it's own datasheet, here is the relevant part about resource usage. So my understanding is yes, you will have more space and no need for the bootloader, but I only have the pioneer kit programmer to base my answer on.
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107206;image)
Would the MiniProg3 allow me to  compile and program and debug the PoSC4200 much quicker?
Yes, actually you can only debug if using the MiniProg3.

Much easier to program the breakout part of the project eval board once it is already soldered into a project?
Not sure if easier. You can use the USB-UART left over part and use it to program the device, but you can also use the 5 pins reserved for the miniprog.
One thing, in order to program it via the USB-UART you have to hold reset while powering it on, so it will be easier with the miniprog.

What is the size of the bootloader..since the whole program max is 32K ?
Look on the attached picture above.


Is there a chance this same MiniProg3 device could be also used with PoSC 5xxx series later on?

Yes it supports the 5LP and will think future products and non cypress devices as far as I know.

repeated link from above: (edit fixed to be the right one)
http://www.cypress.com/?rID=2543 (http://www.cypress.com/?rID=2543)

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on August 30, 2014, 08:48:49 pm
Quote
ship you their newest $200+ dev board for free

A co-worker of mine had a drawer full of a USB stick (90usb1287 I think) that reps for atmel handed out to him. They were retailing for a lot, particularly during the ps3 jailbreak days.

Quote
cost=$99

That's two dinner plates for me -> lots of money.

If I were you, I would go back, look at the suggestions provided before and ask yourself how sure you are that this will work out for you. If you aren't 100% sure, it may make sense to go with a lower cost approach -> I wouldn't lay out more than my lunch money for this.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 30, 2014, 09:51:09 pm
It's $90 but yeah a bit pricey that's why I decided to live without it.

But they have plenty of information about programming the devices with SWD.

PSoC 4 CY8C41XX, CY8C42XX Programming Specifications pdf includes details on SWD (Serial Wire Debug).
http://www.cypress.com/?rID=78468 (http://www.cypress.com/?rID=78468)

Equivalent docs for 3 and 5 series:
PSoC® 3 Device Programming Specifications (CY8C32xxx, CY8C34xxx, CY8C36xxx, CY8C38xxx CY8CTMA39x, CY8CTMA8xx, CY8CTMA6xx)
http://www.cypress.com/?rID=44327 (http://www.cypress.com/?rID=44327)

PSoC® 5 Device Programming Specifications (CY8C52xxx, CY8C53xxx, CY8C54xxx, CY8C55xxx)
http://www.cypress.com/?rID=46790 (http://www.cypress.com/?rID=46790)


That doesn't mean that it will be easy to roll your own SWD programmer, but in theory you can use one of the breakout boards to implement a compatible programmer.

On the bootloader approach here are more links:

AN73854 - PSoC® 3, PSoC 4, and PSoC 5LP – Introduction to Bootloaders
http://www.cypress.com/?rID=56014 (http://www.cypress.com/?rID=56014)

More info about the bootloader:
http://www.cypress.com/?rID=50230 (http://www.cypress.com/?rID=50230)

Also you can roll your own using an external micro (including another 4200)
AN73054 - PSoC® 3 and PSoC 5LP Programming Using an External Microcontroller (HSSP)
http://www.cypress.com/?rID=57435 (http://www.cypress.com/?rID=57435)

It doesn't touch the 4 series but should be about the same, also I didn't look in the zip files to see what implementations they have and if they will be compatible with the PSoC Creator 3.0. Well decided to take a peak and they do have a PSoC Creator 2.0 SP1 project for both chips including the SWD code. But didn't play with it. Of course the USB to the programmer might need to be implemented unless it's there already.

There is one for the 4 series as well:
http://www.cypress.com/?rID=81013 (http://www.cypress.com/?rID=81013)

Edit: What do you know, they have the code in there to use the pioneer to program the built in PSoC 4, and of course there is a 12 pin header for the PSoC 5LP so I could change the SWD pins to go to the external header instead. hmmm maybe I will try to see if I can program/debug the 4200 prototype board with the pioneer.

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107244;image)

The problem with Cypress is that they offer a ton of information and the shear amount is a bit overwhelming. Not really a problem because poor documentation will be worse.

So dannyf is right, it all depends how much you want to commit to the chip
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: 22swg on August 30, 2014, 09:57:12 pm
Posts below all seem expensive for a tryout exercise  ... I moved from MC 8 bit to 16 with the microstick 2  ( and asm to C )
http://uk.farnell.com/microchip/dm240013-2/pic24f-k-series-5v-usb-dev-board/dp/2311907?ref=lookahead (http://uk.farnell.com/microchip/dm240013-2/pic24f-k-series-5v-usb-dev-board/dp/2311907?ref=lookahead)

Basically all you need  to code . program and debug @5V   I eventually swapped the pic to PIC24FV32KA302 here used with USB / serial BOB to develop snippets of code to paste into projects .
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: westfw on August 30, 2014, 10:26:54 pm
I think that those "Pioneer" boards ($25-30) are the happy compromise between the CPU breakout boards (which would be OK for embedded a PSOC4 in a project) and the $100 debugger full "eval kits."  I'm pretty sure you're supposed to be able to use the Pioneer to debug other PSoC chips...
http://www.cypress.com/?rid=77780 (http://www.cypress.com/?rid=77780)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 30, 2014, 11:18:13 pm
I think that those "Pioneer" boards ($25-30) are the happy compromise between the CPU breakout boards (which would be OK for embedded a PSOC4 in a project) and the $100 debugger full "eval kits."  I'm pretty sure you're supposed to be able to use the Pioneer to debug other PSoC chips...
http://www.cypress.com/?rid=77780 (http://www.cypress.com/?rid=77780)

Not directly because there is no source for the kitprog image that comes burned into the 5LP, at least they have the image so you can recover it to factory default.

I just added a 5 pin header to one of the prototype boards and I'm going to modify the code to use the 12 pin header hooked to the 5LP to try to program/debug the prototype board.
AN84858 - PSoC® 4 Programming Using an External Microcontroller (HSSP)
http://www.cypress.com/?rID=81013 (http://www.cypress.com/?rID=81013)

But I don't think that code has debugging capabilities, as it's not the kitprog code, we'll see. But even if I can use it to program it it might be possible to use that code base to make a full fledged programmer/debugger.



Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 31, 2014, 12:19:09 am
So It works as a programmer but after configuring the PSoC5LP in the pioneer kit, it only shows as a communication port, because the code just seems to wait for a key to program the chip.

But the cool thing is that it does succeeds to program it after I changed the pins to use the external header instead of the built in 4200

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107258;image)

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107256;image)

Edit: the sample has the hex image in the code so there is no communication from the PC, but all the bits are kind of there, source to the KitProg would be ideal.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 31, 2014, 12:54:23 am
Hold the presses:

PSoC 5LP Programmer Firmware

http://www.element14.com/community/thread/27067/l/psoc-5lp-programmer-firmware (http://www.element14.com/community/thread/27067/l/psoc-5lp-programmer-firmware)

With KitProg version 2_03 code :)

Will try that next and update if it works.

Edit: read the comments on that thread, specially the last one with updated code.
Edit2: and also it's worth while to not that they say in the post to feel free to copy the PSoC 5LP portion of the pioneer since the schematics and board layout for the pioneer is available as well from Cypress. They keep on impressing me more.
One thing is that you don't want to upgrade the bootloader when it loads or it fails to compile, still trying to compile it.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 31, 2014, 02:19:45 am
It compiles and works programming the included PSoC4200 on board

Not only that but it has code implementation for the HID interface to the PC.
Now to alter the code to use the external pins instead.

Edit: seems there are some pin definitions hidden within the program, the AN84858 example before did the same as noted in the diagram:

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107244;image)
But I can't seem to find them. It shows the KitProg interface but no board attached to it.

Edit: I'm finding them but they are a bunch of defines of defines so it might take a while since there are dependencies and assuming pin order so I can't use the macros for non sequential pins. But it seems doable.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 31, 2014, 05:08:56 am
So because of "AN84858 - PSoC® 4 Programming Using an External Microcontroller (HSSP)" the program uploaded to the prototype board lost the bootloader, so I can only program it via that program or get a miniprog 3 or figure out how to do it with the kitprog source.

But there is another way. You can also use another prototype board to program it and restore the bootloader:

http://www.cypress.com/?id=4&rID=98796 (http://www.cypress.com/?id=4&rID=98796)

Note that you can't debug with this method so I'll have to pursue the pioneer route.

It's late so I think I'll resume later but I have a busy day tomorrow but I have Monday and Tuesday off, so hopefully it's done by then.

The MiniProg3 looks cheaper the more time I put into this other than I'm having fun figuring out the details on these MCUs.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: 22swg on August 31, 2014, 08:05:45 am
Thought I would post a MPLAB  X (2.15) screen shot of microstick 2 in action.  mainly to show the debug , SFR views ,  this is the paused shot of trying to understand the workings of the AD. I'm still in a learning phase .
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: nctnico on August 31, 2014, 09:43:33 am
Posts below all seem expensive for a tryout exercise  ... I moved from MC 8 bit to 16 with the microstick 2  ( and asm to C )
http://uk.farnell.com/microchip/dm240013-2/pic24f-k-series-5v-usb-dev-board/dp/2311907?ref=lookahead (http://uk.farnell.com/microchip/dm240013-2/pic24f-k-series-5v-usb-dev-board/dp/2311907?ref=lookahead)

Basically all you need  to code . program and debug @5V   I eventually swapped the pic to PIC24FV32KA302 here used with USB / serial BOB to develop snippets of code to paste into projects .
The problem is that if you look for a cheap solution you may end up with a solution which isn't optimal. I've spend quite a lot of money on self made boards with ARM controllers from NXP and ST just to try them out in a 'real' circuit. OTOH I have used most of those boards in various prototypes/projects so they did pay for themselves in the long run.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: westfw on August 31, 2014, 09:48:06 am
About that "easiest" in the title...

With greater power comes greater complexity, almost always.  So a "greater" CPU is going to be somewhat harder.  Which means perhaps the question should be "which "harder things" are not too hard, or most interesting, or most valuable to learn next", where "most valuable" probably means "of general use on a lot of CPUs in that class", rather than something that is really specific to a particular family.

With that re-wording, I'm not sure that the PSoC is a good choice.  It has unusual (user-defined) peripherals (sort-of, more-or-less?)

(The biggest thing to get used to in most 32bit architectures is the way that they have a single HUGE address space, and will throw big chunks of memory space at each peripheral.  "GPIOA appears on both a moderate speed and a high speed bus, and has 256 WORDS of address space in each that are used to allow bit-specific addressing.  In addition, both of those address spaces also appear in bit-band regions, which gives you a different sort of bit-specific addressing."  (TI Tiva example.))
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: 22swg on August 31, 2014, 10:43:18 am
Agree , cheap is not the first option.. The microstick 2 would appear to fit most of suzyc's  shopping list  and at < 20GBP would not be a disaster if eventually rejected . it has some drawbacks as do most dev systems MPLAB X is one of them, but it did work first time and someone with good C , should be able to develop projects quickly and  not be fighting IDE / bootloader / device compatibility issues....   
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Kjelt on August 31, 2014, 12:18:59 pm
@Suzy
looking at it from a starters point of view you might want to check out this free book which practically runs you through starting up an IDE environment, RTOS etc. and practical examples of running peripherals and external hardware. It is based on the STM32Fxxx processors but that is not a bad thing if you look at it from a cost point of view. All the required hardware and demoboards in the book will cost you $50 and you are ready set and go.
It will keep you busy some time to get to know the Arm controller and afterwards you might be better able to make a decision on what manufacturer you will make your own boards/hardware.

Discovering the STM32 Microcontroller , Geoffrey Brown
www.cs.indiana.edu/~geobrown/book.pdf (http://www.cs.indiana.edu/~geobrown/book.pdf)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 31, 2014, 01:58:13 pm
By all means using the MiniProg 3 will get rid off any problems. I'm just playing with doing it the cheap way but there are no compatibility issues at all with the proper tool.

And once you use it with all of their ready to use and well documented programmable Analog and Digital components, it will save you a lot of headaches.

You can take a look at their components datasheets:
http://www.cypress.com/?app=search&searchType=advanced&keyword=&rtID=377&id=1353&applicationID=0&l=0 (http://www.cypress.com/?app=search&searchType=advanced&keyword=&rtID=377&id=1353&applicationID=0&l=0)

If you look at the pioneer schematic, the only thing you need to implement a full HID USB interface with the 5LP is 3 diodes 3 resistors a cap and two pins on the chip. All the code and configuration is available.

http://www.cypress.com/?rID=48924 (http://www.cypress.com/?rID=48924)

Edit: and that is available for the PSoC 3 too, not for the PSoC 4, here is what the PSoC 4 offers as components:
http://www.cypress.com/?app=search&searchType=advanced&keyword=&rtID=377&id=4749&applicationID=0&l=0 (http://www.cypress.com/?app=search&searchType=advanced&keyword=&rtID=377&id=4749&applicationID=0&l=0)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: nctnico on August 31, 2014, 02:32:03 pm
Those PsoC devices sound really nice. I think I'll look into those if I have some time to spare.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on August 31, 2014, 03:32:11 pm
My local MicroCenter had two of the Schmartboard 5LP dev boards. Now they have one :)

http://www.microcenter.com/product/419393/PSoC_5LP_Development_Board_with_Boot_loaded_PSoC_5LP_IC (http://www.microcenter.com/product/419393/PSoC_5LP_Development_Board_with_Boot_loaded_PSoC_5LP_IC)

And it has one of the higher end 5LPs that sells for $13 quantity one

http://www.cypress.com/?mpn=CY8C5868LTI-LP039 (http://www.cypress.com/?mpn=CY8C5868LTI-LP039)

It's also available at Amazon:
http://www.amazon.com/Schmartboard-PSoC-Development-Board-loaded/dp/B00HKJW1RO (http://www.amazon.com/Schmartboard-PSoC-Development-Board-loaded/dp/B00HKJW1RO)

Ok, so I guess I'll take it all back about the schmartboard, lucky for me MicroCenter didn't have it even if they said they had two in stock.

https://www.eevblog.com/forum/microcontrollers/review-schmartboard-710-0008-05-psoc5lp-development-board-first-impressions/ (https://www.eevblog.com/forum/microcontrollers/review-schmartboard-710-0008-05-psoc5lp-development-board-first-impressions/)

So I might still get it, but be prepared to retouch the crappy soldering job.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: nctnico on August 31, 2014, 06:41:14 pm
My local MicroCenter had two of the Schmartboard 5LP dev boards. Now they have one :)

http://www.microcenter.com/product/419393/PSoC_5LP_Development_Board_with_Boot_loaded_PSoC_5LP_IC (http://www.microcenter.com/product/419393/PSoC_5LP_Development_Board_with_Boot_loaded_PSoC_5LP_IC)
You have physical shops selling these kind of boards? It makes me kind off sad the market for such gear seems pretty limited over here. I'd have to order from Farnell. Still I think I'd go design my own board and get that up&running but that is just me wanting to gets my hands as 'dirty' as possible.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: true on August 31, 2014, 07:30:41 pm
I think that those "Pioneer" boards ($25-30) are the happy compromise between the CPU breakout boards (which would be OK for embedded a PSOC4 in a project) and the $100 debugger full "eval kits."  I'm pretty sure you're supposed to be able to use the Pioneer to debug other PSoC chips...
http://www.cypress.com/?rid=77780 (http://www.cypress.com/?rid=77780)

Only other PSoC4 :)

I'm working on a project that will be using PSoC4, and the $1/unit deal was a big factor in choosing it. Finding some annoying limitations in practice but nothing that cannot be overcome. Overall I like the product.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 01, 2014, 02:58:13 pm
Quote
microstick 2

I looked at some documents for this thing. It is interesting in that it is a development board, debugger and programmer all in one: if you wire out the icsp pins, you *****may***** be able to program others chips using microstick.

Based on the schematic for the original microstik (1), the chips to be programmed are low-voltage types. No idea how / if the firmware is limited to just those chips provided with the stick.

Not sure if anyone has tried it. If true, it is another low-cost multi-purpose programmer for some PICs.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: 22swg on September 01, 2014, 08:12:28 pm
danny f   the USB interface half of microstick 2 seems to ba a Pickit3 clone , MPLAB reports it as that on loading , documentation says supports only PIC24 KA or KM , comes with KM but i found I got on better with KA  I seem to be swimming against the anything_uino flow, but once you sort of understand MC's mcu implementation its rewarding even fun to get PIC ideas / projects working ...If i could just finish one before i start the next ! ;D     
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 01, 2014, 08:35:33 pm
Interesting. Have you tried to use it to program other LVP-compatable PICs?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on September 01, 2014, 08:39:35 pm
Which ARM does best work to graduate to that has the economy of programming time, as well as the cost conveniences I have described

So far this thread is a perfect example of how everyone will try to convince that their particular favorite is The One. In reality there is a device which pretty much stands alone as cheapest and most popular ARM. A quick search on Ebay for "arm cortex board" (clicking on buy it now & lowest cost) will show what is virtually the only choice in the first few hundred listings. If you dont mind soldering, a small but perfectly functional development platform can be assembled in a minute or two for a dollar and change. For those who prefer to skip hardware DIY then the $7 board in those listings is ready to go. For mfg fanboys ST sells a compatible Discovery for about twice that. Because this is literally the "Most Common Arm Chip in the World" dozens of free toolchains are available. A fully functional ICE type debugger can be had for $5 from there too.

I'm sure someone will come along soon and challenge this assessment but mostly hacker types who insist on a new "chip of the day" each and every day. The more complicated and obscure the better. However overwhelming number of those listings tell the truth. I suggest Ebay, Aliexpress, TaoBao, and similar websites are an excellent weather vane for these kind of things.

BTW this is not my personal "favorite". ATM I'm satisfied with a completely different 8 bit platform and not particularly involved with ARM development. But did find it a bit thrilling to be able to program and flash an ARM device within 1 minute of download and debug/tracing few minutes later. YMMV (and probably will, often the best advice disappears in the noise).
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on September 01, 2014, 08:40:24 pm
Which ARM does best work to graduate to that has the economy of programming time, as well as the cost conveniences I have described

So far this thread is a perfect example of how everyone will try to convince that their particular favorite is The One. In reality there is a device which pretty much stands alone as cheapest and most popular ARM. A quick search on Ebay for "arm cortex board" (of course clicking on buy it now & lowest cost) will show what is virtually the only choice in the first few hundred listings. If you dont mind soldering, a small but perfectly functional development platform can be assembled in a minute or two for a dollar and change. For those who prefer to skip hardware DIY then the $7 board in those listings is ready to go. For mfg fanboys ST sells a compatible Discovery for about twice that. Because this is literally the "Most Common Arm Chip in the World" dozens of free toolchains are available. A fully functional ICE type debugger can be had for $5 from there too.

I'm sure someone will come along soon and challenge this assessment but mostly hacker types who insist on a new "chip of the day" each and every day. The more complicated and obscure the better. However overwhelming number of those listings tell the truth. I suggest Ebay, Aliexpress, TaoBao, and similar websites are an excellent weather vane for these kind of things.

BTW this is not my personal "favorite". ATM I'm satisfied with a completely different 8 bit platform and not particularly involved with ARM development. But did find it a bit thrilling to be able to program and flash an ARM device within 1 minute of download and debug/tracing few minutes later. YMMV (and probably will, often the best advice disappears in the noise).
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 01, 2014, 08:56:55 pm
Googling microstick and pickit3 yields this link: https://www.youtube.com/watch?v=RkUUCvDYslI (https://www.youtube.com/watch?v=RkUUCvDYslI)

So it does seem that you can use the stick to program other chips - PIC24F/KL in his case.

It is just an unknown at this point how restrictive the firmware is.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: 22swg on September 01, 2014, 08:57:38 pm
Danny , No I have sort of stopped my mcu philandering at PIC24  you probably know PK3 has to download a device AP so it would rely on some embedded restrictions with the microstick 'starter kit'  see no reason why it could not jumper it to an external device... but i dont have many other PIC flavors at the moment.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: 22swg on September 01, 2014, 09:01:48 pm
Danny Re your link...  And I bought a second PK3  :palm:
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: zapta on September 01, 2014, 09:16:03 pm
[So far this thread is a perfect example of how everyone will try to convince that their particular favorite is The One. In reality there is a device which pretty much stands alone as cheapest and most popular ARM. A quick search on Ebay for "arm cortex board" (clicking on buy it now & lowest cost) will show what is virtually the only choice in the first few hundred listings.

Ok, so this is a cheap minimal board. How does this qualify to be 'easiest to graduate to'?  I don't see in these ebay listing any schema, tools, libraries, examples, manual, nothing. If you claim that it's easy to graduate to this chip you need to provide more information because it's not obvious.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Kjelt on September 01, 2014, 09:20:12 pm
See the free book i posted a  page back, all you need to know to start with those stm32f103 boards  ;)
If you dont use that book you need the forum each time you,re stuck
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on September 01, 2014, 09:36:31 pm
Ok, so this is a cheap minimal board. How does this qualify to be 'easiest to graduate to'?  I don't see in these ebay listing any schema, tools, libraries, examples, manual, nothing. If you claim that it's easy to graduate to this chip you need to provide more information because it's not obvious.

It's not common for Ebay listings to contain all technical info for all components in the product. Maybe a link or two if you're lucky. These guys want to sell not hold hands. A message to them does often get you on track however. Those with a little experience might know to google the part number. When I did so there were literally hundreds of schematics for that board. Also available from ST since it is basically the reference design for that part.

As far as libraries and examples ST is again the place to go. How else would I be able to download examples within a minute of receiving the board? Or maybe you just didn't believe me. Anyway several different GCC packages are available with various "shells' like Eclipse. Since this was not of extreme interest at the time I took the bare-metal/CL approach and was rewarded with the ability to write and test code withing minutes instead of months. So again, Google is your friend.

If enough interest is shown it might be possible for me to put together a presentation similar to the one at my local ham club that got everyone going so quickly. A mind blowing experience aftr reading all the baloney. I think most here are so brainwashed by the "no pain no gain" line it's virtually impossible to imagine there's an easier way.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on September 01, 2014, 09:53:35 pm
@Suzy
Discovering the STM32 Microcontroller , Geoffrey Brown
www.cs.indiana.edu/~geobrown/book.pdf (http://www.cs.indiana.edu/~geobrown/book.pdf)

Yikes! Where did that come from?

A couple guys at the club did have a Discovery board but I didn't quite appreciate at the time. I knew it had STM32f but see now that one of the MCUs is actually the STM32F103. Being a huge cheapskate I took the $1 approach instead. Browsing that book you linked it's excellent and going to be a great hit at the next meeting. Thanks. I might have taken this a bit more seriously if I knew it existed. Maybe follow my own google advice better.

Basically I'm a PIC dude and admit to being slave to the almighty Microchip Corporation. Old habits... but I must say it's nice being able to buy dozens of download interfaces or several  STM32 debuggers for what my one PICkit2 cost (no exaggeration). I was just trying to help Suze but maybe this is worth taking another look as a potential go-to chip for yours truly.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: zapta on September 01, 2014, 11:02:26 pm
If enough interest is shown it might be possible for me to put together a presentation similar to the one at my local ham club that got everyone going so quickly. A mind blowing experience aftr reading all the baloney. I think most here are so brainwashed by the "no pain no gain" line it's virtually impossible to imagine there's an easier way.

If you think you have an path to upgrade to ARM a writeup will be useful. So far I am not convinced that your cheap board is easier than other options. Saying that there are 'several tool chains' and 'use google' does not add confidence for the fitness of your board for easy upgrade.  Try to substantiate your claims.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on September 01, 2014, 11:38:05 pm
So far I am not convinced that your cheap board is easier than other options.

It's not "my" board and there is nothing magical about it or this particular chip. It's simply the most common and lowest cost option among hundreds. By a wide margin. Judging by those listing by an order or orders of magnitude. The procedure I mention is where the real trick lies. And it's not my invention. The tools have been mentioned and discussed in this forum many times over. It's the no-nonsense approach from one of the club members might benefit some who want to get into ARM with less clamor and fuss.

The batch files and linker scripts are still on my hard drive and just verified working with a single keystroke. To do this properly it will take a day or so to collect links and notes etc. and start a thread. I'm not sure it, or anything for that matter, will convince you based on previous comments:

Ok, so this is a cheap minimal board. How does this qualify to be 'easiest to graduate to'?

I gather your theory is that only the most "maximal" and overpriced boards fit that bill. However since you asked I'll see what I can do. Possibly others less (or maybe more) experienced might see an advantage. Imagine you are a rank beginner and try to keep an open mind with that perspective.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: nctnico on September 01, 2014, 11:42:52 pm
So far I am not convinced that your cheap board is easier than other options.

It's not "my" board and there is nothing magical about it or this particular chip. It's simply the most common and lowest cost option among hundreds.
As I wrote before: going for the cheapest board is usually a bad mistake. Cheap components are highly overrated. Better look for a component which gets the job done in a quick & easy way.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: zapta on September 01, 2014, 11:50:03 pm
I gather your theory is that only the most "maximal" and overpriced boards fit that bill.

You are making things up. An easy solution will have an out of the box working board + tools + examples.  Has nothing to do with board size of price. 


However since you asked I'll see what I can do. Possibly others less (or maybe more) experienced might see an advantage. Imagine you are a rank beginner and try to keep an open mind with that perspective.

Let see the substance. So far it was just claims and arrogance.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on September 02, 2014, 12:03:36 am
I'm sure someone will come along soon and challenge this assessment but mostly hacker types who insist on a new "chip of the day" each and every day. The more complicated and obscure the better.

Hmmmm... looks like I have superhuman ability to predict the future too.

Just to reiterate:

ARM hardware $1 and change.

Ability to start coding and flash in about a minute after downloading tools. In fact the package chosen is so compact this most likely includes  download time too.

$5 debug dongle (seen in a pic in the "ghetto" thread) also minutes to start tracing.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: westfw on September 02, 2014, 12:12:31 am
Quote
A quick search on Ebay for "arm cortex board" will show what is virtually the only choice in the first few hundred listings. If you dont mind soldering, a small but perfectly functional development platform can be assembled in a minute or two for a dollar and change.
got links?  I found lots of $7 STM32F103C8T6 boards but no bare chips or bare boards near the $1 price...

I'm with Zapta, though "cheapest" or "Most popular in an ebay listing" is a poor indicator of "easiest next step."  Not that the STM32F103C8T6 doesn't seem like a reasonable chip.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on September 02, 2014, 12:32:43 am
You are making things up.

It's easy to say that but a reasonable person might conclude my point that cheap boards can do the job fine is being challenged:

Ok, so this is a cheap minimal board. How does this qualify to be 'easiest to graduate to'?

As I wrote before: going for the cheapest board is usually a bad mistake. Cheap components are highly overrated. 

"cheapest" or "Most popular in an ebay listing" is a poor indicator of "easiest next step."

Keep in mind my reply was not to agitate hot-shots (apparently just an entertaining side effect) but in response to this request which, in addition to ease, did stress cost :

Which ARM does best work to graduate to that has the economy of programming time, as well as the cost conveniences I have described


As far as arrogance you probably meant too uppity for the post count. I'm not claiming to be an expert here. ATM 8 bit is my territory. My original introduction to ARM was to build a few dozen quad flight controllers based on this same chip as shown in the RCGroups link I put up in the other thread. No development experience at all until the club demo months later and even then it didnt pique my interest to start hacking. That book pdf is so well done I may be better able to cope with that possibility now.

Anyway like you imply, the proof is in the pudding. I know it would be great if I put up a half-assed thread so everybody and his brother could pounce. I'm going to do this right but it should only take a day or two. Maybe a couple pics of my version of the $1 fc when i get back tomorrow. Stay tuned.

ps. Wes, attached is a snapshot of the Aliexpress source I got my chips from. He's gone but there are dozens of others with similar pricing. They've been going up a few cents a week since the RCGroups thread but still under $1.60 ea afaik. The proto-boards in that photo&link I put up in the ghetto thread were 30-40 cents ea. Bottom line: less than $2 for fully functional dev platform.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 02, 2014, 02:20:40 am
Thanks again to everyone!


True:  What were those bothersome limitations with the PSoC4 board  that you've noticied?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Kjelt on September 02, 2014, 07:07:48 am
Yikes! Where did that come from?
A couple guys at the club did have a Discovery board but I didn't quite appreciate at the time. I knew it had STM32f but see now that one of the MCUs is actually the STM32F103.
Another tip for the club for the people that have a Discovery VL board with a STMF100: that chip  is a bit lame in RAM size so an RTOS will be troublesome.
BUT: hey ST sells pincompatible STM32F103's with much more RAM and ROM  ;)
Nice upgrade: buy a $3 STM32F103 and upgrade the DiscVL board.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: true on September 02, 2014, 07:11:17 am
Thanks again to everyone!


True:  What were those bothersome limitations with the PSoC4 board  that you've noticied?

Not with the board, just with the pin routing (not as "every pin can do everything" as they claim, and sometimes limitations depending on what is routed where, but honestly it's still way more configurable than other micros) and library size (10K flash eaten up with a couple of capsense buttons and a pwm, on a chip with 32K flash). And I haven't even started really developing the firmware yet, so I imagine this flash space will grow pretty rapidly as I use API and other library stuff...

BUT as long as you get over the steep curve of using the IDE to set up the higher-level stuff, it's super easy to develop for. While steep it isn't very long to be honest and Cypress does have some videos showing how to use it. All the built-in high level stuff has its own datasheets which are very easy to follow and understand. The API generation bit is novel but with how unique the PSoC is they can get away with things like this. And I don't think it's bad, in fact for a beginner it should make things pretty easy, but do remember it is a Cypress-ism so try not to get tied to it :) And capsense is ridiculously easy to get going.

It can also be comparatively difficult to develop for if you want it to be;for example making use of the UDBs for custom logic, but this isn't anything you need to touch unless you find a use for it. But if you do find a use it can be a very powerful thing. (I am using some for some custom logic and PWM stuff for my application, all done in hardware, without using any other chip resources or supporting firmware.) Debugger is expensive compared to many of the other ARMs discussed but Cypress provides source for their KitProg debugger and you can turn a $7-ish FX2LP devboard into a PSoC4 programmer, or do a really basic mod to a $30 Pioneer board. And they have the $4 sticks which while not as nice as ST (no debugger, but instead a USB-UART/I2C/more) are still dirt cheap. So a nice mixed bag :)

They also have micros at $0.29/qty1000 which although extremely limiting (one timer, I2C and I think slave only at that, no ADC, no UDBs, a other missing things) is really damn cheap if you are doing something really really basic. And again that's a 32-bit Cortex-M0.

But the PSoC4 itself is quirky compared to the rest of the line and it shows sometimes. It's also a bit limiting in some aspects as it's a relatively small line - no USB for example if that's a requirement, no CAN, a few other things that aren't in the product line. For many things though it's like any other micro.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on September 02, 2014, 01:28:07 pm
ST sells pincompatible STM32F103's with much more RAM and ROM  ;)
Nice upgrade: buy a $3 STM32F103 and upgrade the DiscVL board.

Or buy 10 for only a few dollars more. LOL. BTW note that there is already an STM32f103 on that board with pins to program it. A couple of my buddies have done this and it's a great way to break into the 32 bit world.

Notice to avoid hijacking this thread I've started a new one for my own version of minimum development ARM project: https://www.eevblog.com/forum/microcontrollers/one-dollar-one-minute-arm-development/ (https://www.eevblog.com/forum/microcontrollers/one-dollar-one-minute-arm-development/)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 02, 2014, 07:31:27 pm
Ture:  Wow, 10K of the 32k just for one PWM and not much else!

My program uses 2PWM, 6 A2D channels, Rotary Encoder (3-wire), IC2, LCD interface (4 PORTB bits), One moment. Sw, two debug bits, a diagnostic LED
[/size]

Can anyone tell me: What would this same config take in terms of program mem on a PSoC4?


My current project can configure two 16F88x PWM1 and PWM2 takes exactly145-bytes  of program mem.

Actual total code shown below to config and control 2 PWMs:   THIS CODE COMPILES SUCCESSFULLY
//---------------------------------------------------------------------------
#include  <htc.h>

__CONFIG(0x20F2);//CONFIG word 1 bit5=MCLRE=1=RESET PIN1, bit14,15 not used
                    //BOREN=SW CTRL   bit12=LVP=0 HV programming
                    //SBOREN SW CTRLD bit2:0 are OscType 010 for 20MHz Xtal
__CONFIG(0x3FFF);//CONFIG word 2  //LVBOREN BOR3V Enabled <2.1V BOR



static unsigned int        DCyc,DCyc1;


void PWM1Setup(void);
void PWM2Setup(void);



interrupt int_server(void)   
{
if (T0IF)      // TMR0 overflow flag, if set triggers IRQ  TMR0Clk=Clk/2
 { TMR0=17;    //Comp needed for 4Mhz, calibrates timer for 1uS/IRQ.
   T0IF=0;     //12 inst cycles IRQ Dly +5 cyles for tot=250 counts/IRQ x2uS

XitTimer:;
 } //------------------------------------------------

//SetDuCy:

CCPR1L=(DCyc>>2);
CCP1X=(DCyc & 2)==2; //bit1   of PWM (LSB 1)
CCP1Y=(DCyc&1);      //bit0   of PWM (LSB 0), 1024 duty cycle values

CCPR2L=(DCyc1>>2);
CCP2X=(DCyc1 & 2)==2; //bit1   of PWM (LSB 1)
CCP2Y=(DCyc1&1);      //bit0   of PWM (LSB 0), 1024 duty cycle values


}//-----end of Interrupt Handler---------------------------------------

//-------------------------------------------------------------------------
void main(void)
{
Resetit:;
  INTCON = 0;  // Interrupts disabled
  TRISC =0xB8; // UART TXD=RC6 input, RXD=RC7,RC5 for ROTENC
               // RC3,4 for i2c  cbit3, cbit4 will be used for i2c
               // i2c Clock cbit3 held low until ready, i2cinit() to receive
               // roten lines cbit5 cbit7 are high and ready
               //cbit1, cbit2 setup for PWM
  OPTION_REG=0x80; // div by 2 TMR0 prescaler. Turnoff weak pullups B0-B7
  T0IE=1;      // Enable TMR0 rollover IRQ
  TMR0=0;      // Must be set in IRQ routine for 100-uS IRQ's 20-Mhz Xtal
 
  T1CKPS0=1;   // Set TMR1 prescaler to div. by 8
  T1CKPS1=1;   // 0x03 = div. by 8 for 1.6uS counts with 20-MHz Xtal

  TMR0=0;      // Reset each IRQ, correction for 100-uS IRQ's with 20-Mhz Xtal
  TMR1ON=0;    // Disable TMR1 until started in IRQ routine
       
  PEIE=1;      // Must be 1 for ADIE(or any peripheral IRQ to be enabled)
  GIE=1;       // Global enable all unmasked IRQs

  PWM1Setup();
  PWM2Setup();

start:; //---------------------  START  ------------------------------

  DCyc1=500;
  DCyc=500;

  goto start;

}       // ==============  end of main()   ================= 



//====  PWM setup CCP1 cbit2   ====

void PWM1Setup(void) //CCP1 output cbit2 PWM setup
{
CCP2IE=0;

CCPR2H=0;
CCPR2L=0;     

TMR1IE=0;     // Disable TMR1 IRQ's
TMR1IF=0;

TMR2IE=0;
TMR2IF=0;               
T2CON=0b00000000;
PR2=0xFF; //19.53KHz  20Mhz  Highest PWM freq for 10-Bit Resolution

TMR2ON=1; //Turn on TMR2  used for duty cycle period
CCP1CON=0b00001100;  //Turn on PWM mode 0 Duty Cycle
}
//====   End of PWM1Setup   ====


//--------------------------------------------------------------------------


 void PWM2Setup(void) //CCP2 cbit1 setup
{

CCP2CON=0b00001100;  //Turn on CCP2 PWM mode with 0 Duty Cycle

}
//====   End of PWM2Setup   ====
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 02, 2014, 07:58:55 pm
Quote
Wow, 10K of the 32k just for one PWM and not much else!

If you want to get people to help you, make it easy for them to help. Posting for example a compilable piece of code would be the starting point.

Looking at your code, I would be surprised if the pieces get compiled to materially more than 1KB.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 02, 2014, 08:22:07 pm
dannyF: My apologies, now the code is exactly as compiled to configure two PWM's on a 16F88x

The above PWM config code compiles successfully, corrected omission of some actual var values.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on September 02, 2014, 09:13:28 pm
Ture:  Wow, 10K of the 32k just for one PWM and not much else!

I wouldn't call the capsense as not much else :)

But for example, this frequency meter
http://blog.hendriklipka.de/archives/2013/10/psoc_frequency_counter_1.html (http://blog.hendriklipka.de/archives/2013/10/psoc_frequency_counter_1.html)

uses this:
Flash used: 9054 of 32768 bytes (27.6 %).
SRAM used: 1540 of 4096 bytes (37.6 %).

This one with a single ADC and a single PWM:
http://www.element14.com/community/message/86076/l/psoc-4-pioneer-kit-community-project070-psoc-4-getting-started-lab-4-adc (http://www.element14.com/community/message/86076/l/psoc-4-pioneer-kit-community-project070-psoc-4-getting-started-lab-4-adc)

uses this:
Flash used: 3912 of 32768 bytes (11.9 %).
SRAM used: 236 of 4096 bytes (5.8 %).

You can download PSoC Creator and the sample code from 100 projects in 100 days
http://www.element14.com/community/thread/23736/l/100-projects-in-100-days (http://www.element14.com/community/thread/23736/l/100-projects-in-100-days)

And compile the projects to see what the memory footprint is. If you don't want to actually compile the project usually they are fully build and the build log will be included under

[projectname].cydsn\CortexM0\ARM_GCC_441\Debug\[projectname].log

And the usage will be at the end of the log.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: zapta on September 02, 2014, 09:35:15 pm
Using an ARM processor with 32K flash is like driving a Ferrari that has only two cylinders.  Sometimes it's good enough, sometimes it's not.  ;-)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: 22swg on September 02, 2014, 09:42:08 pm
Looking at the frequency counter code



#include "device.h"
#include "tinyprintf.h" // normal stdlib won't fit in flash
on Creator 2.2
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 02, 2014, 09:48:15 pm
Quote
The above PWM config code compiles successfully, corrected omission of some actual var values.

Maybe you want to post the PIC24F code that yields 10K flash.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 02, 2014, 09:52:39 pm
Quote
Flash used: 9054 of 32768 bytes (27.6 %).
SRAM used: 1540 of 4096 bytes (37.6 %).

The frequency meter i wrote for a pic24f compiles to 1812 bytes flash and 24 bytes of sram.

It drives a 16x2 lcd as well.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on September 03, 2014, 12:17:16 am
Yeah, it's the price for all the configuration options and supporting code for the configurable modules, it does seem resource hungry.

BTW the 10K of code it was on the PSoC not on PIC24F.

So even if the PSoCs are nice chips the price you pay for all those programmable blocks are in resources.

The 5LP are way better with 256K of flash and 64K of SRAM but as resource hungy, the progkit source for the pioneer board that makes the PSoC 5LP into a programmer debugger uses the following resources:

Flash used: 73630 of 262144 bytes (28.1 %).
SRAM used: 22789 of 65536 bytes (34.8 %).

So the ease of configuring the device does come at the price of resources.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 03, 2014, 12:32:08 am
Quote
My current project can configure two 16F88x PWM1 and PWM2 takes exactly145-bytes  of program mem.

A quick test on pic24f:

program overhead only (start-up + my house keeping): 1155 bytes;
program overhead + 5 channel pwm: 1215 bytes.
= 5 channel pwm only: 60 bytes.

mcu utilization: 0% - the pwm generation is entirely hardware and takes away no mcu processing power.

Total line of code: 6 lines;
Total time to code: 20 seconds - conservative estimate, :)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 03, 2014, 01:43:39 am
Quote
My program uses 2PWM, 6 A2D channels, Rotary Encoder (3-wire), IC2, LCD interface (4 PORTB bits), One moment. Sw, two debug bits, a diagnostic LED[/size]

My estimates, on a pic24-class mcu:

2pwm: 20 bytes;
a2d: 100 bytes;
rotary encoder: 150 bytes (via interrupt. otherwise, 50 bytes);
ic2: not sure what it is;
lcd: 1.5kb;

For a total 2KB + 1KB of overhead.

Call it 4KB to be conservative.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on September 03, 2014, 06:11:46 am
So because of "AN84858 - PSoC® 4 Programming Using an External Microcontroller (HSSP)" the program uploaded to the prototype board lost the bootloader, so I can only program it via that program or get a miniprog 3 or figure out how to do it with the kitprog source.

But there is another way. You can also use another prototype board to program it and restore the bootloader:

http://www.cypress.com/?id=4&rID=98796 (http://www.cypress.com/?id=4&rID=98796)

Note that you can't debug with this method so I'll have to pursue the pioneer route.

It's late so I think I'll resume later but I have a busy day tomorrow but I have Monday and Tuesday off, so hopefully it's done by then.

The MiniProg3 looks cheaper the more time I put into this other than I'm having fun figuring out the details on these MCUs.

I didn't get the pioneer to act as a debugger, however I got the pioneer to act as a programmer and I restored the bootloader on the prototype board. Normally this is only possible with the miniprog (and probably easier) but they have a program that takes the hex load file to create a C source for the HSSP code mentioned that made it loose the bootloader.

It was my only 4200 prototype board and if I had another one I could have use it to program the other one as well, but the 2nd one I got was a 4100 prototype board and the project bootloader (without source for that part) was only for the 4200.

On the progkit front, I need to use I2C as well as the SWD and I can't seem to find a way (yet) to use it as a miniprog for programming and debugging.

If this was for work, even spending 1 hour on it will justify the miniprog price so I think I'll be getting one soon because I wasted a whole long weekend (well not really since it was my wife's B-day so I didn't have that much time to deal with the PSoCs).
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on September 05, 2014, 04:28:49 am
So I got the Pioneer working as a programmer/debugger.
I did ask in the element14 thread where they released the source code for the Pioneer's KitProg programmer/debugger.

http://www.element14.com/community/thread/27067/l/psoc-5lp-programmer-firmware (http://www.element14.com/community/thread/27067/l/psoc-5lp-programmer-firmware)

I didn't get any replies but I rewired my approach. Here is what I posted there:
Quote
Success:
 
I connected the Pioneer's PSoC 4 P3_0, P3_1, GND, P4_VDD & /XRES to the same pins in the prototype kit.
For SWDIO and SWDCLK used the PSoC 5LP P0_0 and P0_1 and connected those to the prototype board.
I only had to change the ProgKit pinout for SWDIO from P5LP2_0 to P5LP0_0  and SWDCLK from P5LP2_1 to P5LP0_1 and wired it as shown here:
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107965;image)
 
Now I can use program directly from Creator 3.0 and if I open Debug/Select Debug Target... I get the KitProg with the chip enumerated within it.
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107967;image)

Finally I was able to attach to the running program or debug it from scratch and set a Breakpoint
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107969;image)
 
Thank you for making the KitProg source available!  8)

So not only is the Pioneer a cool dev kit, but it replaces a $90 programmer/debugger as well. Not bad for a $25 kit   :-+

Edit: Not sure if I need the 4.7K pullup resistor but the Pioneer schematic has it.
Edit2: I was too hasty about debugging from scratch, I can however attach, might be because the project is a bootable one? Not sure. Also I dont need P3_0 and P3_1 and I bet the pullup resistor can go away as well, leaving just 5 wires.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on September 05, 2014, 06:10:01 am
If the program is not bootloadable it has full debug, meaning you can press F5 and step through the code from main.
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107973;image)
Of course I don't run it in such a small window, I resized the IDE to make it more post friendly :)

Excuse the mess of jumper wires, but this has the Pioneer debugging the prototype kit that runs a frequency counter (on the floating yellow wire on the left) that is picking up the 60Hz mains that is everywhere.
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=107975;image)
Edit: I overdid the constrast so it will show up in the camera.

So it's acting like a MiniProg after all. Also I didn't need the pull up resistor nor the 2 wires for SPI, so it's a 5 wire programmer (Edit: well 3 plus ground and VDD) just like the MiniProg.

Edit: and I don't have to care about removing the bootloader on the prototype kit since I can upload a bootloader anytime now.


Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on September 06, 2014, 06:54:27 am
BTW I do have a 4100 prototype board (same as the 4200 but without the analog) and I hooked it up to the Pioneer
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=108058;image)

I powered it up with the modified external pins and the chip showed under the KitProg and I was able to acquire it.
Edit: I know the source code the released is for version 2.03 of the programmer and the latest one is version 2.08. I'm not sure what the updated in the programmer since then but seems to work fine).

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=108060;image)
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=108062;image)

Also I was able to program it and debug it. Not sure about PSoC 1, PSoC 3 and PSoC 5LP (or PSoC 5 but they got replaced by the 5LP) but They probably show up just fine, but I didn't look deep in the code nor have access to kits with them at the moment.

Edit: there is also a 4000 series that should work as well.

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=108064;image)

So $4 breadboard prototype kits with $25 programmer and debugger plus a development kit and $1 chips until the end of this month (I have 40 sitting around but gotta do some boards). They just need three 1 uF and two 0.1uF bypass caps to be internally regulated from an unregulated 1.8V to 5.5V input source. Or I could just short three pins if I want to use a regulated 1.8±5%V input supply.

Edit: the built in 4200 is running a separate capsense program that changes the RGB light from red to green and unaffected by programming the external board.

Edit: of course the PSoC 5LP (ARM cortex M3) and the PSoC 3 (8051) are more capable than the PSoC 4 series (ARM cortex M0) since they can natively do USB and all that good jazz. The PSoC 5LP go for around $10 and the PSoC 3 go for around $5 in low quantities. and the PSoC 4 are limited priced (with free shipping until the end of September 2014) for $1 normally at around $2.50. But it seems that you'll be able to price match with them if you are considering an alternate solution.

They seem to be hungry for customers for now.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 06, 2014, 04:20:14 pm
I just started, and now I am just stopped!


I set the Project Device=CY8C4245AXI-483 correctly

I downloaded PSOC Creator latest ed. and the first and only thing I tried to insert an A2D block into a PSoC4200 blank project. I must be missing some simple step.


The chip chosen is correct, but when I configure the Seq. A2D block to 6 A2D muxed channels and try to compile I get the following error:

apr.m0032 net:NET_67 is connected to an analog mux but is not connect to an external component.


If I compile the completely unmodified blank project it compiles correctly. If I add the default unmodified 4-Chan Differentially configured Seq. A2D it gives the same error.
I searched Cypress forum online forums and Help but to no avail. I watched the videos, they don't show how to insert an Seq. A2D  component, but there are examples that work that do use and show the A2D working..What am I doing wrong to deserve this?

Help!!!

Something is Hexing my Binaries.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 06, 2014, 04:56:48 pm
Quote
to no avail.

That's the risk you take with such a unique part. I think someone mentioned this earlier to you in this very thread.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 06, 2014, 05:11:04 pm
Hoo Haa!

I just had to rename the pins from Pin_1 to something like AN0, etc to get it to work.

So far, my memory usage is:

Flash used: 1254 of 32768 bytes (3.8 %).
SRAM used: 1532 of 4096 bytes (37.4 %).
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on September 06, 2014, 06:26:17 pm
Glad you got it working, just woke up because on Fridays I stay up and wake up late on Saturday :)

One thing to know is that you can click on the actual error and it should take you to where the problem is at.
Sometimes it doesn't but most of the times it does.

Did you get the MiniProg or did you get a Pioneer to start with?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 06, 2014, 07:06:09 pm
Thanks miguelvp!

I got the $4 MiniProg.

Can anyone tell me why my C is no longer Pic C (pronounced Pixie)

In my pic program:

----------------------------
/* This is my old PIC 16F88x code and it works perfectly*/
#include <htc.h>
#include <stdio.h>
#include <string.h>

static unsigned char Buf[40];
static unsigned char *bp=Buf;


Main();
//---etc---

start:
  strcpy(bp,"What the??? ");

goto start;


//----------------Cypressed C
#include <stdlib.h>
#include <stdio.h>

static unsigned char Buf[40];
static unsigned char *bp=Buf;


Main();

//---etc---

start:
  strcpy(bp,"What the??? "); //gives me a warning: Passing unsigned 'char *' to /.pointers of type 'char *' converts between pointers of integer type with different signs

goto start;


Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 06, 2014, 07:10:26 pm
Check out the prototype of strcpy().

Also, pick up a C book. Learn to live without "goto".
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 06, 2014, 07:17:27 pm
Thanks again, dannyf,


The question boils down to if I can ignore this warning or not!

How do I check out the prototype of strcpy(char*, const char *); //???? how does this help?

Another Question:  I used to have sin and cos and log and exp and Abs functions with <math.h> with pic compiler 9.83 pro. How do I get these valuable functions back??

How can I write my code so that it works with strings and math?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: c4757p on September 06, 2014, 07:23:52 pm
The question boils down to if I can ignore this warning or not!

No. Please don't ignore warnings. Your code will be much better for it. A few of them are unnecessary, but the corrections to make them go away tend to be unobtrusive anyway, and many of them are very helpful.

Quote
How do I check out the prototype of strcpy(char*, const char *);

That is the prototype. It's the set of types which the function takes and returns. (Okay, you omitted the return type: char*) The problem is that char and unsigned char are not directly compatible: one has a range -128 to 127, and one has a range 0 to 255. One is not a subset of the other, so you can't directly translate between them.

Just be consistent. Use char everywhere. Why do you need it to be unsigned, anyway? It's not a number per se, it's a code which references a specific character. The sign doesn't matter.

If you have an unsigned integer of size n and you need to convert it to a signed integer to actually do math on it (rather than just actual text), you should either perform a check to make sure it will fit, or convert it to a signed integer of size greater than n. I personally recommend including <inttypes.h> or <stdint.h>, which define type names that include the size as part of the name (uint8_t, uint16_t, int8_t, int16_t, etc) to make this a bit clearer.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 06, 2014, 07:49:04 pm
Thanks C4757p,

I have to write to a 16 char by 7-seg LCD that simulates alphanumeric characters, and the resulting
output of a Conv() routine is to convert ASCII to 7-seg approximations of the correct characters. so values of converted chars to be serially fed to the LCD can(esp. when I include the d.p.) range from 0 to 255.

The question that puzzles me is why are pointers signed numbers since they point to an absolute memory location?

The only real question is how to get my strcpy function to work?

And how do I do some calculations with higher math functions such as sin and tan cos and Abs etc.? I could do them with the old 8-bit PIC compiler!

Do I have to throw away an ability to do floating point transcendental math functions to gain the use of a Cypress mcu?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: c4757p on September 06, 2014, 08:03:00 pm
Pointers aren't numbers at all - they're number-like, and they can be added, subtracted and converted to formal numbers, but they're definitely not signed integers.

However - in C, a pointer type can (and should) indicate what it points to. A char* isn't a signed pointer, it's a pointer to memory which is to be interpreted as char. If you change the pointer type, you're still pointing to the same memory, but it will be interpreted differently.

Your strcpy function will work if you give it the types it expects. I don't see anything wrong with your code - it will run, despite the warning. Change unsigned char to char and it should work with no warning at all.

If you need to convert them to unsigned 8-bit integers to transmit them to the LCD, this would formally be considered part of encoding them for transmission, and should be done as part of transmission itself, not universally throughout your code. They're just char up until you need them to have a specific format to send them to the LCD. You can "convert" with a cast:

Code: [Select]
// Here's a normal char
char c = 'Q';

// Here it is as unsigned: implicit cast
unsigned char d = c;

// Here it is again as unsigned: explicit cast
do_something ((unsigned char) c);

Store them as char because that's what they are - characters. Convert them when it's time to transmit. I did say not to do this, earlier, but specifically for mathematics - it can change the meaning of the number. What it will do is take the binary encoding of the char and just re-interpret it as an unsigned char. That's exactly what you want to do, so it's okay.

As for the math - I don't know, that might be platform specific. I'm sure you can do it. You might have to tell the compiler to link to the math library - with GCC and similar compilers, this is done by adding -lm as a compile option.

I should include the usual admonition against floating-point math in microcontrollers - but I've definitely encountered a few times when it was quite useful, so if the MCU is powerful enough I really can't complain. Just make sure it really is the best way to accomplish what you want.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 06, 2014, 08:03:11 pm
As I attempt to understand C in its most pure ANSI form, a character array should be allowed to hold any unsigned char (byte) value in that same range.  Why should string functions allow an ASCII character that has a negative value???

This signed char pointer argument idea is  not.completely clear to me.

As far a the pointer goes, I am a bit confused. If there exists a 4K RAM space and a 32K Flash space, then an integer would be required to precise the absolute location of a single byte(char) in memory.  Why point to a char array with a signed number?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: c4757p on September 06, 2014, 08:06:39 pm
As I attempt to understand C in its most pure ANSI form, a character array should be allowed to hold any unsigned char (byte) value in that same range.  Why should string functions allow an ASCII character that has a negative value???

This signed char pointer argument idea is  not.completely clear to me.

Crappy historical reasons. I agree, characters should be unsigned. There's no reason for a character code to be negative. In reality, it's even worse than this: not specified. char can be equivalent to signed char or unsigned char depending on the platform. Best to just use plain char whenever you're handling actual text, as the C library will be built around whichever they chose, and then use uint8_t and int8_t from inttypes.h when you want numbers. The number of properly coded applications where you both need ASCII characters and knowledge of the signedness of the value in the same variable should be very small.

Quote
As far a the pointer goes, I am a bit confused. If there exists a 4K RAM space and a 32K Flash space, then an integer would be required to precise the absolute location of a single byte(char) in memory.  Why point to a char array with a signed number?

The pointer isn't signed, the data to which it points is.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 06, 2014, 08:23:36 pm
C4757p, thanks again.

I think I've cleared up a little of the fog in my mind about pointers and char vars, but I am still a little confused:  If a 'char' is a signed byte by default, then if I write:

static char Buf[40];
char *bp=Buf;

main()

//Then if (for example) if Buf[]="This is a long collection of letters"; and Buf[38]=255; and this char  is a very necessary delimiter character I've created to parse my strings prior to the LCD, then  will strcpy copy this string correctly to another display buffer, correctly, that is  including the Buf[39] value of 255?

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 06, 2014, 08:25:34 pm
Does anyone know of where to obtain a free math.h and how to attach them to PSoC Creator?

Sometimes you need a log or a sine value..nothing else will do as well in an algorithm.

It is a surprise to me that adding just one floating point division ate up approx 5% of the Flash space, almost as bad as with the 8-bit compiler!
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: c4757p on September 06, 2014, 08:29:13 pm
Yes, your character 255 will be included. If char is signed on this platform, then it will automatically be converted to the signed equivalent (-1) when stored, and converted back if you read it as unsigned. If you compare it to something, they will both be converted to the same type for comparison.

math.h is part of the standard C library; it ought to be there already! What sort of error are you getting when you try to include it?

Sometimes you need a log or a sine value..nothing else will do as well in an algorithm.

Depending on what you're doing, it can be more efficient sometimes to use a lookup table or an approximation. sin(x) is close to just x for small values, for example. Integer logarithms can be computed by repeated division, which is space-efficient if a division algorithm is already in your code (or the device has a hardware divider), though it's not time-efficient.

It is a surprise to me that adding just one floating point statement ate up approx 5% of the Flash space, almost as bad as with the 8-bit compiler!

The chip likely doesn't actually support floating-point (only a few specialized ARMs do), so the moment you do anything with FP arithmetic, the compiler has to dump in an entire floating-point emulation suite.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on September 06, 2014, 08:29:41 pm
Not to change the subject, but I just wanted to drop this doc about the PSoC analog capabilities, this doc is the the PSoC 3 and 5 but some of the data should apply to the PSoC 4200.

http://files.em.avnet.com/docs/Cypress-Analog%20Peripherals.pdf (http://files.em.avnet.com/docs/Cypress-Analog%20Peripherals.pdf)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 06, 2014, 08:45:03 pm
C4757p:

Thanks for the very helpful explanations helping me to understand these elementary C issues!

I was in error. I was able to #include <math.h> without a problem!

if I code:

static char Buf[40], *bp=Buf;
//Then
strcpy(bp,"Hey this works!"); //speaks for itself
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 06, 2014, 09:05:56 pm
You are trying to approach this with a piece-meal approach. I would suggest that that is not the best course for a beginner. Instead, learn to code properly - get a book, or take a class, etc., and learn to approach coding issues systemically - read the compiler manuals, read the library guide, read the IDE manuals, etc.

It is going to be a painful process but in the end you will go further than what you are attempting to do now.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: neslekkim on September 08, 2014, 02:45:24 pm
Shouldn't this be ok? http://www.cplusplus.com/reference/cstring/strcpy/ (http://www.cplusplus.com/reference/cstring/strcpy/)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Jeroen3 on September 09, 2014, 06:12:35 am
A char[] is equal to a char * const. They are both fixed memory location pointers.
Therefore it is unnecessary to use your duplicate approach, using Buf without [] is enough.

A pointer in C has the following format: type *.
Where type can even be void, and the * says it's a pointer to type.
Not going into the const kung-fu here. http://en.wikipedia.org/wiki/Const-correctness (http://en.wikipedia.org/wiki/Const-correctness)

A pointer is always the architecture bus width. On ARM Cortex this is 32 bit. They are never signed, even though there are relative jump instructions available in assembler.
Please note that the type a pointer points to is crucial, You can safely cast a pointer to word type to a pointer to a byte type, but never cast a byte type pointer to a word type pointer since this will generate alignment errors. (you cannot do a 32 bit read/write on unaligned data)
http://en.wikipedia.org/wiki/Word_(computer_architecture) (http://en.wikipedia.org/wiki/Word_(computer_architecture))

Pointers are the most difficult part of C, but if you understand them you C potential is endless.  ;)
They are very useful since ARM Cortex can only argument or return 4 elements without stack. And there is a single linear address bus.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on September 09, 2014, 10:34:52 am
Quote
A char[] is equal to a char * const.

"char * const" vs. "const char *': what's the difference? :)

Define them and play with them.

BTW, "const" is one of those things that almost all embedded compilers got it wrong but everyone has used to such "wrongs".
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on September 09, 2014, 11:06:42 am
Thanks dannyF for the advice,

I read the info pointed to the links in the last two posts and found them to completely without any ability of my simple mind to even attempt to understand. I remain constantly confused by their pointedly complicated explanations.

There are no schools nearby in my area that will offer a course in C-language, except maybe C# or C++ for Windows database development or working with MSOFFICE apps, so I learn by discovering each trip wire as I come across it. And thanks to gentlemen like you and all the others on forums I can get some pointers to  help clarify and repair some of the small holes in the fat heap of my self-learned knowledge.  There are so few as crazy as myself that will peek and poke around into tiny mcu IC's in this big great world of ours. So I must fix my problems as I C them.

The real issue here is what works perfectly with one compiler doesn't make the same sense to another, and I didn't have a problem with syntax until I switched!

I still can't understand the reasoning for standardizing ANSI-wise for strcpy() to want only to play with signed char strings!
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Jeroen3 on September 09, 2014, 11:39:29 am
Quote
I still can't understand the reasoning for standardizing ANSI-wise for strcpy() to want only to play with signed char strings!
In the early ages of computers there were only 127 characters defined in ASCII. Then the füññÿ languages wanted computers as well.

You're an embedded programmer. You see char, so you use it as byte pointers.
If you don't like casting, try this: memcpy( destination, source, strlen( source ))
Memcpy accepts all types of pointers.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: nctnico on September 09, 2014, 09:10:03 pm
Actually I prefer to use snprintf or a protected string copy function for strings. One of the problems with the standard string functions is that they don't check for buffer overflows (does the source fit inside the destination string?).
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on October 06, 2014, 09:25:45 am
Hi Guys! This is an update to my goal to find a mo' better MCU than the PIC16F88x I had maxed-out in performance.

At the time of my last post I had decided on buying (4) CY8CKIT--049-42xx kits as what seemed the best choice among many.

Unfortunately, this PSOC chip is truly a POS.

Although the chip is full of promises of many functions, it is severely crippled by allowing me to choose only a max of 4  functions(UDBs).

The ADC converter only supports 8-inputs single ended at 11 bits but only offers a 1.5K input impedance, requiring buffer op-amps on each input.

I needed 4 PWM's for my MMMMM motor control. I can only get one 16-bit PWM after adding a counter and ADC and boot module.

The PSOC4 documentation for most UDB (functional blocks such as PWM ADC etc) are so very vague and poorly explained that it required hours upon hours to experiment,  trying to understand how to get these functional blocks to work.
For instance the PWM requires code to turn off and on the PWM just to set  Duty Cycle to zero, else the DCyC reverts to 100% when it should be 0, (PWM single output compare match for PWM Duty Cycle) for a simple single-output PWM.

The PSOC4 48-MHz clock does not deliver speed. A simple GPIO On--GPIO  Off takes 1.4uSec to toggle one pin. To turn on or off a pin requires a method: GPIOpinWrite(1); GPIOpinWrite(0); iinstead of a simple bitx=1;  bitx=0; using a fast one or two machine language instruction  to achieve.

The clock is +-2% to +-5% accuracy making an external clock necessary for precise timing.

But the worst surprise is the 4 UDB limit which makes the chip useless except for the most trivial of useful intent!

What now?

The 16F88x chip is buy far the champion compared to to the PSOC POS. The PIC is yet the best pick!
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: nctnico on October 06, 2014, 09:31:16 am
I recently looked for a chip for a project with dual edge PWM. I ended up with the LPC11E6x series from NXP which also has a fast 12bit ADC. Maybe it's worth checking out.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on October 06, 2014, 09:59:48 am
nctnico: Thanks for your speedy reply an d help.

I am going to check this LPC chip out.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on October 06, 2014, 10:17:22 am
Quote
Unfortunately, this PSOC chip is truly a POS.

Many of the issues you mentioned are in the datasheet and a thorough reading of it would have helped, before your purchase. But you were in such a favor then, ..., :)

As to the PIC, I use it a lot as well. It is the favorite of mine among the low-end PIC chips.

I would suggest that you go back to why you need another chip, and lay out what you need in the next chip. That should narrow down the potential candidates significantly.

Outputing a few pwm is a walk in the park for most of the modern chips.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Spikee on October 06, 2014, 11:38:18 am
I would also like to see a upgraded psoc 4 chip. With one usb integrated (slave only is good enough), maybe a rtc and a few extra ubd's.
Even if the single quantity cost goes to 3/4 euro it would still be worth it.

Now you have to chose between a 0.86 usd part (psoc 4) or the psoc 5LP which costs ~9 usd .
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 06, 2014, 03:15:15 pm
Don't have a lot of time to look into things (like the performance issues) until later, because I'm at work, but as far as PWMs check out these two projects:

http://www.element14.com/community/thread/25186/l/psoc-4-pioneer-kit-community-project039--two-pwms-for-the-price-of-one (http://www.element14.com/community/thread/25186/l/psoc-4-pioneer-kit-community-project039--two-pwms-for-the-price-of-one)
http://www.element14.com/community/message/84542/l/psoc-4-pioneer-kit-community-project059-but-wait-there-s-more-single-pwm-with-3-outputs (http://www.element14.com/community/message/84542/l/psoc-4-pioneer-kit-community-project059-but-wait-there-s-more-single-pwm-with-3-outputs)

There might be other gems within the 100 total projects:
http://www.element14.com/community/thread/23736/l/100-projects-in-100-days (http://www.element14.com/community/thread/23736/l/100-projects-in-100-days)

Also you can use the udb editor, I haven't investigated much on that so I have to wait until I'm off and hopefully I have time this afternoon.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: 22swg on October 06, 2014, 03:45:00 pm
My 2 cents / peneth worth PIC24HJ128GP502 
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 07, 2014, 04:14:05 am
So based on some code I found on using Keil as a PSoC programmer some where in this link:
http://www.cypress.com/?rID=38050 (http://www.cypress.com/?rID=38050)

I was able to achieve (this is a full cycle so both on and off)
1.724 MHz 580.0ns Period at 50% duty cycle in assembler
1.202MHz 832.0ns Period at 50% duty cycle in C

I found this code that access the GPIO ports directly. In this case p0[0]

Code: [Select]
int WriteIO (unsigned int addr, unsigned int data)
{
unsigned int *address = (unsigned int*)addr;
*address = (unsigned int)data;
return (0);
}

int ReadIO (unsigned int addr, unsigned int *data)
{
unsigned int *address = (unsigned int*)addr;
*data = *address;
return (0);
}

//----------------------------------------------------------------------------------
// Custom functions
//----------------------------------------------------------------------------------

void Delay(int ms)
{
int i , j;

for(i = 0; i < ms; i++) {
for(j = 0; j < 3333; j++); //Delay = 1ms, mesured by scope for CY8C41xx (CPU = 48MHz)
}
}

void LED_Write(char value)
{     
WriteIO(0x40040000, value); //GPIO2.GPIO2_PRT.DR
}

//----------------------------------------------------------------------------------
// main() function
//----------------------------------------------------------------------------------
int main (void)
{
char leds = 0x01;     //Initial state of LEDs: P0[0] - On

WriteIO(0x40040008, 0x06); //Set Strong Drive Mode for P0[0] in GPIO2.GPIO2_PRT.PC register

for (;;)
{
LED_Write(leds); //Invert LED state on P[0] in GPIO2.GPIO2_PRT.DR register
Delay(500);
leds ^= 0x01;   
  }
}

Based on that I wrote the following code, if you change USE_ASM to 0 it will use C.
If USE_ASM is 1, then defining USE_INLINE_ASM  to 1 will use inline assembly or if 0 it will use the external .s assembly file.

Code: (main.c) [Select]
// Added delays for 50% duty cycle
// ASM inline or not 1.724 MHz Period 580.0ns (28 cycles?)
// C 1.202MHz 832.0ns (40 cycles?)
#define USE_ASM 1
#if USE_ASM
#define USE_INLINE_ASM 0
#if !USE_INLINE_ASM
// Declare assembler function
void ASMLoop();
#endif
#endif

int main (void)
{
#if USE_ASM
#if USE_INLINE_ASM
    /* Set Strong Drive Mode for P0[0] in GPIO2.GPIO2_PRT.PC register */
    asm("ldr r3, =0x40040008");
    asm("str r3, [r7]");
    asm("ldr r3, [r7]");
    asm("movs r2, #6");
    asm("str r2, [r3]");

    /* Preload P0[0] port into r3 */
    asm("ldr r3, =0x40040000");
    asm("str r3, [r7, #4]");

    /* Preload off and on, into r2 and r4 */
    asm("movs r2, #0");
    asm("movs r4, #1");

    for (;;)
    {
        /* Turn P0[0] off */
        asm("str r2, [r3]");
       
        /* compensate for branch loop time delay */
        asm("nop");
        asm("nop");
        asm("nop");
       
        /* Turn P0[0] on */
        asm("str r4, [r3]");
     }
#else
    ASMLoop();
#endif
#else
    unsigned int *IOaddress = (unsigned int*)0x40040000; //GPIO2.GPIO2_PRT.DR
    unsigned int *MODEaddress = (unsigned int*)0x40040008; //GPIO2.GPIO2_PRT.PC
    // delay variable
    int a = 0;

    /* Set Strong Drive Mode for P0[0] in GPIO2.GPIO2_PRT.PC register */
    *MODEaddress = 0x06;
   
    for (;;)
    {
        /* Turn P0[0] off */
        *IOaddress = 0x00;

        /* compensate for branch loop time delay */
        a=0;

         /* Turn P0[0] on */
       *IOaddress = 0x01;
     }
#endif
}

External Assembly file if you don't want to use the inline assembler:

Code: (ASMLoop.s) [Select]
    .syntax unified
    .text

    .global ASMLoop
    .func ASMLoop, ASMLoop
    .thumb_func
ASMLoop:
    /* Set Strong Drive Mode for P0[0] in GPIO2.GPIO2_PRT.PC register */
    ldr r3, .IOAddr+4
    str r3, [r7]
    ldr r3, [r7]
    movs r2, #6
    str r2, [r3]
   
    /* Preload P0[0] port into r3 */
    ldr r3, .IOAddr
    str r3, [r7, #4]

    /* Preload off and on, into r2 and r4 */
    movs r2, #0
    movs r4, #1

LoopAgain:
    /* Turn P0[0] off */
    str r2, [r3]

    /* compensate for branch loop time delay */
    nop
    nop
    nop
   
    /* Turn P0[0] on */
    str r4, [r3]
   
    /* repeat */
    b LoopAgain

    .align 2
    .IOAddr:
    .word   0x40040000
    .word   0x40040008
    .endfunc

    .end

/* [] END OF FILE */

Btw, you can always export a project into eclipse or uVision and I think there is another one supported.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 07, 2014, 04:37:24 am
Adding scope capture for anyone that doubts it :)

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112056;image)

Edit: btw, I didn't do the bootloadable/bootloader because I'm using the pioneer as a programmer, so you might need to alter it to use the bootloader/bootloadable combination for the $4 prototype kit.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 07, 2014, 05:47:04 am
Ok, I did learn something thanks to looking into this.

A Store (str) is 3 cycles
a branch(b) is 3 cycles
a nop is 1 cycle (used 3 to compensate for the branch to keep a 50% duty cycle).

Multiplied by 2 because of 6 cycles for on and 6 for off it should be 12 cycles and my computation was more than double at 28 cycles.

Well so it looks like by default PSoC Creator sets the frequency to 24MHz instead of 48MHz.

It's easy to change, open your cydwr, select the clocks tab and double click on the SYSCLK (it probably says 24.000 MHz on your project), actually I think you can double click anywhere within the clocks.

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112059;image)

That will open the Configure System Clocks. Change the IMO to 48 instead of 24

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112061;image)

Compile and run and double your pleasure :)

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112063;image)

So now we are at 14 CPU cycles per period, they should be 12 so I'm guessing the port I/O adds 1 cycle per output (2 total) but I guess that will be somewhere in the ARM M0 docs, and I'm really not that curious about where a cycle per I/O went.

But if you want to look here is a link:
http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0432c/CHDCICDF.html (http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.ddi0432c/CHDCICDF.html)




Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: true on October 07, 2014, 06:16:13 am
Unfortunately, this PSOC chip is truly a POS.
...
Although the chip is full of promises of many functions, it is severely crippled by allowing me to choose only a max of 4  functions(UDBs).
I don't think you understand what the PSoC can do, or what the UDBs are for.

The ADC converter only supports 8-inputs single ended at 11 bits
This is not quite accurate. You can have 8 configured on SARMUX (port 2), but this is to do things like sequential scanning without CPU control. You can also use the two AMUXBUS to get analog into your ADC from almost any pin...you can change these muxes as you wish. Even if you use capsense you can do this (but it isn't as drag-and-drop easy as capsense itself is). This is far more powerful than your PIC, and isn't even the start of what this ADC can do better than your PIC.

I needed 4 PWM's for my MMMMM motor control. I can only get one 16-bit PWM after adding a counter and ADC and boot module.
This is not true. You can get 4 PWMs on many PSoC4 models without even involving any UDBs. Depending on how you want to clock them, it is trivial to get 20 8-bit PWMs on a PSoC4 (but not much else if you need a timer for something :)) I think you should read more about the PSoC4 architecture.

The PSOC4 48-MHz clock does not deliver speed. A simple GPIO On--GPIO  Off takes 1.4uSec to toggle one pin. To turn on or off a pin requires a method: GPIOpinWrite(1); GPIOpinWrite(0); iinstead of a simple bitx=1;  bitx=0; using a fast one or two machine language instruction  to achieve.
The API functions may not be the fastest, but they certainly do not require that method. I don't think they're that slow anyway so I think you are doing something wrong here.

The clock is +-2% to +-5% accuracy making an external clock necessary for precise timing.
So does your PIC, no matter what the datasheet says.

But the worst surprise is the 4 UDB limit which makes the chip useless except for the most trivial of useful intent!
This is not true. Far from it. I am using 3 of the 4 UDBs in my project so far and it is significantly reducing code complexity and eliminating extra hardware otherwise needed with any other micro (at least at this cost).

What now?
This might not be correct for your application, but instead of simply jumping into something, maybe try to understand it to see if it fits your specs. It looks like you don't understand PSoC. There is a steep learning curve but it plateaus into a comfortable place pretty rapidly. I don't think you're there yet.

The 16F88x chip is buy far the champion compared to to the PSOC POS. The PIC is yet the best pick!
If you were being punny, yeah, you can save cents, but for complex tasks my dollar is on the PSoC :) Even for some not complex tasks, with micros at $0.29 in small run friendly quantities...but yeah, we are straying a bit, aren't we?

Didn't you start this topic because your multiple PICs really weren't working out? I think a lot of the responses were to your subject line, not specifically your application. But I am not sure your PIC is your champion if this thread is still relevant to you...

Good luck finding something that works for your application.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 07, 2014, 06:49:29 am
The API functions may not be the fastest, but they certainly do not require that method. I don't think they're that slow anyway so I think you are doing something wrong here.

I agree with you on all your post other than this. If you use the API functions it has too many layers of indirection that will drive the pins at KHz. But then again there is no need to direct drive the pins. One could make a custom UDB module with verilog that will outperform the CPU. I think that SuzyC is taking the wrong approach on how to best handle what this chip has to offer.

Although I rather they make a cheaper 5LP, but that's just because I'm greedy ;)

Edit: another note the +- 2% is from the chip specs, that doesn't mean your chip is going to fluctuate 2% only that it's going to be clocked higher or lower by that amount. Granted that temperature and running time might alter it as well. But it does have an internal temp sensor to compensate.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on October 07, 2014, 07:43:33 am
Here's what I get from an inexpensive 28-pin SOIC 16F886, which allows me to easily create satellite remote MMMMM PCBs 2x as small in size as the Cypress CY8C 44-pin device when used on it's native eval board: This allows me to embed small remote PCB's in the robot that fit in tight places and yet be controlled and communicate with a Master MCU that must have the smarts I need to allow any robotic sophisticated operation.

The 16F886 SOIC package offers an excellent size and DIP pin layout  that advantages me for homemade PCB layout as compared to the intricate PCB required for a 44-pin Cypress square chip's pin layout for my MMMMMs.

6 pins(yet still more avail pins for ADC if I had not needed them for other purposes) 10-bit ADC hi-impedance input requiring no Op-Amp Buffering on each input because of 1.5k input impedance (Cypress)
2 pins I2C for Master-Slave operation of motor control units and robot voice output  (512Kx8 I2C EEPROMs of pre-recorded 8-bit digitized voice storage.)
2 pins Rotary Encoder
2 pins for two10-bit PWMs operating at >19KHz for motor control and shared also for robot voice PWM generated sound output.
8 bit clock for TMR0 ISR for precise counters/timers/delays.
16-bit timer/compare/capture/timer for precision time interval measurement using an ISR.
1 pin high baud rate RS232 Tx for my own debug board that links to a PC computer on the Master 16F886
4 pins for serial LCD module interface.
2 pins precision 20ppm ext. 20MHz clock, (and there is no mod area I can see on the Cypress eval PCB to add a Xtal clock.)
External Xtal Clock allows me to have precise 100uSec to infinite time intervals with 100uSec resolution. And even if I switch over to the internal clock there is a hardware freq. adj. for the internal clock to limit timing error and change freq.  for voice output tone/gender.
1 pin reset that can be HW configed  as GPIO if necessary.
3 pins VDD, VSS VSS
1 pin Enable for optocoupler to isolate battery drain from A2D when robot is turned  off.
remaining pins MTPX'd  for /Momentary P-button "Enter" Sw/ izero-power P-Chan MOSFET turnoff/Turnoff, one pin for PWR ON latch/ HW output pins as debugging flags to precise pgm debugging points.

And since I can breadboard the 16F886 using a 28-pin skinny-dip I regain the use of two PGM clk and data pins on the 16F886 and can put them into  use as (i.e.) LCD control I/O's on the  breadboard and for MTPLX switchover from motor control PWM to enable power to speaker amp chip for voice PWM sound output.

Why the 16F886 PIC is maxed out:  <400 bytes of RAM, 8K of Flash pgm  and I am trying to make a robot that is able to use the data input from many remote analog and digital sensors to intelligently control at least 4 motors, each requiring PWM. There is simply not enough program space for even the very limiting 8-bit computational speed, nor 'nuff RAM left avail. to do any serious evaluation and decision computation, robot voice feedback etc. I cannot best use the wealth of feedback available to me from my robot's sensors even without using float vars. in my control algorithms.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Kjelt on October 07, 2014, 07:51:30 am
Not to bash the Cypress PSoC but after reading the last few pages I can only conclude that it does not match the original posters wish, which was a MCU which is EASY to graduate to.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on October 07, 2014, 07:58:00 am
Thanks Kjelt and Miguelvp:

That's exactly the point.

Perhaps what Cypress would be wise to do is to offer a PSOC 5LP board about the same price, the same size as the PSOC4 42xx eval board, even if presented with a caveat that  ADC resolution might be possibly compromised by a cheap 2-sided PCB but without the  severe limitations (4) of UDBs.



There is no desire nor need for me to jump through flaming hoops and play endless guessing games, (nor waste hours or days to search through forums) to exact the programming for proper operation of Cypress UDB's when I am only presented with vague documentation(manuals) lacking even the most common examples of implementations of a functional block.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on October 07, 2014, 08:06:59 am
//BTW: I had already had set the Cypress SYSCLK to 48MHz.

uint16 j=0;
int16 V1=0,V2=0,V3=0,B4=0;
int16 a2dRes=0;

int main()
{
 ADC_SetChanMask(0x3F);
 ADC_Start(); //Starts A2D to scan all channels continously
 ADC_StartConvert();
LEDout_SetDriveMode(LEDout_DM_STRONG);
    Sw_ClearInterrupt();
   
    /* Enable global interrupts */
    CyGlobalIntEnable;
 
 PWM_Enable();
 PWM_Start();
 PWM_WritePeriod(2046);
   
start:   

P2_7_Write(1);
P2_7_Write(0);

 ADC_SetChanMask(0x2);//ADC  channel 1 selected

a2dRes=ADC_GetResult16(1);
if(a2dRes>0)
 {
   PWM_Start();
   PWM_WriteCompare(a2dRes);
 }
else PWM_Stop();//else PWMout=1 when PWM_WriteCompare(0) DCyc=0
 
 
goto start;
}
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 07, 2014, 08:12:28 am
Well, the PSoC is easy to graduate, but hard to master.

Meaning it's easy if you want to do easy things, but if you want to push it, then you just have to master it and even if that's not hard, I wouldn't call it easy.

I'll put some links just because:

http://www.cypress.com/?docID=47779 (http://www.cypress.com/?docID=47779)

http://www.cypress.com/?docID=42936 (http://www.cypress.com/?docID=42936)

But there are many resources out there just for the digging.

SuzyC If you really don't want them I'll get them from you if you eat the shipping.

Edit: I mean I'll pay you the $4 per board if you eat the shipping to Chicago IL
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 07, 2014, 08:13:37 am
BTW: I had already had set the Cypress SYSCLK to 48MHz.

Well I'm getting 3.442MHz switching a pin on and off per cycle

Edit: and it's just another ARM processor, you don't need to use their toolchain, uVision supports them as well.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on October 07, 2014, 08:53:11 am
Thanks Again 22swg:

I certainly will take a serious look a these PIC chips.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on October 07, 2014, 10:50:45 am
Sounds like your issues are with ease of programming and space.

None of the arm chips will be easy to program - the Cypress chip is actually the exception here due to its innovative programming interface. Those arm chips are sold on their capabilities -> that means they are necessarily far more complex than the 8-bit chips.

With a desire for SOIC (very rare in arm land) or TSSOP (mostly low-end chips in the arm land), you don't have much choices but to stay with 8/16 bit chips.

The easier choice is to stay with PIC. The newer PIC16F1xxx chips are bigger, cheaper and faster than the PIC16F88x chips; Alternatively, you can migrate to PIC18F chips, or my favorite PIC24F chips. Some of the PIC24F chips have 5 timers and 5 dedicated pwm generators meaning they don't use any of the timers to generate pwm output.

The choices are abundant but you have to know why you are migrating and what's important to you.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Spikee on October 07, 2014, 05:45:51 pm
Explanation of psoc pin speed:
C++ vs Assembly vs Verilog. on Vimeo (http://vimeo.com/65092394)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Corporate666 on October 07, 2014, 07:01:52 pm
Hi Guys! This is an update to my goal to find a mo' better MCU than the PIC16F88x I had maxed-out in performance.

At the time of my last post I had decided on buying (4) CY8CKIT--049-42xx kits as what seemed the best choice among many.

Unfortunately, this PSOC chip is truly a POS.

Although the chip is full of promises of many functions, it is severely crippled by allowing me to choose only a max of 4  functions(UDBs).

Nonsense.  They have the GERBER files right on their website for this board, and they list very specifically the features of the chip.  If you need more than 4 UDB's, why would you buy a chip with 4 UDB's?  That's like buying a chip with 6 GPIO's and complaining it's a POS because it doesn't have 16 GPIO's.

Quote
The ADC converter only supports 8-inputs single ended at 11 bits but only offers a 1.5K input impedance, requiring buffer op-amps on each input.

"Only"?  The 4000 series is the low-end PSoC in the $0.29 to $2 range.  The fact that it maxes out at 8 ADC inputs is right in the datasheet, as is the input impedance - why would it be a surprise or a slam against the chip?  If you need more than the PSoC4 offers, then move to PSoC3 or PSoC5.  Both allow adjustable input impedance, up to 20-bit ADC's, and you can sample dozens of channels.  And, you can do it in hardware and write out the results to a memory location using DMA so you don't actually have to do anything in software.  If the specs, as listed right in the datasheet, don't work for your application, then why buy that chip and complain it doesn't do what you need?


Quote
I needed 4 PWM's for my MMMMM motor control. I can only get one 16-bit PWM after adding a counter and ADC and boot module.

The board you bought comes with the CY8C4245AXI-483 chip.  I just did a sample project with an ADC, counter and 4 16-bit PWM's and it fit fine.  The boot module is software only and doesn't affect UDB's.  The 4 PWM's use up the 4 UDB's and the counter fits into the dedicated TCPWM block and the ADC fits into the dedicated ADC block.  Not to keep harping on the issue but the datasheet explains all this.

Quote
The PSOC4 documentation for most UDB (functional blocks such as PWM ADC etc) are so very vague and poorly explained that it required hours upon hours to experiment,  trying to understand how to get these functional blocks to work.
For instance the PWM requires code to turn off and on the PWM just to set  Duty Cycle to zero, else the DCyC reverts to 100% when it should be 0, (PWM single output compare match for PWM Duty Cycle) for a simple single-output PWM.

I disagree that the datasheets are vague.  If anything, they are excruciatingly detailed, going into clock cycles for various commands, memory usage, interactions with other parts and more.   For example, just the PWM datasheet alone is 46 pages, the ADC datasheet is 30 pages, etc.   They also note in every datasheet that you can get example code and sample projects right from within Creator by clicking "File -> Example Project".  There you can filter by PSoC family, chip range and example type.  There are 3 example projects just for the PSoC4, 4200 family, ADC which show the component in use (and you can compile and use the samples if you like).

Quote
The PSOC4 48-MHz clock does not deliver speed. A simple GPIO On--GPIO  Off takes 1.4uSec to toggle one pin. To turn on or off a pin requires a method: GPIOpinWrite(1); GPIOpinWrite(0); iinstead of a simple bitx=1;  bitx=0; using a fast one or two machine language instruction  to achieve.

Once again, Cypress doesn't hide this.  It talks about speed in the pins component and refers you to this document http://www.cypress.com/?docID=42883. (http://www.cypress.com/?docID=42883.)  That document explains that the pin API's are there for convenience and even has oscilloscope graphs showing how fast the pins switch using the API's as well as how fast they switch using direct addressing.  It also gives the code to directly toggle any GPIO pin the same way it's done with most other MCU's. 

Quote
The clock is +-2% to +-5% accuracy making an external clock necessary for precise timing.

Same with any MCU

Quote
But the worst surprise is the 4 UDB limit which makes the chip useless except for the most trivial of useful intent!

Nonsense.  It's a sub-$2 MCU with 32k of flash, a 48Mhz ARM M0 core, 36 GPIO's, that will run down to 1.7V, has dedicated op-amp, communication (UART/I2C,etc) and timer/counter/PWM blocks as well as 4 additional configurable blocks for whatever else you like such as comparators, DAC's, capsense, PRiSM LED color mixing, quadrature decoders, shift registers, LCD drivers, switch debouncers, edge detectors and more.  It's hardly useless for anything beyond trivial uses.

Sorry if I sound harsh, but your complaints are just mostly bullshit.  I'm sorry the PSoC didn't work out for you but I think you brought the wrong board for your application.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 07, 2014, 07:20:46 pm
@Spikee, I'll watch the video later only looked at the beginning until he mentioned release mode.

Well release mode with optimizations for either size or speed makes the chip do nothing I see no activity on the scope at all, I also have an LED hooked to it via a resistor and nothing. I can run release but then I have to turn the optimization off.

Maybe a bug.

Also they are using the 5LP which uses the Cortex M3, on the M0 all branches are 3 cycles and stores are another 3. I will try to inline and try to use the assignment directly out of the generated code and will test if the inline works.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: true on October 07, 2014, 09:12:52 pm
Not to bash the Cypress PSoC but after reading the last few pages I can only conclude that it does not match the original posters wish, which was a MCU which is EASY to graduate to.
A number of posters in this thread do think it fits this wish. It is pretty easy to use. As an example, having never developed for the product before and only doing this on sleep deprivation after work I got working capsense with almost no fuss in like 10-15 minutes. The toolchain is free and is easy to install (though windows-only, bah), there are examples included that even previews the main source file which is usually enough to see how the code portion works, the parts just work and the APIs are easy. And I came into working with this chip thinking it would be a load of shit for my application but the ease of use has only made it faster to get something working, and even without optimizing it is working really well. It has a steep learning curve but I didn't say a difficult one - the tool is just different. But once one gets the hang of it it is easy. There are also videos provided by Cypress that show how it works. (If you can't figure it out after that, use an Arduino maybe?)

The problem is the original poster didn't bother with any of that and just dove in expecting it to be a PIC or be easier than the PIC.


Quote from: SuzyC
Thanks Kjelt and Miguelvp:
That's exactly the point.
But I don't think you got the point. Oh well.

Quote from: SuzyC
There is no desire nor need for me to jump through flaming hoops and play endless guessing games, (nor waste hours or days to search through forums) to exact the programming for proper operation of Cypress UDB's when I am only presented with vague documentation(manuals) lacking even the most common examples of implementations of a functional block.
Then don't use the UDBs. Everything you want to do, except the ADC limitation, can be used with the fixed function hardware. You originally said the easiest to graduate to, not the easiest to fit a precise use case (that came later). The question of opinion was answered many ways, but the problem is you didn't ask the correct question, and you didn't pay attention to the answers either.


Quote from: miguelvp
Meaning it's easy if you want to do easy things, but if you want to push it, then you just have to master it and even if that's not hard, I wouldn't call it easy.
I think you put it well. Really any ARM micro isn't going to be as "easy" (I would say "simple") as a basic PIC. PSoC isn't difficult, but there is a lot more you can learn, because there's a lot more it can do.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on October 07, 2014, 10:34:03 pm
Quote
the very limiting 8-bit computational speed,

I would caution your expectation of substantial gains in "computational speed" going to ARMs, particularly low-end ARMs.

Here is a real life example. An IMU algorithm that I have written for myself - fusing 6 DOF sensors together and calculating the resulting quarternions (not going to euler angles).

Here are some numbers for execution speed on CM0 vs. CM3 vs. PIC24F, all running on 8Mhz (PIC24F on 16Mhz crystals), 100 iterations:

CM0 vs. CM3 vs. PIC24F vs. PIC16F1938
0.286s vs. 0.129s vs. 0.371s vs. 0.727s <- No optimization
0.278s vs. 0.134s vs. 0.232s vs. 0.678s <- Max optimization

I would argue that there is minimum gain between CM0 and PIC24F, for practical purposes. CM3, being a little bit more 32bit-ish, has more of an edge over both.

Granted, the algorithm is highly floating point and not terribly friendly for 8-bit chips - I can run it on some AVRs and PICs - but the basic point stands: if computational speed is what you are going after, don't go after the CM0/CM0+ chips and maybe not even CM3 chips.

CM4F is another story, :)

edit: added the numbers for PIC16F1938 (8Mhz cpu and 32Mhz EC) - I would expect the numbers to be similar for other PIC16F chips.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: westfw on October 07, 2014, 11:27:52 pm
Quote
If you need more than 4 UDB's, why would you buy a chip with 4 UDB's?
Not fair.  If you're "evaluating" the PSoC, you don't yet have a clear idea how UDBs are related to the peripherals that you can actually implement.  You're told "This is an 8-bit microcontroller replacement, only better", and you expect it to have peripheral capabilities similar to, say, an ATmega chip: UART, SPI, I2C, ADC and several timers.  And it's not "obvious" from the datasheet which of those requires one or more UDBs...
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Kjelt on October 08, 2014, 06:57:10 am
I would caution your expectation of substantial gains in "computational speed" going to ARMs, particularly low-end ARMs.
Here are some numbers for execution speed on CM0 vs. CM3 vs. PIC24F, all running on 8Mhz (PIC24F on 16Mhz crystals), 100 iterations:
CM0 vs. CM3 vs. PIC24F
No optimization: 0.286s vs. 0.129s vs. 0.371s
Max optimization: 0.278s vs. 0.134s vs. 0.232s 
I agree that relative to the clockspeed the gain is marginal (although the almost factor 2 between PIC24 and CM3 can be called more than marginal  ;) ).
The point is that with the Arm32's you are not going to be stuck on run them on 8MHz/16MHz but can go easy to 72MHz, 120MHz even higher if you buy the bigger ones. So then you do get significant increases in computational power.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on October 08, 2014, 10:31:52 am
I agree with the notion that the arm chips have a wider range of speed and consequently offer more raw performance at higher clock rates, especially for the particular chips in discussion here - STM32F0 for CM0 vs. PIC24FJ. The counter example here is the CM3 chip used: STM32F100 which maxed out at 24MIPS.

To be fair, there are PIC24 chips that go to 40 or 60+MIPS. But they become less price competitive.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 08, 2014, 10:48:48 am
In my experience unless you are involved with things like digital camera or cell phone very few commercial designs require high speed performance. Virtually zero benefit in hobby world unless the goal is to simply learn new architectures. IMO PIC or AVR will cover 99% of the situations in both cases. None of these can beat STM8 for lowest cost. Dannyf may have gone a little overboard claiming he purchased for 15 cents but the ghetto hype did bring that chip to my attention for which I am grateful. So STM8 for cheapest and PIC/AVR for easiest to work with and most support.

The STM32F103C may be king of the ARMs for features/performance/cost and was a lot of fun hacking but IMO 8 bits still rule for most applications.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Kjelt on October 08, 2014, 12:38:35 pm
In my experience unless you are involved with things like digital camera or cell phone very few commercial designs require high speed performance.
Color touch LCD with GUI is already enough to warrant an ARM32. Even IP stack alone would be enough for me to go to ARM32 or you must use third party proprietary implementations that are controlled by some low communication channel but those are usually expensive, and just do not always offer what you need.

For most hobbieist stuff 8 bit rules, but since the ARM32's are going down in price and also start to offer low power alternatives it is becoming a grey area and interesting time.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: westfw on October 08, 2014, 03:49:53 pm
I've decided that I never want to deal with the "warts" that 8bit CPUs add to address more than 64k of memory (either program or data memory.)  I'd rather spend the time learning a 32bit MIPS or ARM chip than spend it figuring out all the Exxx and Xxxxx banking registers and special instructions, and how to get my C compiler to emit them...
So "speed" is less likely to be a reason to go to ARM than "memory."
GUIs, Filesystems, and Networking sure eat up your memory really fast...
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: true on October 09, 2014, 02:15:43 am
...and you expect it to have peripheral capabilities similar to, say, an ATmega chip: UART, SPI, I2C, ADC and several timers.  And it's not "obvious" from the datasheet which of those requires one or more UDBs...

Really? It was completely clear to me before I started that the peripherals in the datasheet had nothing to do with the UDBs. If you think there is a documentation problem, let Cypress know. But literally, right on the first page of the datasheet, under "Features," it shows all of the features and the "programmable digital" is completely separated from Serial Communication (saying it has 2 independent units), Timing and Pulse-Width Modulation (saying it has 4), Capacitive Sensing, etc. All of these do not require UDBs to function, just as is implied because there is a programmable digital section and it doesn't say they use it in the datasheet.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Zeta on October 09, 2014, 05:08:30 pm
Quote
If you need more than 4 UDB's, why would you buy a chip with 4 UDB's?
Not fair.  If you're "evaluating" the PSoC, you don't yet have a clear idea how UDBs are related to the peripherals that you can actually implement.  You're told "This is an 8-bit microcontroller replacement, only better", and you expect it to have peripheral capabilities similar to, say, an ATmega chip: UART, SPI, I2C, ADC and several timers. 
You are told this is a Programmable System on Chip that can do everything a microcontroller can do and more and the fact that the psoc4 is the smaller cheaper of the products. If you were seriously evaluating a psoc you would have at least read the product description and datasheet. Expecting the product list something like 2 UARTs / 1 I2C / 3 counters is like expecting a cpld datasheet list those periperals and it means you have not got it yet.
Datasheet for every part list the number of UDBs plus fixed function peripherals available.
And it's not "obvious" from the datasheet which of those requires one or more UDBs...
every component datasheet has a "Resources" and a "Api Memory" section where you can find out how many macrocells, datapaths, etc the component and it's api use. 

if you read the datasheet you will find out what's inside of a UDB. Rule of thumb for non optimized /placed UDB based component is 8bit-component-->1 UDB 16bit-component--->2UDB
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SirNick on October 09, 2014, 10:57:45 pm
For most hobbieist stuff 8 bit rules, but since the ARM32's are going down in price and also start to offer low power alternatives it is becoming a grey area and interesting time.

I used to think so too (about hobbyist, 8-bit, etc.), but I think once there are better guides for newbies, those low-end ARMs are going eat AVR alive.  I needed a micro in a simple sensor application the other day... so I looked at my options.  Needed 1 USART, i2c, and some GPIO -- nothing special.  Most of the really inexpensive AVRs didn't have the combo I needed, so I had to choose between the ATtiny 2313/4313 or an ATmega.  Minimum, $1.80 per... more like $3 if I wanted a whole kilobyte of RAM.

OTOH, there were lots of options in the CM0+ space that would fit the bill, many of which could be had for $1.50 or less.

Whew.  I fought it for a while, but I think some of you guys that have been saying this for a while are right.  AVR's days are numbered.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: David Hess on October 10, 2014, 12:28:22 am
For most hobbieist stuff 8 bit rules, but since the ARM32's are going down in price and also start to offer low power alternatives it is becoming a grey area and interesting time.

I used to think so too (about hobbyist, 8-bit, etc.), but I think once there are better guides for newbies, those low-end ARMs are going eat AVR alive.

...

Whew.  I fought it for a while, but I think some of you guys that have been saying this for a while are right.  AVR's days are numbered.

On one hand, I am not convinced that ARM will be able to compete at the lowest power and standby power levels where the 8 bit microcontrollers like AVR and PIC outperform them but on the other hand, I also cannot see that being a viable long term market.  On the gripping hand, something has to exist in this market and 8-bit parts are always going to be more power efficient in this type of application.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: westfw on October 10, 2014, 12:38:46 am
Zeta and True seem to be saying opposite things about UDB requirements of peripherals on PSoC.  No wonder I'm confused. :-(
I attended some Cypress 1-day training seminar for PSoC (3 or 5; this was before the PSoc4 came out.)   On PSoC 5, UARTs and SPI definitely needed to use the configurable logic.  (Looking at old datasheets, it seems that on PSoC 1, even timers used the logic.  It looks sorta like Cypress has gradually moved "common" peripherals to stand-alone logic. catering to SW people over HW designers...)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 10, 2014, 12:44:45 am
On one hand, I am not convinced that ARM will be able to compete at the lowest power and standby power levels where the 8 bit microcontrollers like AVR and PIC outperform them but on the other hand, I also cannot see that being a viable long term market.  On the gripping hand, something has to exist in this market and 8-bit parts are always going to be more power efficient in this type of application.

PSoC 4200 (M0) measured while running 5 mA.

Other modes from their datasheet:
Sleep 1.3 mA (opamps operational)
Deep Sleep with 1.8 to 3.6 V input: 1.3 uA
Deep Sleep with 3.6 to 5.5 V input: 15 uA
Hibernate: 150 nA
Stop: 20 nA

The last two (Hibernate and Stop modes) are resumable by GPIO
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 10, 2014, 02:38:59 am
Minimum, $1.80 per... more like $3 if I wanted a whole kilobyte of RAM.

OTOH, there were lots of options in the CM0+ space that would fit the bill, many of which could be had for $1.50 or less.

AVR's days are numbered.

I've been hearing that for the past 15 years starting not too long after they first became popular. Same for 6502 and 8051 which to this day are tucked away in half the products out there. Kinda like Mac and Linux guys who carry around signs saying "Wintel is Dead" but their own market share doubles every month (actually stays unchanged at single digit percent combined).

Along with helicopter in every garage and space ship in every back yard futurists been predicting the death of 8 bit since 16 bit TI unveiled in second issue of byte magazine. Having played around with these new fangled 32 bit wonders for some time now (ONE whole month!) I'm convinced there's no huge advantage over the old timers in performance, features, or cost and a long ways to go on tools and community support.

IMO the end is (far from) near.

BTW brand new MEGA8A with 1K can be had on Aliexpress for 40 cents each and MEGA328 (2K) for about 90 cents, 20pcs and 10pcs respectively. About half in thousands. The only competition in that category last few years is STM8 at a quarter each hobby or 15 cents dannyf-qty. Nothing even close in ARM-land. Do the math.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: true on October 10, 2014, 02:56:18 am
Minimum, $1.80 per... more like $3 if I wanted a whole kilobyte of RAM.

OTOH, there were lots of options in the CM0+ space that would fit the bill, many of which could be had for $1.50 or less.

AVR's days are numbered.
I'm convinced there's no huge advantage over the old timers in performance, features, or cost
Really? Because pick 2 out of 3 of those and you'll find it with the cheap ARMs out there.

$0.29 CM0 in small product run quantities?
180MHz CM4? Or 72MHz CM3 for ~$1.60? With 5 UARTs, tons of timers and PWM, DACs, USB, and other stuff you might use?

If you said cost for the lowest-end-possible-for-application in high quantity, maybe. For low to medium quantity where it matters less, for performance and for features you couldn't be farther off the mark though.

8-bit has its place and it isn't in performance or features anymore :)

Quote
BTW brand new MEGA8A with 1K can be had on Aliexpress for 40 cents each and MEGA328 (2K) for about 90 cents, 20pcs and 10pcs respectively. About half in thousands. The only competition in that category last few years is STM8 at a quarter each hobby or 15 cents dannyf-qty. Nothing even close in ARM-land.
I'm not understanding your argument - you are making various points, then defending only one of them at the expense of the others. But hey, if you trust your ghost shift chips or metal-slug-in-package products, and they're fast enough for your application, go for it!
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 10, 2014, 03:41:26 am
hey, if you trust your ghost shift chips or metal-slug-in-package products

As part of my day job I purchase and test large quantity integrated circuits and have to laugh at those old wives tales. Many years ago Scenix/Ubicom, a marginal cohort of Parallax, produced super-PIC clones with a steel slug installed to dissipate heat from the regular die overclocked at the amazing (for that time) 50mhz. It's hard to imagine what purpose this would serve today. Heavy chips better than light ones?

As far as fakes it's unlikely anyone in the Evil Empire would produce those when refurbs are available for 1/20th the cost. Few over there have silicon foundry or glass/epoxy injection lines in the basement. Having had literally millions of chips pass though last few years there has not been a single case where Ebay or Aliexpress Buyer Protection did not solve any problems to my satisfaction. Mother company Taobao is bigger than Amazon, Ebay, Bonanza, and the others combined and not by screwing people. In case it escaped attention yesterday one famous Asian country surpassed USA as world leader in trade AND gdp. That means worlds largest economy and they didnt get there by selling fake ICs.

I see two major factions in the purchasing/procurement world: neopatriots and xenophobes for whom Digikey and Mouser are it, and the rest of the world that depends on reliable and low cost materials for long term survival. I'm not complaining because, as I've said before, without suckers to shell out for inflated margins to support marketing and infrastructure it wouldn't be possible to snag the great deals for myself and clients.


Quote
BTW brand new MEGA8A with 1K can be had on Aliexpress for 40 cents each and MEGA328 (2K) for about 90 cents, 20pcs and 10pcs respectively. About half in thousands. The only competition in that category last few years is STM8

I'm not understanding your argument - you are making various points, then defending only one of them at the expense of the others.

My point was these are all 8 bit parts and even for the worst of those there is nothing similar in the 32 bit world with any great advantage.


Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: true on October 10, 2014, 06:54:01 am
blathering
If your religion makes you happy. What does it have to do with easy to move to "greater than 8-bits" MCU? Create a new religion thread maybe?


My point was these are all 8 bit parts and even for the worst of those there is nothing similar in the 32 bit world with any great advantage.
Well, that certainly wasn't what I expected as that is a pretty clever simplification of the nonsense you wrote originally. But to entertain your new point, while there may be nothing "similar" (if all factors are combined rather than separated as in your original argument), if it isn't what is needed, it isn't what is needed. Find the part that fits the application. Your argument is still pointless. Basically all you argued is you can buy some low spec chips for cheap and therefore they are the best at everything because of that. Congrats I guess? I vehemently disagree. Regardless, what does it have to do with easy to move to "greater than 8-bits" MCU or discussion of said "greater than 8-bits" MCUs?

I will refrain from responding to any of your future posts in this thread, as nothing formative much less on-topic comes of it.

---

SuzyC, I went ahead and looked at analog part PSoC 4100/4200 TRM, and a possible on-chip solution for your analog ADC input impedance situation would be to use the built-in op-amps. You can assign any pin to them on either of the two AMUXBUS then use the output of the op-amp on the SARMUX bus as an input for the ADC. There is even an example shown on page 203 of the TRM for doing this in single-ended or differential mode. And again, this works on any AMUXBUS pin, which as I understand it means all I/O pins can support high-impedance analog.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 10, 2014, 07:29:52 am
blathering

Probably a good idea to refrain from responding if fabricating quotes and squealing about "religion" instead of reasonable discussion is the best you can do. It tells me something was hitting close to home.

http://en.wikipedia.org/wiki/Psychological_projection (http://en.wikipedia.org/wiki/Psychological_projection)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on October 10, 2014, 11:36:13 am
Quote
8-bit parts are always going to be more power efficient in this type of application.

Generally not true. MSP430 and some CM0+ chips from Energy Micro and Freescale are generally leading the pack on current consumption.

The comparison, however, isn't exactly fair in that 8-bitters generally don't offer the ability to turn off peripherals and 16/32-bit chips generally do offer peripheral-specific clock management.

However, even if you were to compare full-out, those CM0 chips offer comparable current consumption vs. 8-bit chips - I tested some in the ghetto thread for example.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 10, 2014, 09:51:42 pm
Squealing reasonably in the face of hypocrisy

LMFAO. At least the gummint gets a little break now.  One thing is for sure it takes a real sense of humor to survive on the internet. More blathering:

8 bit vs 32 bit discussion don't sound too far off topic here to me. It looks like noobs have a tendency to develop 32 bit stars in their eyes because... well... it's 32 BIT! Just the sound of that makes you want to jump on board. At least that was the case with me. It's hard to stand back and simply analyze real needs when there's such a gap between reality and perception.

I don't say whether 32/8 one is better than the other in all cases. MEGA328 is not a good choice for Android tablet or cell phone but neither is top of the line ARM best bet for a dollar store color LED toy. My comments were more relevant for majority applications like hobby and mid level commercial products which seem to be the main subject in this forum.

After running a dozen different ARM chips from 5 makers last few weeks I conclude they do not have a big leg up over the oldies. More memory but they NEED more. The GPIO ain't that fast either after clock restrictions. 72mhz sounds great untill you actually try to see how fast a pin can wiggle.

103c: Best deal in the $1 ARM arena considering features and performance. Not the only deal though. LPC has definite advantages (all bits on one port, etc) as does Silabs (DAC!).

STM8: Lowest cost MCU with reasonable capability. Lowest cost PERIOD!

PIC/AVR: Best choice for hobby and quick turn commercial. No equal for support and availability. I predict here to stay.

IMO the current hype and infatuation over 32 bit is overblown but that don't mean I'm saying they are useless.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SirNick on October 10, 2014, 09:59:01 pm
I don't think it's just xenophobes, et all, that are concerned about product sourcing.  The whole traceability thing is a pretty big factor.  Can you imagine if, in any of the number of recent auto industry recalls, the manufacturer had said "well no, we can't really guarantee the MCUs were genuine -- we got them for a few cents apiece from Alibaba.."

Hobbyists do whatever they want, and that's cool.  So does much of the gray market, and you usually expect the products there to be of dubious quality and reliability.  But, when you buy a name-brand product -- and without question, when it's possible that product could harm you or others if it behaved erratically -- no one... is going to be looking for the dirt cheap deals on auction sites.  ;)

That said, I don't have any insight on the direct-to-vendor sales numbers, or the deals you might strike with distributors for large (but not quite that large) quantities.  I didn't even compare the 1000 qty prices, for example, so it could work out differently.  Still, after dipping my toes in the ARM waters, those AVRs look awful expensive for what you get.  Just an opinion, subject to fallacious reasoning and conclusions jumped-to.  I could be dead wrong, and often am.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on October 10, 2014, 11:28:48 pm
Why the PSOC4 is a POS..a brief reply to some Corporate comments:

I said, "The PSOC4 documentation for most UDB (functional blocks such as PWM ADC etc) are so very vague and poorly explained that it required hours upon hours to experiment,  trying to understand how to get these functional blocks to work.
    For instance the PWM requires code to turn off and on the PWM just to set  Duty Cycle to zero, else the DCyC reverts to 100% when it should be 0, (PWM single output compare match for PWM Duty Cycle) for a simple single-output PWM."
-------------------------------------------------
But  some kind of Cypress apologist says,"I disagree that the datasheets are vague.  If anything, they are excruciatingly detailed, going into clock cycles for various commands, memory usage, interactions with other parts and more.   For example, just the PWM datasheet alone is 46 pages, the ADC datasheet is 30 pages, etc.   They also note in every datasheet that you can get example code and sample projects right from within Creator by clicking "File -> Example Project".  There you can filter by PSoC family, chip range and example type.  There are 3 example projects just for the PSoC4, 4200 family, ADC which show the component in use (and you can compile and use the samples if you like)."
-----------------------------------------------------
Let us look at my experience with creating a simple PWM:

Eager to learn how to use this part, I enthusiastically found that  Cypress offers two Tutorial Videos (each less than a few minutes long) about how to use PSOC Creator. In fact, the first introductory video features how to create a  PWM without using any C-code.

What astonished me was how Cypress might consider this as such wonderful HW accomplishment of PSOC Creator. If I wanted to blink a LED without any C-language code, me or any other electronic noobie could so easily do this with a 555 timer rather than going to the trouble of purchasing a PSOC4 eval. kit. It would seem the purpose of any tutorial on how to use a powerful, versatile 32-bit CPU would be to show that the chip could be programmed, to be used for something more than blinking an LED, to be programmatically used for something more than the most trivial of MCU tasks.

Secondly, after going through the 40 or so pages explaining the PWM  UDB, I was quite astonished, that all this info does not even show how to code the most common and simple single output PWM module. I would expect to be quickly shown how to create  a single output PWM (that is, a PWM UDB with a single output that can be programmed to vary from 0 to 100% to control power without dangerously reverting to 100% duty cycle when a programming attempt is made to set the duty cycle to 0.)  But I don't find this coding info, almost no useful c-code for any PWM purpose.

Ok, so I reminded by some Corporate advice, "There are always Examples to further explain how to use a UDB (in this case PWM) module.
So I search the Cypress 42xx family Project Examples of PWM and I find the one and only one PSOC4 Example It clearly shows me how to initialize and start an example PWM, nothing more, actually showing a few lines of  c-code, however it amounts to nothing, just what is needed to start the PWM module, nothing about usefully controlling duty cycle.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 10, 2014, 11:41:24 pm
32 bits is a big deal, at the same frequency you can work over 3 times faster than 8 bits, I don't dare to say 4 times but it's somewhere in between.

At SuzyC, the examples he is indicating are built in Creator 3.0. I'll put more details on how to access those in a bit.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on October 10, 2014, 11:47:22 pm
Quote
just what is needed to start the PWM module, nothing about controlling duty cycle.

It may not be bad.

For example, I use a set of routines to manage my own pwm generation (not on your particular chip but on a set of chips from 8-bit avr, 16-bit pic to 32-bit CMx) and all you need to is to initialize the pwm module, set the period and then alter the duty cycle for the specific channels.

I am sure you can do that on your psoc chip as well.

The key is really to slow down and learn the chip, the environment (compiler, ide and libraries, and in this case, the programming approaches) and practice.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SirNick on October 10, 2014, 11:47:37 pm
Welcome to ARM development.  You get two videos:  One, showing you how to install the IDE.  ("Choose a folder.  Click next.  Click I Agree.  Click next.")

Then, another showing you the vendor's dev kit running 3-phase motors, driving an LCD, communicating via Ethernet, and enumerating as a USB device.  They refer you to the example code for more information.

At that point, it's up to you to sit down with a cup of coffee and nothing better to do this week, where you read through C code so ugly, you expect to get frowny emoticons from the compiler.

It is a combination of breaking down the various macros, defines, and mostly uncommented code, and reading 300 pages of datasheet sections, that will eventually get you to the point of writing all the code necessary to duplicate a 555 timer in software.

Anyone on this forum that has successfully gotten an LED to blink has been through this, and unless you want to stay in the PIC / AVR pool for the rest of your days, you will too.  It's not much fun at first, but it's a rite of passage.  You get to add a little peak to your learning curve by nature of having to build your own peripherals as well, but in return you get a notch in your workbench that many others don't have.  Yay you!
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 11, 2014, 12:31:40 am
Why the PSOC4 is a POS..a brief reply to some Corporate comments:
...
Ok, so I reminded by some Corporate advice, "There are always Examples to further explain how to use a UDB (in this case PWM) module.
So I search the Cypress 42xx family Project Examples of PWM and I find the one and only one PSOC4 Example It clearly shows me how to initialize and start an example PWM, nothing more, actually showing a few lines of  c-code, however it amounts to nothing, just what is needed to start the PWM module, nothing about usefully controlling duty cycle.

If you start PSoC Creator 3.0 and then do: File->Example project, the example project window will pop up. (or you can click in "Find Example Project" under the Examples and Kits link in the Start Page).

Select PSoC4 under Architercture
PSoC 4200 under Family and you find 45 sample workspaces.

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112668;image)

Granted they are targeted for other boards so the projects are not bootloadable, but you can add the bootloader and bootloadable yourself (which they do have samples for them as well)

Also most are for the Pioneer (CY8CKIT-042) but that has exactly the same chip as the prototype board, so you can use the same pins in the sample code or change the pins to what is convenient to you.


I wouldn't use the keyword to find PWM examples but look at:

TCPWMExample
PWMExample
QuadDecExample and
TimerExample

For all four configurations of the TCPWM Component options.

If you already have an empty bootloadable workspace, click in the "Add to Existing Workspace" (provided you opened the bootloadable/bootloader project) so you can use the example to use as a reference to modify your bootloadable top design project.

If you select Create New Workspace it will place it in "My Documents/PSoC Creator" by default and name the project in a subfolder  (something like TCPWMExample01)

Also the 100 projects in 100 days has other PWM examples but I already linked those many times earlier.

Edit: to avoid using the Bootloader/Bootloadable you can follow this minitutorial to turn one of your kits into a programmer (not a debugger) but you can use this to program the others without a bootloader.

https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg522554/#msg522554 (https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg522554/#msg522554)

Of course if you want to revert the changes you will have to use this to program the bootloader back into the prototype board, you can't just press the button to activate the bootloader if it's not present.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 11, 2014, 01:41:04 am
So using the prototype board setup as a programmer as in the second part of that 3 part link:

https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg522554/#msg522554 (https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg522554/#msg522554)

I opened the TCPWMExample, changed the device to my 2nd prototype board (in my case it's a PSoC 4100 because I wanted one of each) left the pins alone but made sure P0[3] was connected to a blue LED and P0[2] to a green LED.

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112676;image)

Yellow wire is SWDCLK, Blue is SWDIO, White is XRES, and power to the rail as well as ground.

After compiling and copying the path of the resulting hex file, I used part 3 to use the python script to program the board.

Total time 5 minutes if that much, and most of the time was setup.

Edit: you don't have to get rid of the usb-uart, detached it because I'm trying to configure is as an I2C to see If I can make a full programmer/debugger with one of these prototype boards.

Edit2: of course this got rid of the bootloader on the target prototype board (the 4100 one) But I can make a bootloadable project and reprogram it so it to restore the bootloader if I had the need for it.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 11, 2014, 02:32:47 am
As for power consumption.

ATmega8A from datasheet:
Power Consumption at 4MHz, 3V, 25 C
– Active: 3.6mA
– Idle Mode: 1.0mA
– Power-down Mode: 0.5uA

PSoC 4200 at 24MHz

Active measured 5mA
Datasheet:
- Active: 6.7mA
- Sleep 1.3 mA (opamps operational)
- Deep Sleep with 1.8 to 3.6 V input: 1.3 uA
- Deep Sleep with 3.6 to 5.5 V input: 15 uA
- Hibernate: 150 nA
- Stop: 20 nA

PSoC Active various frequencies:
6MHz  2.2 mA
12MHz 3.7mA
24MHz 6.7mA
48MHz 12.8mA

So at 12MHz it consumes the same as the ATmega8A
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 11, 2014, 04:59:22 am
Btw, this is a triple compare pwm example on a single UDB

http://www.element14.com/community/message/84542/l/psoc-4-pioneer-kit-community-project059-but-wait-there-s-more-single-pwm-with-3-outputs#84542 (http://www.element14.com/community/message/84542/l/psoc-4-pioneer-kit-community-project059-but-wait-there-s-more-single-pwm-with-3-outputs#84542)

I didn't try it but I did take the other PWM sample and create 4 PWMs.
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112701;image)
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112703;image)
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112705;image)

Here is the resource report:
Code: [Select]
Resource Type                 : Used : Free :  Max :  % Used
============================================================
Digital clock dividers        :    0 :    4 :    4 :   0.00%
Pins                          :    6 :   30 :   36 :  16.67%
Interrupts                    :    4 :   28 :   32 :  12.50%
Comparator/Opamp Fixed Blocks :    0 :    2 :    2 :   0.00%
SAR Fixed Blocks              :    0 :    1 :    1 :   0.00%
CSD Fixed Blocks              :    0 :    1 :    1 :   0.00%
CapSense Blocks               :    0 :    1 :    1 :   0.00%
8-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
7-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
Temperature Sensor            :    0 :    1 :    1 :   0.00%
Low Power Comparator          :    0 :    2 :    2 :   0.00%
TCPWM Blocks                  :    4 :    0 :    4 : 100.00% <-- four PWMs all used.
Serial Communication Blocks   :    0 :    2 :    2 :   0.00%
Segment LCD Blocks            :    0 :    1 :    1 :   0.00%

Edit: Oh, and they are all 4 16 bits:
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112707;image)

And just for those that are not following from before, this is the PSoC4100 with no analog blocks and "only" clocks at 24MHz
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Kjelt on October 11, 2014, 11:10:51 am
STM8: Lowest cost MCU with reasonable capability. Lowest cost PERIOD!
Last year you might have been right but this year the shift has already begun and it is shifting towards the new low cost champion: the cortexM0, and I hate to admit it since I am a STM8 admirer.
The single reason is that the M0 is being made in a much smaller nm chip processing technology than the STM8 so one wafer contains many more uC's.
It might not yet show up in low quantity hobby orders with digikey/farnell/ebay etc. but ordering with the factories in huge quantities the STM8 is (going to be) more expensive.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 11, 2014, 11:43:35 am
True made similar statements earlier in this thread but it conflicts with my own research. Do you have a link to M0 or any other MCU 8 or 16 bit costing less than 15 "ghetto" cents, $.21 (100pc) I've actually purchased these for, or even the common $.25 STM8S003 pricing?

Maybe more appropriate to continue here:

https://www.eevblog.com/forum/microcontrollers/one-dollar-one-minute-arm-development/msg528533/#new (https://www.eevblog.com/forum/microcontrollers/one-dollar-one-minute-arm-development/msg528533/#new)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on October 11, 2014, 11:53:59 am
Quote
it is shifting towards the new low cost champion

The biggest problem stm8 faces isn't likely cost: there lacks a reason to use such devices. ST7 wasn't terribly popular then and CM0/CM0+ is really killing those chips. So it is hard-pressed to come up with a reason to use STM8 - I have a couple but they are highly limited to niche applications.

ST initially marketed those chips on their peripheral compatibility with the STM32 chips - a promise they largely didn't keep.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: 22swg on October 11, 2014, 03:59:20 pm
16 better than 8 ? Suzy.
http://digitaldiy.io/forum/general-electronics/2396-a-diy-pic24h-dev-board#16966 (http://digitaldiy.io/forum/general-electronics/2396-a-diy-pic24h-dev-board#16966)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 11, 2014, 11:51:30 pm
Another thing about the post above using 4 PWMs at once. That was a 4100 so no UDBs, here is the report when programming a 4200 (CY8C4245PVI-482), same capabilities as the one in the prototype board, other than less pins. (24 vs 36)

Code: [Select]
Resource Type                 : Used : Free :  Max :  % Used
============================================================
Digital clock dividers        :    0 :    4 :    4 :   0.00%
Pins                          :    6 :   18 :   24 :  25.00%
UDB Macrocells                :    0 :   32 :   32 :   0.00%
UDB Unique Pterms             :    0 :   64 :   64 :   0.00%
UDB Datapath Cells            :    0 :    4 :    4 :   0.00%
UDB Status Cells              :    0 :    4 :    4 :   0.00%
UDB Control Cells             :    0 :    4 :    4 :   0.00%
Interrupts                    :    4 :   28 :   32 :  12.50%
Comparator/Opamp Fixed Blocks :    0 :    1 :    1 :   0.00%
SAR Fixed Blocks              :    0 :    1 :    1 :   0.00%
CSD Fixed Blocks              :    0 :    1 :    1 :   0.00%
CapSense Blocks               :    0 :    1 :    1 :   0.00%
8-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
7-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
Temperature Sensor            :    0 :    1 :    1 :   0.00%
Low Power Comparator          :    0 :    2 :    2 :   0.00%
TCPWM Blocks                  :    4 :    0 :    4 : 100.00%
Serial Communication Blocks   :    0 :    2 :    2 :   0.00%
Segment LCD Blocks            :    0 :    1 :    1 :   0.00%

Not a single UDB was used.

Here is the schematic of the modules used

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112874;image)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 12, 2014, 06:36:55 am
But wait! There is more!

6 PWMs using 2 UDBs plus the 4 TCPWMs and still 2 UDBs left.

Code: [Select]
Resource Type                 : Used : Free :  Max :  % Used
============================================================
Digital clock dividers        :    1 :    3 :    4 :  25.00%
Pins                          :    8 :   16 :   24 :  33.33%
UDB Macrocells                :    9 :   23 :   32 :  28.13%
UDB Unique Pterms             :    8 :   56 :   64 :  12.50%
UDB Total Pterms              :    8 :      :      :
UDB Datapath Cells            :    2 :    2 :    4 :  50.00%
UDB Status Cells              :    1 :    3 :    4 :  25.00%
            StatusI Registers :    1
UDB Control Cells             :    1 :    3 :    4 :  25.00%
            Control Registers :    1
Interrupts                    :    5 :   27 :   32 :  15.63%
Comparator/Opamp Fixed Blocks :    0 :    1 :    1 :   0.00%
SAR Fixed Blocks              :    0 :    1 :    1 :   0.00%
CSD Fixed Blocks              :    0 :    1 :    1 :   0.00%
CapSense Blocks               :    0 :    1 :    1 :   0.00%
8-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
7-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
Temperature Sensor            :    0 :    1 :    1 :   0.00%
Low Power Comparator          :    0 :    2 :    2 :   0.00%
TCPWM Blocks                  :    4 :    0 :    4 : 100.00%
Serial Communication Blocks   :    0 :    2 :    2 :   0.00%
Segment LCD Blocks            :    0 :    1 :    1 :   0.00%

Although the last two share the same interrupt.
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112904;image)

Maybe I can squeeze another 2, although the datasheet says these PWMs only use one UDB maybe they share the datapath cells which this last one used two of them(one per output pin I guess). Still I should be able to do 8 total.

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112906;image)

And yeah, the 2 new ones are still 16 bits:
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112908;image)

But I did move to the 4200, the 4100 doesn't have UDBs so it can only have 4.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 12, 2014, 07:32:06 am
Well 8 count for 16 bits PWMs on the PSoC 4200, but now I'm out of datapaths on the UDB and maxed out on TCPWMs blocks as well:

Code: [Select]
Resource Type                 : Used : Free :  Max :  % Used
============================================================
Digital clock dividers        :    1 :    3 :    4 :  25.00%
Pins                          :   10 :   14 :   24 :  41.67%
UDB Macrocells                :   16 :   16 :   32 :  50.00%
UDB Unique Pterms             :   15 :   49 :   64 :  23.44%
UDB Total Pterms              :   15 :      :      :
UDB Datapath Cells            :    4 :    0 :    4 : 100.00%
UDB Status Cells              :    2 :    2 :    4 :  50.00%
            StatusI Registers :    2
UDB Control Cells             :    2 :    2 :    4 :  50.00%
            Control Registers :    2
Interrupts                    :    6 :   26 :   32 :  18.75%
Comparator/Opamp Fixed Blocks :    0 :    1 :    1 :   0.00%
SAR Fixed Blocks              :    0 :    1 :    1 :   0.00%
CSD Fixed Blocks              :    0 :    1 :    1 :   0.00%
CapSense Blocks               :    0 :    1 :    1 :   0.00%
8-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
7-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
Temperature Sensor            :    0 :    1 :    1 :   0.00%
Low Power Comparator          :    0 :    2 :    2 :   0.00%
TCPWM Blocks                  :    4 :    0 :    4 : 100.00%
Serial Communication Blocks   :    0 :    2 :    2 :   0.00%
Segment LCD Blocks            :    0 :    1 :    1 :   0.00%

But still have UDB resources available other than not external. This is the schematic the last 4 share 2 interrupts, I can make the last four single output and each have their own interrupt since there are plenty of interrupts left.

Also I could have 7 PWMs and an  TimerCounter, or 6PWMs timer counter and quadrature decoder.
On top of that I could let the first 4 TCPWMs unconfigured and configure them on the go programmatically.

Anyways, this is the schematic:
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112911;image)

Here they are all off (or barely on):
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112913;image)

And here they are brighter:
(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=112915;image)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 12, 2014, 11:22:10 pm
SuzyC,

You might be interested in this project with full source:

Flying PSoC4:
http://www.cypress.com/?app=forum&id=2492&rID=93005 (http://www.cypress.com/?app=forum&id=2492&rID=93005)

It's a proof of concept that runs 4 servos directly from 4 pots. And will work on the Pioneer or the KIT-049-42xx prototype board like the ones you have.

I haven't tried it yet, but it does compile. It also has a multi-page schematic so when you open the top level design, make sure you look at all the pages.

Edit, it leaves plenty of space for other things:
Flash used: 5350 of 32768 bytes (16.3 %).
SRAM used: 1564 of 4096 bytes (38.2 %).

And plenty of resources left including 2 full UDB datapath cells and 11 macrocells.

Code: [Select]
Resource Type                 : Used : Free :  Max :  % Used
============================================================
Digital clock dividers        :    1 :    3 :    4 :  25.00%
Pins                          :   13 :   23 :   36 :  36.11%
UDB Macrocells                :   21 :   11 :   32 :  65.63%
UDB Unique Pterms             :   24 :   40 :   64 :  37.50%
UDB Total Pterms              :   24 :      :      :
UDB Datapath Cells            :    2 :    2 :    4 :  50.00%
UDB Status Cells              :    1 :    3 :    4 :  25.00%
            StatusI Registers :    1
UDB Control Cells             :    1 :    3 :    4 :  25.00%
            Control Registers :    1
Interrupts                    :    2 :   30 :   32 :   6.25%
Comparator/Opamp Fixed Blocks :    0 :    2 :    2 :   0.00%
SAR Fixed Blocks              :    1 :    0 :    1 : 100.00%
CSD Fixed Blocks              :    0 :    1 :    1 :   0.00%
CapSense Blocks               :    0 :    1 :    1 :   0.00%
8-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
7-bit CapSense IDACs          :    0 :    1 :    1 :   0.00%
Temperature Sensor            :    0 :    1 :    1 :   0.00%
Low Power Comparator          :    0 :    2 :    2 :   0.00%
TCPWM Blocks                  :    4 :    0 :    4 : 100.00%
Serial Communication Blocks   :    0 :    2 :    2 :   0.00%
Segment LCD Blocks            :    0 :    1 :    1 :   0.00%

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Kjelt on October 13, 2014, 07:49:51 am
miguel it looks like you better can start your own topic, people interested in the psoc4 shall not find it here. And it looks like Suzy already has left the psoc4 boat.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 13, 2014, 08:08:09 am
I thought so too but these naughty topics don't always behave as well as we sometimes plan. Looks like "Easiest to Graduate" is the new "PSOC Examples". :) Miguel is very enthusiastic about his true love. I didn't mind at all to see these posts show up in the $1 thread because I learned a lot and it opened my eyes to another potential member of the club.

Speaking of which I've done some experiments on the 1.5k ADC subject. Noticing that with 100k pot pin 1.7 was giving accurate results when 1.6 was way off I looked into it. Main difference was a 1uf cap so I tried putting one on 1.6. Sure enough reading improved in a big way. Looks like the impedance is mainly reactive (probably high series R before S/H too) and tacking a few uf on can save using those unbelievably hard to come by op amp blocks. Of course this won't do for high sample rate DSP type apps but that's not likely a problem reading robot position sensors.

ps.Here's a photo of my ADC test setup:

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 13, 2014, 08:19:07 am
miguel it looks like you better can start your own topic, people interested in the psoc4 shall not find it here. And it looks like Suzy already has left the psoc4 boat.

That might be the case, but the topic was about controlling multiple motors and finding another MCU capable of doing so.

So SuzyC gave up too early on the PSoC, when it's more than capable, and I should just say nothing?

Nah, just because of a few road bumps, one should not give up. Actually if the OP didn't need them all to be 16 bits, the PSoC 4 prototype board can do 4 16bit PWM and 12 8 bit ones, for a total of 16 motor controls in a single $4 prototype board.

So I won't post the 16 PWMs in a single board example, but just because one can't see what a chip can do it doesn't mean they can claim is useless and won't fit that specific need, I'm just showing it does with plenty of spare capabilities.

But I already said my peace on how capable that chip is, but it's my prerogative to prove that it is. After all it's not my subject so I really shouldn't need to do my own topic because I have no need to run multiple motors, at least not yet ;)

Edit: I haven't even gone to how you can take one of those components and modify them to your own needs. Meaning I can make my own custom PWM based on the ones supplied with full source and resources, just like if I started the component from scratch myself. I do wish it was an M3 with lower clock cycles or that the 5LP was more affordable, but the 4 with the M0 is more than capable.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: SuzyC on October 13, 2014, 01:44:39 pm
Suzyc does not give up, Suzyc fights to the last.
Suzyc sometimes gets discouraged by frustration.

Any device that fails to clearly document a product and forces the a customer to review  poorly developed documentation that ultimately force even a serious programmer to resort to an endless game of guessing and googling is a POS.

Life is too short for this.


Ok, once more why the PSOC4 is a POS:

I suddenly see PWM's expanding from my own limit of two two-output 16-bits PWM UDBs to a single non-UDB block of maybe up to eight PWM's. When I add the A2D block and a counter UDB, I am limited to one 2-output 16-bit PWM and somehow it allows me to add one more 8-bit  PWM and then if I change it to a 16-bit PWM I get the "need 5  you only got 4 " gotcha!

When I search the resources of my chip I do not find these hybrid multi-more PWM enabled PWM blocks.  Why is it that the Great Creator and Cypress gives me no hint they even exist or can be created  And while there are those that undoubtedly created these blocks so essential to my MMMMM's, I have not been guided by Cypress PWM UDB documentation on how to implement them without exhausting my UDB count .  Cypress's chain of information seems to fail me in that it so well succeeds in hiding the info I need. With Microchip, I can get this info just by carefully studying the chip Spec Sheet.

So, that's why the PSOC4 is a POS.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: Laurynas on October 13, 2014, 01:51:11 pm
Those multiheaded PWMs are user libraries and while it would be nice for Cypress to add them to Creator, I think one should not fault them that they don't have all user created content in their software.
Myself i used those components in a 20 digital input + 12 PWM output board. It would have been faster to have them in Creator, but 5mins of googling did the job.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 13, 2014, 02:36:03 pm
Actually they are both installed by default, I didn't use any user created ones. One is called PWM the other TCPWM and they are both in the same toolbox.

The only one that is not in there and you can get from the user community is the 3 output 8 bit one. Did you even looked at the quadcopter link and code in there?

but it's obvious I'm wasting my time, so Uncle.

Edit: This is how obvious the two components are, right in plain view. Top one takes no UDBs the bottom one takes 2 UDB paths (for 16 bit transfers) per. Hook Interrupts to them, clear the interrupt when called and set whatever needs to be set in the interrupt, it really can't get any simpler than that.

(https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/?action=dlattach;attach=113071;image)
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: dannyf on October 13, 2014, 02:36:38 pm
Quote
even a serious programmer to resort to an endless game of guessing and googling is a POS.

I am not a serious programmer so the above statement definitely doesn't apply to me.

I just wanted to point out that no one is an expert on anything day 1. You have to learn, serious programmer or not. When you try to learn, you use every resource available to learn, googling included. I am not quite understanding your googling aversion.

From afar, the situation looks like your frustration with learning, more so than with the chip. Frustration is unfortunately part of the learning. Either you tough it up and come out on the other end as a winner, or you get back to things you are comfortable with.

I don't know that chip that well - I actually find it quite limiting and its programming approach unappealing to me. But I find the concept of mcu + cpld quite useful in some applications. So it seems to me a lot more productive if you focus on getting the chip to work for your application than complaining about its limitations.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 13, 2014, 06:22:45 pm
I do understand frustration, but even after 30 years of programming, when I try something new, I feel no problem asking a coworker for help if he/she has already researched that topic in a system and other senior programmers come to me to ask me questions on things I already researched.

For example XboxOne is a total different beast, it's hard sometime to find the right documentation, if any is available, etc, but we still push along regardless and you find senior and junior programmers alike helping each other. Maybe I'm more adaptable to changes since in my field things change constantly and maybe because of that I find it easy to navigate through the documentation provided by Cypress, which is maybe overwhelming but surely not lacking.

So If you need clarification, you can always ask. It's easier to ask how do I fit four 16 bits PWMs an ADC and a counter than just saying, this is a piece of shit and I know it can't be done so I'm not going to even bother asking, because if I can't figure it out then is useless and I'll complain about it instead of seeking for help.

So if you just need  four 16 bits PWMs an ADC and a Counter then use 2 single channel hardware based TCPWMs, 1 dual channel 16 bits UDB based PWM (it uses 2 UDB datapaths 8 bits each out of 4 available) Then use a TCPWM based timer counter that uses no UDBs and you can fit your ADC with ease.

Of course clearing the interrupt is different in the TCPWM than in the PWM.

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 13, 2014, 06:48:45 pm
Did you even looked at the quadcopter link and code in there?

Quadcopter? Did somebody say quadcopter? Quadcopter what? Is there a link to quadcopter? Is there a link to the quadcopter link?

After playing with over a dozen different ARM part numbers last couple weeks I'd have to say PSOC4 was not among the easiest. Some took minutes, some took hours. PSOC was not one of the "minutes" ones. PSOC would have been a lot more attractive to me if it weren't for the demo board fake programmer and lack of basic easy to use flash utility. Still it was an interesting experience and well worth the $4 demo board if not the $10 spent on chips.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 13, 2014, 07:02:18 pm
Did you even looked at the quadcopter link and code in there?

Quadcopter? Did somebody say quadcopter? Quadcopter what? Is there a link to quadcopter? Is there a link to the quadcopter link?

After playing with over a dozen different ARM part numbers last couple weeks I'd have to say PSOC4 was not among the easiest. Some took minutes, some took hours. PSOC was not one of the "minutes" ones. PSOC would have been a lot more attractive to me if it weren't for the demo board fake programmer and lack of basic easy to use flash utility. Still it was an interesting experience and well worth the $4 demo board if not the $10 spent on chips.

Don't get too excited about about it. It's just a proof of concept to drive 4 servos based on pot inputs.

The link is in this post:
https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/msg529189/#msg529189 (https://www.eevblog.com/forum/microcontrollers/help!-what-mcu-(greater-than-8-bits-of-smarts)-is-easiest-to-graduate-to/msg529189/#msg529189)

And following the link here is what the guy that did the project says about what the project contains:

Quote
I was afraid that in a recent post I bit off more than I could chew when I promised HL a "PSoC 4 controlling a quad copter using Calman filters". So I started to build a proof-of-concept which is not ready yet but it turns out that it will really fit. A bit tight, using up most resources, but will fit. Not even Calman, but there is something even better.
 
The copter needs controlling 4 motors using a standard rc-interface (1ms to 2ms PWM) and as input a MPX sum-signal. RC-hobbyists know that interfaces.
When building a radio-controlled-device you will need something to easily control your RC-environmentTo get you acquainted to this matter (and my style of solving problems like that) I bult a device to control directly 4 servos with 4 potentiometers.
Project runs on Pioneer board or on KIT-049-42xx,
 
Bob


As for programmer, it does support a simple programmer and Keil uVision supports the chips as well. Not sure about the UDB stuff, but you can export a Creator project to keil and it should build and debug with the standard uVision tools as long as you use SWD.



Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 13, 2014, 07:24:15 pm
OK, so more like "hint of concept". I suspected trouble when he consistently miss-speled Kalman. At least he didn't claim "super easy to program" like dannyf. It would be a miracle if anybody managed to single handedly develop multicopter code on a minimum chip like this that worked.

It would also be impressive if somebody put together an easier way to turn the $4 board into a programmer or come up with a flash utility comparable to ST flash demo, STVP or NXP Flashmagic.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 13, 2014, 07:45:56 pm
It would also be impressive if somebody put together an easier way to turn the $4 board into a programmer or come up with a flash utility comparable to ST flash demo, STVP or NXP Flashmagic.

Done: https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg522554/#msg522554 (https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg522554/#msg522554)

Edit: Not my work other than the tutorial on the steps to follow.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 13, 2014, 08:18:33 pm
Wow... don't know how I missed that. Spending too much time in the ghetto I guess. With those photos and details it looks a lot better than the original Cypress link you put in the old thread.

My problem is not having a Pioneer or Miniprog3 and can't justify spending $50 or $100 for casual poking around. I tried using the STlink dongles but that was a total failure.  If we knew of somebody who did manage it might be worth another try.  Or maybe you could do a big favor and flash it for me if I sent my $4 board with return postage? I have several of the bare chips and blank breakout boards like yours and would love to make use of them.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 13, 2014, 09:04:10 pm
You don't need a miniprog nor a pioneer to convert the $4 prototype board into a programmer.
It's a bootloadable project.

Edit: There are 3 posts

first one is the program for the target board, and how to wire things up.

2nd one is how to setup the $4 board as a programmer
https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg522555/#msg522555 (https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg522555/#msg522555)
3rd one is how to use the programmer to program the target board
https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg522556/#msg522556 (https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg522556/#msg522556)

Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 13, 2014, 09:44:29 pm
Are you serious... how dense can I be? So I load the programmer firmware into the $4 board and then use the python script to flash ANY of the bare chips? Simple as that? The $4 board never loses it's boot ROM?
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 13, 2014, 09:51:45 pm
Are you serious... how dense can I be? So I load the programmer firmware into the $4 board and then use the python script to flash ANY of the bare chips? Simple as that? The $4 board never loses it's boot ROM?

You got it. and you can reflash it back to another bootloadable image if you need to use it for something other than a programmer.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: neslekkim on October 13, 2014, 09:56:25 pm
but it's obvious I'm wasting my time, so Uncle.

No, this is interresting reading, until I have time to connect my psoc-sticks..
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 13, 2014, 10:00:36 pm
You got it. and you can reflash it back to another bootloadable image if you need to use it for something other than a programmer.

Great... At first the mention of "Stamp" had me thinking a Parallax board was required so i went no further. Then all that talk about Pioneer/Miniprog3 and "bricking" the $4 board stalled me. Now I have a better picture and will report back on progress. Thanks for clearing things up for the "special" class guy.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: true on October 14, 2014, 04:03:30 am
Any device that fails to clearly document a product and forces the a customer to review  poorly developed documentation that ultimately force even a serious programmer to resort to an endless game of guessing and googling is a POS.
Yeah, I might agree with this statement. But for what you later write about, it's not the fault of the documentation. I'm sorry the lack of reading ability is hindering your ability to migrate to a more powerful platform. I doubt parts from Cypress, NXP, ST, TI, SiLabs or any other manufacturer will make you happy. You are probably best off with your PIC16s.

I agree with dannyf's reply and miguelvp's subsequent reply to you about this.

When I search the resources of my chip I do not find these hybrid multi-more PWM enabled PWM blocks.  Why is it that the Great Creator and Cypress gives me no hint they even exist or can be created
It's too late I'm sure, but it says what you need right in the datasheet, as plain as it gets, giving the name of the resource right on page 1. A description of the resource is on page 7. It isn't buried.

As for the resources on the chip, what you described is again an example of the lack of understanding the resources of the device, which can be read on page 1 of the datasheet. I understood it in minutes. miguelvp likely understood it in minutes. Developers using this chip in production products (some of which you may have used or even continue to use) likely read the datasheets to see if the hardware would work, and therefore understood it in similar time. We all understood what peripherals PSoC4 has because this information is very clear in the datasheet. And some of us even knew it had programmable digital logic that could help us in other ways. But if you didn't know that, it says that in the datasheet too.

If you aren't understanding how to use flexibility of the non-CPU parts of "greater than 8-bits of smarts" chips to do more than your PIC16 micros, I don't know how to help you. PSoC isn't for you. STM32, LPC, TM4C, MSP430, SAM, EFM32, and hell maybe even PIC32 probably aren't for you either, mostly because their datasheets don't look like and read like Microchip PIC16 datasheets. If you insist on not using PIC16, maybe look at PIC24, or possibly even dsPIC?

With Microchip, I can get this info just by carefully studying the chip Spec Sheet.
Same goes for Cypress. Stop looking for UDB. Look for what you want, which is PWM. The name of the resource is on page 1. The description of the resource is on page 7.

So, that's why the PSOC4 is a POS.
I'm sorry your lack of reading comprehension makes you feel that way; with that outlook, you will miss out on a lot of really neat things in life. But you'll probably feel more comfortable hacking with a PIC than any other micro, because other micros you may consider aren't 8-bit PICs.

As I wrote here before, I believe that ultimately the question you originally brought up in this topic is not the correct question. This is because any valid answer cannot be suitable for your purpose, which is to have a PIC16.


Quote from: dannyf
I don't know that chip that well - I actually find it quite limiting and its programming approach unappealing to me.
Yeah, I did too, when I also didn't know it well. But then I thought about how I could leverage it and tried it for one project. It really is quite the neat chip in some situations, particularly the 4200 (not sure I see much use to the 4100). Thanks to the UDBs and built in op amps I am saving some money and board space, as well as doing things other micros in this size profile and over twice the price still can't do. Working with and learning about the product, it really seems like a helpful tool for the toolbox. And the $0.29 PSoC4000 will probably see use in future i2c slave projects where I have used more expensive chips that didn't use many hardware resources (though I _do_ wish it had one more TCPWM, but I'm getting off track a bit...) Plus, Cypress is a great company to work with.

I still use STM32, PIC32, or even attiny most of the time but for some projects I can complete them much faster, or have much faster hardware, and sometimes do so at cheaper cost.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 14, 2014, 04:33:16 am
Well dannyf might be happy about this:

Using Keil uVision as a full programmer debugger with PSoC chips:
https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg529947/#msg529947 (https://www.eevblog.com/forum/microcontrollers/psoc-examples/msg529947/#msg529947)

And I didn't buy a programmer ;)
No, it's not the $4 protoboard.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 14, 2014, 08:21:39 pm
the $0.29 PSoC4000 will probably see use in future i2c slave projects

Yes, but that's dannyy-bucks. After currency conversion to USD a lot more.

I agree these are cool chips and there may be some advantage in board space but from what I can tell little cost advantage over cheap external op amps. In fact can't begin to compete with Microchip and other high quality R-R dual op amps available for pennies.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: miguelvp on October 14, 2014, 08:31:19 pm
For what is worth, the exported projects to Keil uVision keeps all the UDB configuration, so it's done by software, meaning you can access everything directly if you want to go down that rabbit hole.

And you can use GCC as the destination compiler as well, so there is no magic dust in these chips, just more configurable.
Title: Re: HELP! What MCU (greater than 8-bits of smarts) is easiest to graduate to?
Post by: paulie on October 14, 2014, 08:39:19 pm
Oh yeah... I forgot to mention that. Probably the biggest advantage of PSOC is ability to swap pins around and play with logic. Definitely gives board designers who might not get things right the first time some wiggle room. For hobbyists I think it's mostly the cool factor.