EEVblog Electronics Community Forum

Electronics => Microcontrollers => Topic started by: kgavionics on June 18, 2017, 09:59:38 pm

Title: Pic mcu alternatives???
Post by: kgavionics on June 18, 2017, 09:59:38 pm
Hi guys
A few years ago i started using micro-controller ( microchip 16F and 18f family).i was using only assembly language to program them.I haven't had any problem.I wanted to start using C, because as you may know assembly is a lot of time consuming.I started searching for the descent compiler and it turned out that i have to spend a lot of money to get one like the xc8, of course they offer a shitty free version which inserts a useless code just to make your code bigger.No sorry, i hate that idea specially for a guy how's coming from assembly language.
I think that my love story with microchip mcu is about to end,because of the lack of a descent C free compiler.
my question which is the best microcontroller ( it doesn't matter if it's 8bit or 32 bit) that can offer a descent free C compiler to build some project?
Note:I don't like to use arduino family,because i want to understand and have control of the registers.
thanks in advance
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on June 18, 2017, 10:22:12 pm
Free XC8 is Ok. They used to put in a lot of bloat, but now they don't.

Most MCUs will have some sort of free C compiler, so you can choose practically anything. However, you will have to change your attitude - C will not be as efficient as assembler, so you will have to learn to live with that and not worry about the disassembly too much.
Title: Re: Pic mcu alternatives???
Post by: ataradov on June 18, 2017, 10:39:46 pm
Any ARM chip you like. Seriously, there is no more supported architecture than ARM (excluding X86, of course).

Title: Re: Pic mcu alternatives???
Post by: NorthGuy on June 19, 2017, 12:04:06 am
You can hack XC8. It's itself GPL based, and Microchip is essentially selling you a paid GPL software.
You can checkout its source code and strip out licensing parts and recompile it.
It might be hard, hard enough that I gave up. But if you are familiar with the GCC building from scratch process, you can do this.

I don't think XC8 is open source. It is based on old Hi-Tech C. XC16 and XC32 are based on GCC, so the source is open.
Title: Re: Pic mcu alternatives???
Post by: hamdi.tn on June 19, 2017, 12:14:43 am
STM32, i stopped using microchip in my projects 4 years ago.
Title: Re: Pic mcu alternatives???
Post by: technix on June 19, 2017, 12:34:53 am
Hi guys
A few years ago i started using micro-controller ( microchip 16F and 18f family).i was using only assembly language to program them.I haven't had any problem.I wanted to start using C, because as you may know assembly is a lot of time consuming.I started searching for the descent compiler and it turned out that i have to spend a lot of money to get one like the xc8, of course they offer a shitty free version which inserts a useless code just to make your code bigger.No sorry, i hate that idea specially for a guy how's coming from assembly language.
I think that my love story with microchip mcu is about to end,because of the lack of a descent C free compiler.
my question which is the best microcontroller ( it doesn't matter if it's 8bit or 32 bit) that can offer a descent free C compiler to build some project?
Note:I don't like to use arduino family,because i want to understand and have control of the registers.
thanks in advance

GCC and LLVM/clang are the two best free (both as in beer and as in speech) compilers out there. For 8-bit processors there is also the SDCC.

You can use AVR without the Arduino libraries. You will still be using the AVR-GCC toolchain though. There is an experimental fork of LLVM that emits AVR code.

The ARM architecture is supported by both GCC and LLVM/clang (yes that includes the copy of Apple clang that comes with Xcode.)

From Microchip both xc16 and xc32 for PIC24/dsPIC (xc16) and PIC32 (xc32) are actually paid versions of GCC. You can find the corresponding source code (released under GPL,) patch out the license checking code, and for xc16 patch in C++ support (if you need it.) Normal MIPS32 GCC may also work for PIC32.

There is this Intel Quark D2000 that runs x86 and thus supported by GCC and LLVM/clang.

For SDCC, its strength is the 8051 and Z80 architectures. It do have experimental support for 8-bit
Title: Re: Pic mcu alternatives???
Post by: kgavionics on June 19, 2017, 03:22:24 am
thank you guys for your help.sorry, i was a little bit frustrated, after I've done a bit of research it seems that the xc8 free version is not as bad as i thought.
for now i'll keep using PIC, but i might be interested for something else in the near future.
Title: Re: Pic mcu alternatives???
Post by: hans on June 19, 2017, 09:14:56 am
You can hack XC8. It's itself GPL based, and Microchip is essentially selling you a paid GPL software.
You can checkout its source code and strip out licensing parts and recompile it.
It might be hard, hard enough that I gave up. But if you are familiar with the GCC building from scratch process, you can do this.

I don't think XC8 is open source. It is based on old Hi-Tech C. XC16 and XC32 are based on GCC, so the source is open.

Okay, got it. I was looking at XC16 since I was interested in dsPIC33 series, until I got drawn in thousands of pages of scattered reference manuals and moved to PSoC 5LP.

Still though, you're right. You don't have to look far to get XC8 'refactored'.
Does it make a big difference? No not really. Don't expect wonders. The most I usually got was 10% code size reduction. The best code size optimisations were put into free editions years ago, because before that it was appalling beyond belief.

Nevertheless I don't touch XC8 anymore because of lack of C99 (and C++) support. The compiler technology really starts to show it's age, so do the chips.
But if someone is keen to using these PICs, power to them. It are still fun chips that can run code, have easy to program peripherals, etc. I would recommended XC8 over programming assembly. Maybe assembly can be a few % more efficient here and there.. but the cost of programming it, error prone, debug factor etc. all don't make sense.

As a side note: I'm impressed with the assembler outputs of e.g. the GCCs compiler puts out, even for heavily templated code with inheritance (but no virtual functions!) and composition structures in C++.
Title: Re: Pic mcu alternatives???
Post by: westfw on June 19, 2017, 09:16:58 am
There are also a number of other commercial C compilers for PIC that are more reasonably priced than XC8.
Title: Re: Pic mcu alternatives???
Post by: hamdi.tn on June 19, 2017, 09:26:07 am
thank you guys for your help.sorry, i was a little bit frustrated, after I've done a bit of research it seems that the xc8 free version is not as bad as i thought.
for now i'll keep using PIC, but i might be interested for something else in the near future.

i can't remember if it was free XC8 or free H-TECH Compiler that add more unnecessary code to the compiled file just so they can say buy PRO version to optimize your code size. One more reason to give up Microchip.
Title: Re: Pic mcu alternatives???
Post by: tszaboo on June 19, 2017, 09:28:57 am
I'm just waiting for someone to ctrl+c ctrl+v here their Holy Wall Of Text of the PSOC, how it is superior to everything. BTW it's not.
Title: Re: Pic mcu alternatives???
Post by: NivagSwerdna on June 19, 2017, 10:49:39 am
thank you guys for your help.sorry, i was a little bit frustrated, after I've done a bit of research it seems that the xc8 free version is not as bad as i thought.
for now i'll keep using PIC, but i might be interested for something else in the near future.
The really obvious next step is Arduino.  Uno or Mini clones on the slow boat from China (I personally like NHduino) cost almost nothing.  Or a 2560 clone if you want more pins and hardware.  You can then use the Arduino IDE and program C to your hearts content.  (ASM is also possible)
An advantage of sticking with MPLABX and XC8 is the potential to hardware debug which may or not be useful.
Title: Re: Pic mcu alternatives???
Post by: spudboy488 on June 19, 2017, 11:25:32 am
i can't remember if it was free XC8 or free H-TECH Compiler that add more unnecessary code to the compiled file just so they can say buy PRO version to optimize your code size. One more reason to give up Microchip.

I don't think it actually added code, it just didn't run some of the optimization passes to remove unnecessary code. I believe the free and pro compilers will produce the same code if you turn off some of the optimization in the pro version. There were no optimization option in the free version.
Title: Re: Pic mcu alternatives???
Post by: VEGETA on June 19, 2017, 11:40:54 am
thank you guys for your help.sorry, i was a little bit frustrated, after I've done a bit of research it seems that the xc8 free version is not as bad as i thought.
for now i'll keep using PIC, but i might be interested for something else in the near future.
The really obvious next step is Arduino.  Uno or Mini clones on the slow boat from China (I personally like NHduino) cost almost nothing.  Or a 2560 clone if you want more pins and hardware.  You can then use the Arduino IDE and program C to your hearts content.  (ASM is also possible)
An advantage of sticking with MPLABX and XC8 is the potential to hardware debug which may or not be useful.

I differ with you. Arduino should be the very first step in learning mcus, then you dig into PIC and other vendors. For our post, Arduino is worse than PIC since it adds yet another layer which will make code less efficient.

My own opinion is that XC8 is just great, greater than many other free stuff. It is usable, official and supported. Code efficiency is not a fundamental issue in my opinion because it is because of wrong MCU choice most of the times. If you have a big project, get a big enough MCU. Don't get a tiny 8-bit PIC then claim your awesome robot project failed because compiler is bad (This is in general, not personal to the OP)... right? I remember an EEVBlog post talking about this.

Microchip PIC is one of the best, I don't think you should use another vendor unless you want to use ARM MCUs. ARM 32-bit MCU are obviously better and more powerful.

Title: Re: Pic mcu alternatives???
Post by: NivagSwerdna on June 19, 2017, 03:38:38 pm
Arduino is worse than PIC since it adds yet another layer which will make code less efficient.
It's true that Wiring gets in the way but you can avoid it very easily and get straight to bare metal.  Put your code, in a while(true) inside the loop function, redefine or disable timer0 and you are good to go with bit twiddling the registers.

Depends on what you actually want to achieve.
Title: Re: Pic mcu alternatives???
Post by: technix on June 19, 2017, 03:47:39 pm
Arduino is worse than PIC since it adds yet another layer which will make code less efficient.
It's true that Wiring gets in the way but you can avoid it very easily and get straight to bare metal.  Put your code, in a while(true) inside the loop function, redefine or disable timer0 and you are good to go with bit twiddling the registers.

Depends on what you actually want to achieve.
You can install Arduino software just to use it as an installer for AVR-GCC and AVR-libc. Then you can safely skip the Arduino IDE itself and use the copy of toolchain it packed for your own project.
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on June 19, 2017, 04:05:10 pm
You can install Arduino software just to use it as an installer for AVR-GCC and AVR-libc. Then you can safely skip the Arduino IDE itself and use the copy of toolchain it packed for your own project.

"But I was thinking of a plan
 To dye one's whiskers green,
 And always use so large a fan
 That they could not be seen".

                Lewis Carroll. Through the Looking-Glass.
Title: Re: Pic mcu alternatives???
Post by: technix on June 19, 2017, 04:11:21 pm
You can install Arduino software just to use it as an installer for AVR-GCC and AVR-libc. Then you can safely skip the Arduino IDE itself and use the copy of toolchain it packed for your own project.

"But I was thinking of a plan
 To dye one's whiskers green,
 And always use so large a fan
 That they could not be seen".

                Lewis Carroll. Through the Looking-Glass.
There are some tricky-to-get-right toolchains that Arduino folks support, like the ones for Intel Quark line. Using the copy installed by Arduino is often more reliable than installing it yourself.
Title: Re: Pic mcu alternatives???
Post by: FrankBuss on June 19, 2017, 04:17:00 pm
I would recommend that you start with an Arduino. There are Arduino Nano clones for less than $2, free shipping on eBay, with USB serial port integrated and they are faster than the usual PIC16/18, even when programmed in C. But if you want, you can actually use the underlying registers with it, no need to use the Arduino API. I use it frequently when I test things like new displays, sensors etc., or even for bigger projects, like this "bateye" hardware which I wrote for someone on Hackaday:

https://github.com/DebarghaG/Project_Basics/blob/master/bateye-stereo.ino

It uses two ultrasonic distance sensors and creates two audio signals, depending on the distance, logarithmically scaled (bigger frequency steps with higher frequencies, because the ear perceives this as linear then). I had to configure the Atmel registers myself for the interrupt, because this is not possible with the standard API (but there is a timer1 module for it, as I just found out), but the rest is really easy with it.

When I need more power, currently I use one of the STM32 microcontrollers. The CubeMX GUI makes it very easy to configure all peripherals, you really don't want to do this by hand. The code looks horribly bloated, but it has big enough flash memory, so I don't care, and they improve it all the time, it has fewer and fewer bugs with every version :) I use it in combination with the Keil uVision IDE (free for up to 32 kB).

Some bigger STM32 chips run with 168 MHz (costs like $10), the smaller ones with 48 MHz (for like $5). But it is still simple enough with one supply voltage and internal oscillator, so you can use a breakout board and start playing with it (with a ST-Link programmer, which is again cheap on eBay). I used this to test a new 3-color e-paper display:

https://hackaday.io/project/20466-wifi-epaper/log/61762-stm32l433-and-new-display-test

Later I created a proper board, which is currently manufactured:

https://hackaday.io/project/20466-wifi-epaper/log/61807-test-board-for-bluetooth
Title: Re: Pic mcu alternatives???
Post by: westfw on June 19, 2017, 08:32:06 pm
Quote
it seems that the xc8 free version is not as bad as i thought.

By all means, try it out.  Especially since you know the assembly language, you're in a good position to evaluate the code produced by the compiler.

When Microchip acquired HiTech and released an 8-bit PIC compiler "free version with no optimization", it was pretty awful.  People were expecting the equivalent of what gcc produces with "-O0", unaware of just how much optimization goes on in a compiler in between the sort of "parsed source naively translated to machine code" and "no fancy optimizations."  They got the former.  It was particularly bad on the PIC architecture, since that's pretty distant from the PDP/11 that C "naturally" maps to.

Since that time, they have reportedly fiddled with the settings, and it's gotten better.
Title: Re: Pic mcu alternatives???
Post by: danadak on June 19, 2017, 11:37:20 pm
Some questions -

1) Type of designs you are doing ? What is processor doing in the designs ?

2) You dealing with analog, filters, ADC ?

3) Type of outputs you are driving, simple digital, PWM, DAC, motors, other digital....

4) Displays/interface to UP being used in finished product ?


Regards, Dana.
Title: Re: Pic mcu alternatives???
Post by: ebclr on June 20, 2017, 02:49:37 pm
The sure one

http://www.cypress.com/documentation/development-kitsboards/cy8ckit-059-psoc-5lp-prototyping-kit-onboard-programmer-and (http://www.cypress.com/documentation/development-kitsboards/cy8ckit-059-psoc-5lp-prototyping-kit-onboard-programmer-and)

Title: Re: Pic mcu alternatives???
Post by: technix on June 20, 2017, 03:09:07 pm
I'm just waiting for someone to ctrl+c ctrl+v here their Holy Wall Of Text of the PSOC, how it is superior to everything. BTW it's not.
I think it have arrived. Well a shorter version arrived, with a link to a MUCH longer one.
Title: Re: Pic mcu alternatives???
Post by: ebclr on June 20, 2017, 04:01:57 pm
Psoc is for sure,  It's unique, If you don't believe is because you didn't play with psoc r

It's a mix of FPGA, arm and even a "kind of analog" litle FPGA

Only as a little information Check this video and tell me, what another arm processor ( or any other one ) make so easy to add small functions based on Verilog

http://youtu.be/XpgmKk-COkA (http://youtu.be/XpgmKk-COkA)

Also, check this 2nd video and tell me do you know any other processor that you can make small analog circuits on the fly?

https://www.youtube.com/watch?v=7FBw8-PBIb0 (https://www.youtube.com/watch?v=7FBw8-PBIb0)

Psoc is the most flexible system family available nothing like that, and if you evaluate the full family, you will agree.,

 The problem with Psoc is that is something that is a new and Innovative, you will need some effort to learn and understand because breaks your previous experience with microprocessor, PSOC is a System on Chip not a microprocessor
Title: Re: Pic mcu alternatives???
Post by: technix on June 20, 2017, 04:23:53 pm
Psoc is for sure,  It's unique, If you don't believe is because you didn't play with psoc r

It's a mix of FPGA, arm and even a "kind of analog" litle FPGA

Only as a little information Check this video and tell me, what another arm processor ( or any other one ) make so easy to add small functions based on Verilog

http://youtu.be/XpgmKk-COkA (http://youtu.be/XpgmKk-COkA)

Also, check this 2nd video and tell me do you know any other processor that you can make small analog circuits on the fly?

https://www.youtube.com/watch?v=7FBw8-PBIb0 (https://www.youtube.com/watch?v=7FBw8-PBIb0)

Psoc is the most flexible system family available nothing like that, and if you evaluate the full family, you will agree.,

 The problem with Psoc is that is something that is a new and Innovative, you will need some effort to learn and understand because breaks your previous experience with microprocessor, PSOC is a System on Chip not a microprocessor
No thanks. If the microcontroller don't have tools for Linux or macOS it is literally dead end for me.

Do not persuade me to install Windows somewhere. I don't even own Windows. All my computers runs either Ubuntu Linux or macOS. And none of my surviving computers are bought with Windows licenses included - either I built it up myself from parts, or I bought a Mac.
Title: Re: Pic mcu alternatives???
Post by: ebclr on June 20, 2017, 04:31:56 pm
OK, keep on your 8051 and gimp cave, and let the people that think out of the box do the job
Title: Re: Pic mcu alternatives???
Post by: technix on June 20, 2017, 04:40:07 pm
OK, keep on your 8051 and gimp cave, and let the people that think out of the box do the job
Before you start thinking out of the box check if your ass is being watched and your passwords are being sniffed by Microsoft and/or the Big Brother.

https://www.youtube.com/watch?v=wPFbAqICUJo (https://www.youtube.com/watch?v=wPFbAqICUJo)

This is from an ex-employee of Microsoft, that was a senior developer in Windows team from Windows XP to Windows 8.1.
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on June 20, 2017, 04:46:26 pm
Also, check this 2nd video and tell me do you know any other processor that you can make small analog circuits on the fly?

PIC16F1764

Not to mention that it would me much easier to use off-the-shelf op amp - nothing needs to be done, no programming required. And, most importantly, you can select the op amp with characteristics you really needs. Chances that a built-in op amp with arbitrary characteristics is exactly what you need are slim to none.
Title: Re: Pic mcu alternatives???
Post by: technix on June 20, 2017, 04:49:17 pm
OK, keep on your 8051 and gimp cave, and let the people that think out of the box do the job
Oh and speaking of 8051, I am not using it as my main microcontroller choice for the projects. I have a series of blog posts exploring 8051 and that's it. I have way more ARM and AVR based projects than 8051:

https://github.com/ArduinoMax (Arduino stuff - mostly AVR)
https://github.com/SushiBits (My own designs - almost exclusively ARM)
Title: Re: Pic mcu alternatives???
Post by: technix on June 20, 2017, 05:06:01 pm
Not to mention that it would me much easier to use off-the-shelf op amp - nothing needs to be done, no programming required. And, most importantly, you can select the op amp with characteristics you really needs. Chances that a built-in op amp with arbitrary characteristics is exactly what you need are slim to none.
Also since op amps almost always comes in the same pinout, socketed op amps are godsend. I used to have a small headphone amp with two socketed op amps. I started off using a pair of LM358s but as my demand of audio quality increases the op amps are swapped out for better ones - TL072, then NJM4559, then OPA2134. Should I be able to find it I may even try flirt with TLC2272 on this.

Try upgrade an op amp in PSoC without respinning the entire board or change a significant portion of the code.
Title: Re: Pic mcu alternatives???
Post by: ebclr on June 20, 2017, 05:16:35 pm
It's not only opamps, it's a full set of analog components, of course, you can't argue against because you never tried, and already makes clear that will never do that, because the tools isn't on your OS preference, let follow your course and pray for your eventual competitors don't take advantage of this wonderful piece of silicon (Psoc) against something you are planning to compete using Linux friendly tools
Title: Re: Pic mcu alternatives???
Post by: technix on June 20, 2017, 11:56:30 pm
It's not only opamps, it's a full set of analog components, of course, you can't argue against because you never tried, and already makes clear that will never do that, because the tools isn't on your OS preference, let follow your course and pray for your eventual competitors don't take advantage of this wonderful piece of silicon (Psoc) against something you are planning to compete using Linux friendly tools

They won’t compete.

At least in China nobody bothers using PSoC at all. It is way too expensive to be competitive in the market.

You can check Aliexpress or Taobao for MCU dev kits. You would be hard pressed to find something with PSoC on it. OTOH kits based on STM32, STC 8051, Microchip PIC16 and AVR just floods the market. Also check the bookstores and college curriculums, there is virtually no book or course that even touches upon the advanced features of PSoC.

The STM32 line is so popular we are now even seeing clones from China in the form of GD32 line.
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on June 21, 2017, 12:14:34 am
You cannot judge by the price of the development kits. Manufacturers sell them below cost to attract buyers to their chips. Look at the prices of the chips themselves instead.
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 12:14:57 am
It's not only opamps, it's a full set of analog components, of course, you can't argue against because you never tried, and already makes clear that will never do that, because the tools isn't on your OS preference, let follow your course and pray for your eventual competitors don't take advantage of this wonderful piece of silicon (Psoc) against something you are planning to compete using Linux friendly tools

They won’t compete.

At least in China nobody bothers using PSoC at all. It is way too expensive to be competitive in the market.

You can check Aliexpress or Taobao for MCU dev kits. You would be hard pressed to find something with PSoC on it. OTOH kits based on STM32, STC 8051, Microchip PIC16 and AVR just floods the market. Also check the bookstores and college curriculums, there is virtually no book or course that even touches upon the advanced features of PSoC.

The STM32 line is so popular we are now even seeing clones from China in the form of GD32 line.

Psoc kit 059 sells at $10 with no quantity limit. You can buy 1000 pcs if you want to.

The kit contains 2 $20 chips (target and debugger) and passives.

The debugger can also be used as usb to uart and i2c bridge.
Point me to someone actually sells this at $10 in China. It is nigh difficult to find, at least for me, and costs way more than $10.

And how much does the STM32 kits cost again? $15 for STM32F407ZGT6 + 1MiB external SRAM + 16MiB external Flash.
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 12:26:18 am
You cannot judge by the price of the development kits. Manufacturers sell them below cost to attract buyers to their chips. Look at the prices of the chips themselves instead.
I understands this for first-party kits. But third-party kits are entirely another story.

Arduino *was* a third party kit until they attracted attention from Atmel. Since then they gained access to cheap chips and become a first-party kit.
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 12:49:36 am
It's not only opamps, it's a full set of analog components, of course, you can't argue against because you never tried, and already makes clear that will never do that, because the tools isn't on your OS preference, let follow your course and pray for your eventual competitors don't take advantage of this wonderful piece of silicon (Psoc) against something you are planning to compete using Linux friendly tools

They won’t compete.

At least in China nobody bothers using PSoC at all. It is way too expensive to be competitive in the market.

You can check Aliexpress or Taobao for MCU dev kits. You would be hard pressed to find something with PSoC on it. OTOH kits based on STM32, STC 8051, Microchip PIC16 and AVR just floods the market. Also check the bookstores and college curriculums, there is virtually no book or course that even touches upon the advanced features of PSoC.

The STM32 line is so popular we are now even seeing clones from China in the form of GD32 line.

Psoc kit 059 sells at $10 with no quantity limit. You can buy 1000 pcs if you want to.

The kit contains 2 $20 chips (target and debugger) and passives.

The debugger can also be used as usb to uart and i2c bridge.
Point me to someone actually sells this at $10 in China. It is nigh difficult to find, at least for me, and costs way more than $10.

And how much does the STM32 kits cost again? $15 for STM32F407ZGT6 + 1MiB external SRAM + 16MiB external Flash.

Cy8ckit-059, as low as RMB 80 from Taobao.
Mouser, e14 and Digikey all ship to China, some with minimum order amount.
Brokers like rightIC also do aggregated shipping to China from western distributors with very low MOQ and shipping cost.

If you prefer to buy from a trusted source, check out here: http://www.mouser.cn/ProductDetail/Cypress-Semiconductor/CY8CKIT-059/?qs=sGAEpiMZZMuo%252bmZx5g6tFKhundMNZurhvz2tw2jO%2fk8%3d (http://www.mouser.cn/ProductDetail/Cypress-Semiconductor/CY8CKIT-059/?qs=sGAEpiMZZMuo%252bmZx5g6tFKhundMNZurhvz2tw2jO%2fk8%3d)

Buy two to get free shipping.
To be honest I just bought one for the sake of trying out what you claim to be the “most flexible MCU ever” (I still doubt it.)

CNY 80 is still a stiff price for an entry level dev kit. The third party STM32 kit I quoted above is one of the advanced product lines out there.
Title: Re: Pic mcu alternatives???
Post by: Elf on June 21, 2017, 02:51:33 am
OK, keep on your 8051 and gimp cave, and let the people that think out of the box do the job
Oh and speaking of 8051, I am not using it as my main microcontroller choice for the projects. I have a series of blog posts exploring 8051 and that's it. I have way more ARM and AVR based projects than 8051: [...]
I think 8051 chips are great in many applications. Cheap, low power, available with good peripherals, and mature dev tools. Why should anyone need to feel bad for learning and using 8051s? Unlike some people, it doesn't sound like you're going around saying that the 8051 is the solution to every problem.

This is what showed up in my mailbox the other day:
(http://i.imgur.com/vnkBeXh.jpg)

From what little playing around with it I've done, EFM8 looks like it will add to the other chips I like: RL78, MSP430, STM32, STM8, AVR, XMOS, Z8, and just for fun, WDC 65xx. I am trying to make a conscious effort to rotate through those for each new design. I enjoy trying new things and constant learning. I think the PSoC looks great too. I'd give it a try for something with mixed signals or that needed a bit of extra programmable logic. I appreciate people like blueskull talking about the real world applications they use it for, and why, in a way that doesn't feel heavy handed. It does seem expensive. That's not always important.

But honestly the whole PSoC fanboy thing is such a turnoff:
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 03:58:51 am
It's not only opamps, it's a full set of analog components, of course, you can't argue against because you never tried, and already makes clear that will never do that, because the tools isn't on your OS preference, let follow your course and pray for your eventual competitors don't take advantage of this wonderful piece of silicon (Psoc) against something you are planning to compete using Linux friendly tools

They won’t compete.

At least in China nobody bothers using PSoC at all. It is way too expensive to be competitive in the market.

You can check Aliexpress or Taobao for MCU dev kits. You would be hard pressed to find something with PSoC on it. OTOH kits based on STM32, STC 8051, Microchip PIC16 and AVR just floods the market. Also check the bookstores and college curriculums, there is virtually no book or course that even touches upon the advanced features of PSoC.

The STM32 line is so popular we are now even seeing clones from China in the form of GD32 line.

Psoc kit 059 sells at $10 with no quantity limit. You can buy 1000 pcs if you want to.

The kit contains 2 $20 chips (target and debugger) and passives.

The debugger can also be used as usb to uart and i2c bridge.
Point me to someone actually sells this at $10 in China. It is nigh difficult to find, at least for me, and costs way more than $10.

And how much does the STM32 kits cost again? $15 for STM32F407ZGT6 + 1MiB external SRAM + 16MiB external Flash.

Cy8ckit-059, as low as RMB 80 from Taobao.
Mouser, e14 and Digikey all ship to China, some with minimum order amount.
Brokers like rightIC also do aggregated shipping to China from western distributors with very low MOQ and shipping cost.

If you prefer to buy from a trusted source, check out here: http://www.mouser.cn/ProductDetail/Cypress-Semiconductor/CY8CKIT-059/?qs=sGAEpiMZZMuo%252bmZx5g6tFKhundMNZurhvz2tw2jO%2fk8%3d (http://www.mouser.cn/ProductDetail/Cypress-Semiconductor/CY8CKIT-059/?qs=sGAEpiMZZMuo%252bmZx5g6tFKhundMNZurhvz2tw2jO%2fk8%3d)

Buy two to get free shipping.
For $20 I can get the Allwinner V3s stack up, sample the analog signals directly and crunch through the entire PSoC analog chain using software code. Oh that is a Cortex-A7 core with full FPU and SIMD instructions.
Title: Re: Pic mcu alternatives???
Post by: rcbuck on June 21, 2017, 04:04:15 am
I would like to see verified numbers of how many actual products PSOC parts are used in. My guess (I could be wrong) is that their cost keeps their market share of actual products very low compared to other ARM vendors products. If they are doing that great, why has their stock not gone up in 5 years?
   
5 year ago price                   Today's closing price

Microchip           $33.20                80.35
STMicroelectronics  $5.56                 15.11
Cypress Semi        $13.41                13.35
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 05:19:33 am
For $20 I can get the Allwinner V3s stack up, sample the analog signals directly and crunch through the entire PSoC analog chain using software code. Oh that is a Cortex-A7 core with full FPU and SIMD instructions.

PSoC can sample analog at 20-bit without audio filtering shit (not 24-bit audio ADC), it's a general purpose precision 20-bit sigma delta ADC.
PSoC also has 2 SAR ADCs that support arbitrary channel sequencing.
PSoC has a few <50ns comparator that gives you 20MHz bit stream bandwidth.
PSoC has IDACs and VDACs, with a fairly accurate and stable voltage reference.
PSoC has comparators and OPAMPs with very low offset (and ADCs with factory calibrated for offset) that can be used on mV signals.
PSoC has switching capacitor analog handling blocks, which can be used for programmable analog filters, comparators and a lot of other purposes.
PSoC has the best cap sense in industry, comparable with TI CapTIVate solution.
PSoC may come with all those features, but what if I don't need some features why would I still pay for it? Allwinner V3s is cheap enough for me to afford shopping around for even better external components to perform the same if not better. Same goes for STM32 or AVR or STC 8051. Try beat ADI or LT or TI or Maxim on analog. And I don't have to pay for features I don't use (unpopulated footprint at worst, removed from the board usually. As long as routing works and the board is not getting bigger adding a footprint to a PCB is free.)
PSoC is available in extended temperature range and comes with MISRA C certified libraries.
Allwinner V3s is automotive class silicon by default in the first place. Go ahead and read their marketing slides.
And most important, PSoC consumes milliamps, and can boot up in milliseconds.
Allwinner V3s also consumes milliamps, and can boot up in milliseconds, if the program is written for bare metal operation, just like STM32 or AVR or STC 8051, oh or like PSoC.
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 05:32:12 am
It's not only opamps, it's a full set of analog components, of course, you can't argue against because you never tried, and already makes clear that will never do that, because the tools isn't on your OS preference, let follow your course and pray for your eventual competitors don't take advantage of this wonderful piece of silicon (Psoc) against something you are planning to compete using Linux friendly tools
There are way too many scenario PSoC won't work even on an electrical point of view. Take one of my constant current load design for an example: in order to use the cheaper 10V gate power MOSFETs I used a boost converter to provide the error amplifier 15V supply voltage. Try not to fry an PSoC op amp with 15V supply. If the PSoC have to be shoehorned I have to use the much more expensive logic level power MOSFETs (just check the price difference of IRF540N and IRL540N,) use a floating ground (a whole other can of worms by itself) and still need an external op amp to invert the sample point voltage.
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 05:48:49 am
If your product profitability is heavily bounded by the cost of a single commodity MOSFET, it's likely your design is not good enough. Generally if you want to start a real innovative business (not a mom&pop shop), you need to make sure your BOM is only a very small portion of cost, expect R&D and testing/certifying as well as financing cost amortized per product to be more than BOM.
So you are suggesting a good design have to be a complex one? For at least this specific project PSoC is definitely adding complexity and points of failure. In my board I even introduced a strict point of separation of programmed and hard wired analog circuitry for the sake of safety - a locked up program does not fry the analog section, and the thermal shutdown of the power MOSFET does not depend on working code. Can PSoC do this?
BTW, IRF540 and IRF540N are of the same price on Mouser. Taobao price doesn't really have a meaning unless you can get the certificate of authenticity from supplier. Who knows the IRF540 you get is a genuine one or a Chinese die packaged into an IR packaging.
The kicker is not IRF540N/IRL540N, but the additional complexity just to accommodate the PSoC. A negative rail just for the single external op amp to flip the sense line voltage is ridiculous. Also it is much simpler to design a boost SMPS than inverting SMPS, as chips are readily available. No thanks I will stick to my cheap STM32F103C8T6 + TLC5615 + TLC2272 stack.

Also, can PSoC receive OTA code updates without interrupting the analog side of things? I can leave the analog side of things on autopilot during OTA.
Title: Re: Pic mcu alternatives???
Post by: ebclr on June 21, 2017, 06:02:47 am
Using PSoC you will save thousands of dollars on development, it's a system on a chip, smaller PCB's, more flexible and integrated solution, ideal for the middle of complex things on the very low scale of production, you can even use the development stick as a component of products.

They are not made to compete with STM8 or STC8051 for 1 dollar Led Voltmeter

The main application is medical and military devices and measure and automation, where you want performance and system integration that only PSOC can give you, The learning curve is hard, but if you pass that learning phase you can make a full complex system in a day. The saving isn't on the chip, the saving in on engineer time, your product will be ready faster and the gain on development cost and time will pay the premium of the CPU.

Psoc can read analog channels, filter at very high rates and generates a VGA signal showing the results, and having excellent capacitive buttons and sliders while at the same time generating one analog out in a range outside your power supply limits using an internal cap switch, and generating several different clocks to be used externally based on the PLLs you can define.

Did you get it, it's unique

https://www.youtube.com/watch?v=C-YOIWPxZ08 (https://www.youtube.com/watch?v=C-YOIWPxZ08)
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 06:19:58 am
BTW, IRF540 and IRF540N are of the same price on Mouser. Taobao price doesn't really have a meaning unless you can get the certificate of authenticity from supplier. Who knows the IRF540 you get is a genuine one or a Chinese die packaged into an IR packaging.
The kicker is not IRF540N/IRL540N, but the additional complexity just to accommodate the PSoC. A negative rail just for the single external op amp to flip the sense line voltage is ridiculous. Also it is much simpler to design a boost SMPS than inverting SMPS, as chips are readily available. No thanks I will stick to my cheap STM32F103C8T6 + TLC5615 + TLC2272 stack.

1. PSoC's internal analog peripherals can operate down to negative rail (gnd).
I need lower than GND. I am talking about -5V or so.
2. If it's just for signal conditioning, PSoC can be used to create a charge pump to generate negative voltage. Port 12 in PSoC 5 can handle up to 25mA per pin.
It is a sense signal. No way you can pump it.
3. The same can be used to drive a non logic FET, and you can use a BJT to do analog level translation. I prefer a common base driving a complementary emitter follower (aka. class B) for gate driving. 2 9014 NPN and 1 9015 PNP is guaranteed to be cheaper than any OPAMP.
The PSoC itself is more expensive than the whole board of components combined in the first place. So, moot point.

I'd rather not shoehorn PSoC down every project at the cost of increased complexity and/or BOM cost. That is also the point why I am keeping the 8051 stack alive, as for the extreme simple and/or the extreme cheap 8051 just works without too much complexity. For example I may implement an I2C controlled single phase synchronous buck converter using ATtiny85 + MOSFETs, but for a simple LED blinky it is certainly STC15W101 + MOSFETs
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 06:36:38 am
Using PSoC you will save thousands of dollars on development, it's a system on a chip, smaller PCB's, more flexible and integrated solution, ideal for the middle of complex things on the very low scale of production, you can even use the development stick as a component of products.
So I should prepare to spend the thousands of dollars saved in R&D in either repairing and servicing the devices, or paying dubious recyclers to handle the broken units?
They are not made to compete with STM8 or STC8051 for 1 dollar Led Voltmeter

The main application is medical and military devices and measure and automation, where you want performance and system integration that only PSOC can give you, The learning curve is hard, but if you pass that learning phase you can make a full complex system in a day. The saving isn't on the chip, the saving in on engineer time, your product will be ready faster and the gain on development cost and time will pay the premium of the CPU.
When I do get past the "learning phase" I will find myself cooking up designs that is easier to route, plan, debug and build using separate chips - like STM32 in the center and chips like ADC0832, TLC5615 and TLC2272 scattered around.

Also I doubt if I can hook an oscilloscope probe into the intermediary signal to debug the circuits.
Psoc can read analog channels, filter at very high rates and generates a VGA signal showing the results, and having excellent capacitive buttons and sliders while at the same time generating one analog out in a range outside your power supply limits using an internal cap switch, and generating several different clocks to be used externally based on the PLLs you can define.

Did you get it, it's unique

https://www.youtube.com/watch?v=C-YOIWPxZ08 (https://www.youtube.com/watch?v=C-YOIWPxZ08)
So does Allwinner V3s. Oh and V3s uses the much more common parallel RGB interface which can be ingested by a lot of LCD panels or bridged into things like HDMI or DisplayPort easily with a PHY chip, oh and vintage VGA too maybe using some vintage RAMDAC. And V3s can use a much higher resolution.
Title: Re: Pic mcu alternatives???
Post by: theatrus on June 21, 2017, 06:45:40 am
PSoC is also single source - I can swap processors or opamps as commodities, but buying a magic unicorn box is a great way to be sad at a later date.
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 07:06:42 am
PSoC is also single source - I can swap processors or opamps as commodities, but buying a magic unicorn box is a great way to be sad at a later date.
Agreed. Socketed op amps are godsend since they all follow the same pinout. So are the 8051 based microcontrollers (with a few AVRs being almost pin compatible with the 8051s)

Having all major components separated means I can swap parts without respinning the board should one vendor ceased business. Also I will have some pins, pads or traces to poke a multimeter or oscilloscope at. Even if the original chip comes in a unicorn pinout as long as it is a simpler chip cheap 2L adapter boards can be made to retrofit another vendor's chip on one dead vendor's chips' footprints.

PSoC are good chips for experiments and one-off projects that you do not expect having to repair or intend to throw away in a few years. If you intend to keep a product alive for longer times and keep maintaining it you damn well hope either Cypress the unicorn company stays alive for that long and still produces the chip you used (at least c compatible one) or you have used standard products that is easily replaceable.
Title: Re: Pic mcu alternatives???
Post by: danadak on June 21, 2017, 04:47:46 pm
Quote
If you intend to keep a product alive for longer times and keep maintaining it you damn well hope either Cypress the unicorn company stays alive for that long and still produces the chip you used (at least c compatible one) or you have used standard products that is easily replaceable.

Thats one of the almost un-achievable aspects of the hi tech biz these days. One only has to look
at the history since 70s of the number of very big companies that have been absorbed or gone out
of business, Philips, National....Whole product lines spun off into oblivion. And who is trained to see
the future ?

Insofar as Cypress is concerned, look at the annual reports as a starting point. Basically they have an
industry standard core coupled with a process that can handle mixed signal. That aspect one could
comfortably state will continue to experience demand. Look at the roadmap, also the frequency of tool
updates, release of new families, parts, as a way of telling if they are viable. The Cypress MCD div shipped
almost ~$1B in 2016.


Quote
Having all major components separated means I can swap parts without respinning the board
should one vendor ceased business.

Of course there are reliability issues with that approach. Power issues. And if a competitor sees those
increased costs and your market is sizable that's an opportunity to attack that solution. Eg. because
that solution has increased procurement, assembly costs, just a  fact of life.

For sure no one in their right mind would claim PSOC came from God. It has its place, seems like in its
history of shipments it found good fit in many products.

Lastly published unit pricing is notoriously inaccurate.  Direct contact with Cypress reps and field sales
will give a much more accurate picture of costs. Especially future pricing estimates.




Regards, Dana.
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on June 21, 2017, 04:57:09 pm
Thats one of the almost un-achievable aspects of the hi tech biz these days. One only has to look
at the history since 70s of the number of very big companies that have been absorbed or gone out
of business, Philips, National....Whole product lines spun off into oblivion. And who is trained to see
the future ?

Microchip still supports PICs from 20 years ago, so if you used one in your design, you can still buy replacement parts.
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 05:18:12 pm
Quote
If you intend to keep a product alive for longer times and keep maintaining it you damn well hope either Cypress the unicorn company stays alive for that long and still produces the chip you used (at least c compatible one) or you have used standard products that is easily replaceable.

Thats one of the almost un-achievable aspects of the hi tech biz these days. One only has to look
at the history since 70s of the number of very big companies that have been absorbed or gone out
of business, Philips, National....Whole product lines spun off into oblivion. And who is trained to see
the future ?

Insofar as Cypress is concerned, look at the annual reports as a starting point. Basically they have an
industry standard core coupled with a process that can handle mixed signal. That aspect one could
comfortably state will continue to experience demand. Look at the roadmap, also the frequency of tool
updates, release of new families, parts, as a way of telling if they are viable. The Cypress MCD div shipped
almost ~$1B in 2016.
Try explain to me why NASA are still using 80C86 to this day. Speaking of which, outside of collectors, there are still a lot of Apple II's or IBM PC's surviving. But for the computers since Pentium it is hard pressed to find one that still works after 15-20 years. Back then no chip is single sourced so finding a replacement is (still) fairly easy even to this day: You got a dead Socket 7 CPU - get another one from whatever manufacturer that still have the required performance and you are good to go.
Quote
Having all major components separated means I can swap parts without respinning the board
should one vendor ceased business.

Of course there are reliability issues with that approach. Power issues. And if a competitor sees those
increased costs and your market is sizable that's an opportunity to attack that solution. Eg. because
that solution has increased procurement, assembly costs, just a  fact of life.




Regards, Dana.
If you perform a more careful analysis you will find out that PSoC have a generally higher cost if some defective units are involved. As I have stated before PSoC in general is much more expensive than other platforms. This may be offset in the manufacturing but when you put failed components, rework and warranty repair into consideration the tip of the balance goes to semi-discrete solution again: if a PSoC stack failed it is either the entire board or the $20 PSoC chip is being tossed out. But for a semi-discrete stack I can rework the board and only toss out some much cheaper components - at worst the $5 V3s + $2 MCP3911.

And I can segregate the market by physically removing or down specifying the chips, actually cutting the cost of lower tiered products, instead of producing the lowest end products using the same full scale stack and rely entirely on a software limitation to the performance (and risk being hacked or being called Digital Restriction Management encumbered.) My old example of the headphone amp is relevant here again - the board can be produced using the same STM32 + MCP42010 + op amp socket, and the market segment the board targets is determined by the chip inserted to the socket - LM324 (with a GD32 as the main microcontroller - GD32 can be considered a second source for STM32 with pin-to-pin compatible products) for the low end, TL074 for medium grade, and OPA4134 for the audiophile market.

You have been entirely focusing on the R&D cost but I am performing lifetime cost analysis here. PSoC have the benefit of low R&D cost (hence a fantastic prototyping tool - no more need of big messes of wires on a breadboard.) But when you start rolling the boards in mass production, taking in RMA's and sending out support engineers you would wish you did not keep using PSoC in the final product: the cost of reworking failed boards skyrockets. I'dexplore and experiment using PSoC, but when I prepare to submit the PCB to manufacturing I would have redrew the schematic from PSoC creator (don't get me started on this) using internal blocks to EAGLE using separate chips.
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 06:06:10 pm
Thats one of the almost un-achievable aspects of the hi tech biz these days. One only has to look
at the history since 70s of the number of very big companies that have been absorbed or gone out
of business, Philips, National....Whole product lines spun off into oblivion. And who is trained to see
the future ?

Microchip still supports PICs from 20 years ago, so if you used one in your design, you can still buy replacement parts.
And Microchip maintains pin compatibility across the entire product lines.

Failed PIC16F877 and no replacement part at hand? Whack a PIC18F4550 in there and port the code over, you get a working board again.

Also since that is a simpler chip I can build an an adapter fitting an AVR or 5V tolerant ARM in there to make it work.
Title: Re: Pic mcu alternatives???
Post by: danadak on June 21, 2017, 10:33:17 pm
We may be arguing two diverse sets of experiences.

I see your experience has been with what sounds like significant field failures.
Where mine has been, over the course of 30 years, dramatic reductions across the
board in field failure. Memory to micro to analog. In early part of my career, 45 years
ago, as a production engineer on MOS line, we drove process and design failure rates
into noise levels. The Japanese did the same in memory. In my experience the primary
remaining failures these days are passives and interconnect. I repair scopes, other
gear for fun, spend most of my time on passives, and an occasion power bipolar, or diode.

The NASA reference, my career spanned primarily moderate to very high volume
designs. But as a field engineer I did have to deal with product obsolescence issues,
and these took many paths, from your experience to true EOL product termination and
follow on redesign.

Product diversification,for sure I can understand your point. But then silicon programmability,
route-ability, can certainly aid in this. Here my experience has been that designs were largely
3 -5 year lifetime target, then entire redesign. In my account base as FAE most, not all, of
product span was software driven. In fact many designs the HW was almost irrelevant in the
program management, it was all software development.

So I think we have quite different experiences coloring our viewpoint, at least in my case
that is surely true.

So in summary I tend to think minimum parts, get rid of interconnect.


Regards, Dana.
Title: Re: Pic mcu alternatives???
Post by: technix on June 21, 2017, 11:41:53 pm
We may be arguing two diverse sets of experiences.

I see your experience has been with what sounds like significant field failures.
Where mine has been, over the course of 30 years, dramatic reductions across the
board in field failure. Memory to micro to analog. In early part of my career, 45 years
ago, as a production engineer on MOS line, we drove process and design failure rates
into noise levels. The Japanese did the same in memory. In my experience the primary
remaining failures these days are passives and interconnect. I repair scopes, other
gear for fun, spend most of my time on passives, and an occasion power bipolar, or diode.
I am Chinese. Folks here tend to abuse their shit a lot. There are just way too many repairs of people break their stuff.
The NASA reference, my career spanned primarily moderate to very high volume
designs. But as a field engineer I did have to deal with product obsolescence issues,
and these took many paths, from your experience to true EOL product termination and
follow on redesign.
This goes back to my point: when a simpler component is EOL’d I can poke around and find a replacement to go on next production run, without having to respin the board itself and pay for the new masks.
Product diversification,for sure I can understand your point. But then silicon programmability,
route-ability, can certainly aid in this. Here my experience has been that designs were largely
3 -5 year lifetime target, then entire redesign. In my account base as FAE most, not all, of
product span was software driven. In fact many designs the HW was almost irrelevant in the
program management, it was all software development.

So I think we have quite different experiences coloring our viewpoint, at least in my case
that is surely true.

So in summary I tend to think minimum parts, get rid of interconnect.


Regards, Dana.
People will take your stuff apart. The moment they find out that your base model and premium model have the same PCB components people will start hacking it to squeeze the premium performance out of the baseline parts, and give you the bad reputation of selling DRM-encumbered hardware. Remember Rigol and Riglol hack, by putting a generated code into your DS1054Z you get a DS1104Z?

Also this eats away my margin of profit as the base model and premium model have the very same hardware and thus production cost. When I can replace or remove components I can actually cut costs on the base model by not using the best components or not installing some components at all.

This also prevents people from loading the premium firmware into the base model and expecting it to work - you have to rework the PCB itself before trying the software hack.
Title: Re: Pic mcu alternatives???
Post by: Bruce Abbott on June 22, 2017, 01:45:23 am
I tend to think minimum parts, get rid of interconnect.
Indeed, that's whole reason MCUs were invented - the more you can do inside the chip the better.

But there's a downside - in order to make it attractive to more customers you have to stuff it full of features that most of them will never use, or produce dozens of variations with different feature sets. With PSOC you don't have to do either.

I have an application that needs just two things - an 8 bit parallel slave port to interface to a 5V CPU bus, and SPI for an SD-card. I wanted to do it all in one chip without a bunch of level convertors, external logic gates or a CPLD. It has to be available in a reasonably small package but still 'DIY friendly' (no BGA etc.) and modestly priced. I spent a lot of time examining the datasheets of dozens of PICs and only one seemed to be suitable (and even that needed a few level converters). I have a PIC32MX150F128D which has both a parallel slave port and SPI, but guess what - due to a pin assignment conflict you can't use both at the same time!  >:(
 
PSOC is the only MCU that will do what I want, and I if I want something different it will still do it.
 
 
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 02:25:41 am
I tend to think minimum parts, get rid of interconnect.
Indeed, that's whole reason MCUs were invented - the more you can do inside the chip the better.

But there's a downside - in order to make it attractive to more customers you have to stuff it full of features that most of them will never use, or produce dozens of variations with different feature sets. With PSOC you don't have to do either.
I can spin the same PCB and leave different portions of the circuit unpopulated or underspecified. With PSoC the premium and baseline products have the same production cost thus eating away at the profit margin of the lower end models. But for my optional mounting on PCB trick the baseline models are indeed cheaper to build.

Once again, do you remember the Rigol hack? It is simpley because that Rigol built the baseline and advanced models using the same PCB people started hacking it to make the baseline model work like an advanced one. Try count up how much revenue you would lose in this kind of hacking, and the bad reputation of selling DRM-encumbered products.
I have an application that needs just two things - an 8 bit parallel slave port to interface to a 5V CPU bus, and SPI for an SD-card. I wanted to do it all in one chip without a bunch of level convertors, external logic gates or a CPLD. It has to be available in a reasonably small package but still 'DIY friendly' (no BGA etc.) and modestly priced. I spent a lot of time examining the datasheets of dozens of PICs and only one seemed to be suitable (and even that needed a few level converters). I have a PIC32MX150F128D which has both a parallel slave port and SPI, but guess what - due to a pin assignment conflict you can't use both at the same time!  >:(
Try WCH CH563. It does all the above at the same time (the only set of conflicting pin assignments I know of is the parallel master and slave ports, but that does make sense as it can put the main CPU on hold and perform DMA on its own this way.) And it is a 32-bit MCU too based on ARM9 core.
PSOC is the only MCU that will do what I want, and I if I want something different it will still do it.
Try shop around a bit and you will find other options than PSoC that satisfies your needs.
Title: Re: Pic mcu alternatives???
Post by: george.b on June 22, 2017, 03:06:36 am
No love for the MSP430?
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 03:25:39 am
Try WCH CH563. It does all the above at the same time (the only set of conflicting pin assignments I know of is the parallel.

Issues of WCH chip:

Does it operate at 5V without level shifters and regulators?
It is a 3.3V part with 5V tolerant I/O. So I would assume useable in a 5V system.
Does it have a proven CPU such as ARM or MIPS?
ARM9.
Does it have a distributor in the western world?
No idea. Ask WCH for this.
Does it have a properly translated English datasheet and SDK?
They do, although the translation is a bit rusty.
Can it guarantee all its IP blocks and SDK are properly licensed so you don't have a problem exporting in massive quantity?
WCH have ARM9 license and they cooked up the remaining IP cores themselves.
Has it been field tested in harsh environment, which PSoC has been?
You have to ask WCH for this.
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 03:28:32 am
No love for the MSP430?
Don't bother mentioning anything other than PSoC now in this thread - flame war ongoing. My trying to defend off the PSoC warriors is probably going to get me banned soon.
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 04:13:10 am
Does it have a proven CPU such as ARM or MIPS?
ARM9.

Can it guarantee all its IP blocks and SDK are properly licensed so you don't have a problem exporting in massive quantity?
WCH have ARM9 license and they cooked up the remaining IP cores themselves.

If you designed a chip and used a properly licensed ARM9 core, will you call it ARMv5 compatible RISC core or just an ARM9 core?

BTW. when I say IP infringement, I mean not only IP copyright, but also patent. Strictly speaking every SD (except SPI or MMC mode) card enabled device should have an SD patent, which 90%+ don't.
They took out the entire CP15 so it no longer an actual ARM9 core, thus only ARMv5 compatible.

Also show me the proof that TI or ST or NXP have SD license.
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 05:00:12 am
Also show me the proof that TI or ST or NXP have SD license.

ST offers a lot of proprietary technologies, such as AAC, MP4, SD and more. They don't provide the license with each silicon as that will be too expensive for those don't need it, also, some IPs have a percentage of retail price based licensing model, rather than a flat rate.

ST however, offers a licensing program, so you can get license from ST, and essentially ST becomes a man in middle for some licensed technologies. Google ST fast MP3 decoder, that's a good example (though MP3 has just expired).

NXP does the similar thing. They offer a licensed gstreamer plugin set for iMX processors, you need to contact them for more info.

As for SD, since anyway most MCU users use SPI interface it doesn't matter, and most embedded designs use eMMC interface, that also circumvents the licensing issue. However, if you want to put an SD slot with SD interface, you have to obtain a license.

I don't see WCH offering a licensing program for the IPs they used in their demo applications.

The same extends to why people spend $4-digit to buy IP cores from Altera or Xilinx, rather than grab one from OpenCores. It's likely for a small player, getting the patent license from its true owner is more expensive then getting copyright license+patent license from an IP distributor like Altera.
SD card have built-in DRM features which is extremely underused, and that is the only other technology the SD license would offer along with UHS-II, since for generic block devices the card would be simply placed into 1- or 4-bit MMC mode, which is license free. SDHC and SDXC capacity additions are made in coordination with MMC team (hence the 16GB eMMC being available now) so it is not covered in SD license. (The DDR modes on SD cards seemed to me like a response to the 8-bit mode in MMC. Also the UHS-II additional pins seemed to me like a half-hearted imitation of UFS SCSI interface or NVMe PCIe interface.)

For WCH CH563: they took the CP15 out of their implementation of an ARM9-based core, hence it is no longer a complete ARM9 core, instead it can only be called ARMv5-compatible. Their "SD" interface is actually a 4-bit MMC interface incapable of making use of the DRM features of SD interface.
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 05:12:39 am
SD card have built-in DRM features which is extremely underused, and that is the only technology the SD license would offer, since for generic block devices the card would be simply placed into 1- or 4-bit MMC mode, which is license free. SDHC and SDXC capacity additions are made in coordination with MMC team (hence the 16GB eMMC being available now) so it is not covered in SD license.

Is there any reference for this? That will not only help me, but help a lot of people here pulling their hair on SD license.
There is a passing mention on Wikipedia saying that SD cards have DRM features which MMC lacked, but there is barely anyone using it AFAIK. For any other purposes SD in SPI, 1-, 4-bit and UHS-I modes is electrically and logically equivalent to, at least compatible with MMC.

So there are only two features of SD that really mandates a SD license: DRM and UHS-II. The first is barely used anywhere (maybe except Windows Phone 7.) The second have stiff requirements for the host interface, not a lot of people would be even able to think about using.
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 05:44:56 am
There is a passing mention on Wikipedia saying that SD cards have DRM features which MMC lacked, but there is barely anyone using it AFAIK. For any other purposes SD in SPI, 1-, 4-bit and UHS-I modes is electrically and logically equivalent to, at least compatible with MMC.

Is there a chance that MMC uses SD technology or they cross licensed each other, and SD Association exempts the use of SD technology with MMC cards, but not with SD cards?
I think historically it was SD tracking MMC and keeping being a strict superset of MMC. Coming to the SDHC days there have been a lot of cross licensing and technology feedback going on, with MMC taking up the high capacity capabilities first designed by SD association. The SD association knows what technology is being borrowed from MMC and what is their own creation.

TechnologyStatus
SPI modeSD -> MMC
MMC/SD 1-bit modeMMC -> SD
MMC/SD 4-bit modeMMC -> SD
MMC 8-bit modeMMC only
SDIOBased on standard MMC/SD 1-/4-bit mode anyway
32GB and 2TB support (SDHC and SDXC)SD -> MMC
UHS-IISD only
DRMSD only, rarely used
Title: Re: Pic mcu alternatives???
Post by: Elf on June 22, 2017, 06:00:25 am
No love for the MSP430?

Expensive, lack of modern peripherals and the killer feature at introduction, which is ultra low power, is no longer advantageous compared with competitors.
Code Composer Studio and the free TI Compiler are pretty good. Decent libraries in their "MSP430ware" package. Well documented. A reasonable selection of packages across the line from small to large, including DIP if that's your thing. I don't care for DIP anymore but a lot of hobbyists still like it. The FRAM parts are intriguing if you were previously dependent on EEPROM or Flash. Popular and good community support. That's all important stuff, right?

It is a little more expensive than the competition, but not that much. Maybe a dollar more or so? It's something to take into account for quantities over 1000, I guess. Certainly not the sort of pain I had recently trying to stock up on STM32F405 at $10/chip, since I needed the two USB OTG host interfaces. That became expensive really fast.

MSP430 isn't a crazy whiz-bang everything included platform, but it has the sort of peripherals that most projects would need. I like it. I don't look for everything on one chip. I would rather just have enough UARTs that I can talk to what I want.

It's a pretty good platform for someone trying to deal with a PIC16 and the sad XC8 compiler situation, and looking to try something new (the original post in the thread). So is any Cortex M0+ chip if you want to see what the ARM hype is about, or a whole lot of products.
Title: Re: Pic mcu alternatives???
Post by: Bruce Abbott on June 22, 2017, 07:19:57 am
I can spin the same PCB and leave different portions of the circuit unpopulated or underspecified.
For me the PCB is likely to cost more than the chip, so I would rather not have unpopulated areas that I may never use. 

Quote
Rigol built the baseline and advanced models using the same PCB people started hacking it to make the baseline model work like an advanced one. Try count up how much revenue you would lose in this kind of hacking,
I wouldn't lose because I wouldn't have played such a dirty trick on my customers. And if they find a way to make it more advanced then more power to them! (warranty void of course...).

Quote
Try WCH CH563. It does all the above at the same time (the only set of conflicting pin assignments I know of is the parallel master and slave ports, but that does make sense as it can put the main CPU on hold and perform DMA on its own this way.) And it is a 32-bit MCU too based on ARM9 core.
Figures. The device I am trying to duplicate (and improve) is the CH376.

I downloaded the CH563 manual, but it's written in Chinese and Google couldn't translate it. Is there an English version? Google couldn't find any suppliers either. Where do you buy the chip?
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 07:46:59 am
I can spin the same PCB and leave different portions of the circuit unpopulated or underspecified.
For me the PCB is likely to cost more than the chip, so I would rather not have unpopulated areas that I may never use. 
I may have a different mindset than yours here - I design the top of the line product first, then cut it down to form the lower tier products.

Also having multiple different PCBs not only can cost more in production but also increases the cost of stocking them. With one single PCB taking care of an entire product line I can maneuver the business much more nimbly by pulling or adding components as needed. Hell I can even rework RMA'd high tier boards into useable lower tiered one by slicing traces. Yes my production cost can be slightly higher but the long term maintenance cost is grinded down into the mud.
Quote
Rigol built the baseline and advanced models using the same PCB people started hacking it to make the baseline model work like an advanced one. Try count up how much revenue you would lose in this kind of hacking,
I wouldn't lose because I wouldn't have played such a dirty trick on my customers. And if they find a way to make it more advanced then more power to them! (warranty void of course...).
Think again. If you differentiate the market only by the code loaded into the PSoC, isn't that the same as the Rigol here?

For me if you paid more you do actually get more circuit - either more components mounted, or better components mounted.
Quote
Try WCH CH563. It does all the above at the same time (the only set of conflicting pin assignments I know of is the parallel master and slave ports, but that does make sense as it can put the main CPU on hold and perform DMA on its own this way.) And it is a 32-bit MCU too based on ARM9 core.
Figures. The device I am trying to duplicate (and improve) is the CH376.

I downloaded the CH563 manual, but it's written in Chinese and Google couldn't translate it. Is there an English version? Google couldn't find any suppliers either. Where do you buy the chip?
CH376 is a 5V tolerant chip in the first place, with internal 3.3V regulator for the USB stack... If your system does not use 3.3V elsewhere you just need to hook a bypass cap to the V3 pin and it would work.
Title: Re: Pic mcu alternatives???
Post by: FrankBuss on June 22, 2017, 08:25:02 am

Think again. If you differentiate the market only by the code loaded into the PSoC, isn't that the same as the Rigol here?

For me if you paid more you do actually get more circuit - either more components mounted, or better components mounted.

By this logic a PC with only Linux installed on it would cost the same as a PC with some expensive commercial software pre-installed on it.
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 08:38:09 am

Think again. If you differentiate the market only by the code loaded into the PSoC, isn't that the same as the Rigol here?

For me if you paid more you do actually get more circuit - either more components mounted, or better components mounted.

By this logic a PC with only Linux installed on it would cost the same as a PC with some expensive commercial software pre-installed on it.
Windows and Linux are licensed from someone else - just like the components on boards that is bought from someone else. I am talking about code you created that goes into the PSoC.

Either you have developed the code for different tiers of product separately (which does not make sense - why are you reinventing the wheels over and over again,) cut the code to match the product tier (hack bait,) licensed it from somewhere else (like this Windows vs Linux scenario - it is the end user pirating someone else's code, not really my business) or you are hurting your own margin of profit in the lower tier product.

For me there is only one shared firmware code that is common across all models, from the baseline to the most advanced. The POST process will detect the presence of various subsystems and enable or disable the corresponding software features accordingly (please do not tell me you don't have a POST procedure...)
Title: Re: Pic mcu alternatives???
Post by: JanJansen on June 22, 2017, 12:07:22 pm
No one mentions DIP packaging.
There is no better choice if you want DIP i found out, please tell me if it is not correct.
Title: Re: Pic mcu alternatives???
Post by: tszaboo on June 22, 2017, 12:32:39 pm
I'm just waiting for someone to ctrl+c ctrl+v here their Holy Wall Of Text of the PSOC, how it is superior to everything. BTW it's not.
I think it have arrived. Well a shorter version arrived, with a link to a MUCH longer one.
No love for the MSP430?
Don't bother mentioning anything other than PSoC now in this thread - flame war ongoing. My trying to defend off the PSoC warriors is probably going to get me banned soon.
I always imagine them like a bunch of birds, flying in through every window, and strating "PSOC PSOC PSOC PSOC"
"You can add two values with PSOC hardware"... but I dont want to..."Its so great, its only 10 bucks for the devboard. I used it to blink an LED. Eat it! Eat it!"
Title: Re: Pic mcu alternatives???
Post by: igendel on June 22, 2017, 12:55:16 pm
I always imagine them like a bunch of birds, flying in through every window, and strating "PSOC PSOC PSOC PSOC"
"You can add two values with PSOC hardware"... but I dont want to..."Its so great, its only 10 bucks for the devboard. I used it to blink an LED. Eat it! Eat it!"

What's PSoC? Is it some kind of a microcontroller? Is it better than the other kinds?









...sorry, couldn't help it  :D
Title: Re: Pic mcu alternatives???
Post by: alm on June 22, 2017, 01:16:46 pm
No one mentions DIP packaging.
No one? What about Elf's post about MSP430 just a few posts above yours?

There is no better choice if you want DIP i found out, please tell me if it is not correct.
Define better? On the low end MSP430 and AVR are both available in DIP. I believe at some point NXP made an ARM Cortex M0 in DIP, but I am not sure if that is still available. I do not think there is much competition for PIC32 in DIP.
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 01:48:17 pm
No one mentions DIP packaging.
There is no better choice if you want DIP i found out, please tell me if it is not correct.
32-bit: There are the PIC32 line, LPC810M021FN8 and LPC1114FN28.
16-bit: PIC24, dsPIC30, dsPIC33 lines, MSP430 line.
8-bit: Well classic 8-bit are still available in 8-bit packages.
Title: Re: Pic mcu alternatives???
Post by: ebclr on June 22, 2017, 01:57:22 pm
"What's PSoC? Is it some kind of a microcontroller? Is it better than the other kinds?"

Your answer is on this link

https://brightcove.hs.llnwd.net/e1/uds/pd/1362235890001/1362235890001_5241352463001_2606504288001.mp4?pubId=1362235890001&videoId=2606504288001
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 02:02:18 pm
I always imagine them like a bunch of birds, flying in through every window, and strating "PSOC PSOC PSOC PSOC"
This comparison is lit.
"You can add two values with PSOC hardware"... but I dont want to...
And the value adding doesn't really work out in a lot of cases.
"Its so great, its only 10 bucks for the devboard. I used it to blink an LED. Eat it! Eat it!"
I am okay with burning $10 now so I bought one. I am going to verify the fact content of whatever they claimed it to be. Blog posts upcoming.
Title: Re: Pic mcu alternatives???
Post by: igendel on June 22, 2017, 02:02:56 pm
"What's PSoC? Is it some kind of a microcontroller? Is it better than the other kinds?"

Your answer is on this link

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

Thanks, but I think you missed the bottom line of my post...  ;)
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 02:22:13 pm
"What's PSoC? Is it some kind of a microcontroller? Is it better than the other kinds?"

Your answer is on this link

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

Thanks, but I think you missed the bottom line of my post...  ;)
I do appreciate the humor, but you might be feeding the flame...
Title: Re: Pic mcu alternatives???
Post by: JanJansen on June 22, 2017, 02:51:25 pm
No one? What about Elf's post about MSP430 just a few posts above yours?

Oh sorry, did not see.

Define better? On the low end MSP430 and AVR are both available in DIP. I believe at some point NXP made an ARM Cortex M0 in DIP, but I am not sure if that is still available. I do not think there is much competition for PIC32 in DIP.

I mean improvement over the best PIC chips in DIP, like top of the line, newest stuff only.
PIC chips in DIP has 28 pins, i would like to have a 40 pin package also.

Do the NXP has free compiler without any paying involved for better performance ?,
not that PIC is bad if you set your project from optimize 0 to optimize 1 ( still free ),
it frustrates me that i risk one day to loose a lot of money because i want full optimize, i better buy nice hardware for that money.

Ok i know : need to buy converter sockets for those SMD chips, maybe a microscope and more, first lets see what i still can get in DIP.
If no one buys DIP they are being faded out of production faster also.

LPC810M021FN8 and LPC1114FN28.
MSP430 line.

Thanks, will take a look.
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 03:27:07 pm
Do the NXP has free compiler without any paying involved for better performance ?,
not that PIC is bad if you set your project from optimize 0 to optimize 1 ( still free ),
it frustrates me that i risk one day to loose a lot of money because i want full optimize, i better buy nice hardware for that money.
It is an ARM Cortex-M0 chip so GCC and LLVM/clang would work... If you have trouble finding vendor tools you might as well skip it entirely and go straight to (vanilla) Eclipse CDT + GNU ARM Eclipse + GCC ARM Embedded toolchain.
Ok i know : need to buy converter sockets for those SMD chips, maybe a microscope and more, first lets see what i still can get in DIP.
If no one buys DIP they are being faded out of production faster also.
Sadly true. I tried to find the 28-pin LPC1114FN28 but all I find for LPC1114 line is QFP-48 ones.

You can find adapter boards for most SMT packages that fits breadboards. I even have QFP-48 STM32F303CCT6 on such adapters.
Title: Re: Pic mcu alternatives???
Post by: Sal Ammoniac on June 22, 2017, 03:54:13 pm
If no one buys DIP they are being faded out of production faster also.

I'm surprised that any company is still making DIP parts. Only hobbyists really use them, and the volume associated with that is peanuts. It must be because they still have a large stock of legacy parts sitting on shelves.
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 04:03:16 pm
If no one buys DIP they are being faded out of production faster also.

I'm surprised that any company is still making DIP parts. Only hobbyists really use them, and the volume associated with that is peanuts. It must be because they still have a large stock of legacy parts sitting on shelves.
A lot of cheap gadgets made in China still uses the 80's DIP on single layer board construct - damn cheap to make.
Title: Re: Pic mcu alternatives???
Post by: JPortici on June 22, 2017, 04:35:00 pm
i like to use socketed dip chips for pats that may blow up, like drivers/comparators
when making a new product i start with a protoboard with the target MCU. if same core/peripherals but dip+less pins part is available i use that one (microchip the great)

i usually don't have a lot of space for that enormous adapters, also a lot less wires to solder

for 8 bitters i prototype with sockets also because i can upgrade/downgrade/change with pin to pin compatible by just removing chip from socket and inserting a new one
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 05:42:50 pm
i like to use socketed dip chips for pats that may blow up, like drivers/comparators
when making a new product i start with a protoboard with the target MCU. if same core/peripherals but dip+less pins part is available i use that one (microchip the great)

i usually don't have a lot of space for that enormous adapters, also a lot less wires to solder

for 8 bitters i prototype with sockets also because i can upgrade/downgrade/change with pin to pin compatible by just removing chip from socket and inserting a new one
For me I socket all DIP chips regardless of purpose. The adapter boards comes with a SMD footprint and all pins broken out to breadboard compatible format. For adapters of packages SO-8 and smaller the adapter board is usually the same size as a 0.3in DIP package of the same pin count. SO and SOJ adapters can go up to 48 pins with 0.6in width. And I also have a 0.6in wide QFP48 adapter.
Title: Re: Pic mcu alternatives???
Post by: alm on June 22, 2017, 06:41:33 pm
I mean improvement over the best PIC chips in DIP, like top of the line, newest stuff only.
PIC chips in DIP has 28 pins, i would like to have a 40 pin package also.
It would surprise me to see any new series of micros came out in DIP. Even the recentish low-end STM8 core is not available in DIP as far as I know.

Do the NXP has free compiler without any paying involved for better performance ?,
not that PIC is bad if you set your project from optimize 0 to optimize 1 ( still free ),
it frustrates me that i risk one day to loose a lot of money because i want full optimize, i better buy nice hardware for that money.
I think Microchip is pretty much the only vendor to strip optimization from a compiler. More common is a code size limit for either programming or debugging. NXP has their own LPCXpresso/MCUXpresso (they acquired the company behind it, Code Red, a couple of years ago) which is Eclipse + CDT + gcc + their proprietary debugging/programming stuff. The only limitation as far as I know is a fairly generous programming limit. As with any ARM chip, you can also just grap the open source ARM gcc compiler, Eclipse, CDT etc to have a fully open source IDE.

Ok i know : need to buy converter sockets for those SMD chips, maybe a microscope and more, first lets see what i still can get in DIP.
If no one buys DIP they are being faded out of production faster also.
Their are also numerous development boards in DIP footprint that might work for prototyping.
Title: Re: Pic mcu alternatives???
Post by: Bruce Abbott on June 22, 2017, 07:23:25 pm
I'm surprised that any company is still making DIP parts. Only hobbyists really use them,
I'm surprised that platforms such as the Arduino and Raspberry Pi exist - only hobbyists use them.  ;)

Some manufacturers think the hobbyist, educational and and small-scale professional markets aren't worth chasing. They make MCUs you never heard of and nobody wants.     
Title: Re: Pic mcu alternatives???
Post by: Bruce Abbott on June 22, 2017, 07:36:38 pm
CH376 is a 5V tolerant chip in the first place, with internal 3.3V regulator for the USB stack... If your system does not use 3.3V elsewhere you just need to hook a bypass cap to the V3 pin and it would work.
I don't think you quite understand. The CH376 'works' but has performance issues. Since it doesn't appear to be hackable, I need another chip to replace it. 

You suggested the CH563, which looks like it could be a good choice. However without a readable datasheet and source of supply it is useless. Can you help me? If not then PSOC is still my best option.
Title: Re: Pic mcu alternatives???
Post by: technix on June 22, 2017, 11:31:38 pm
CH376 is a 5V tolerant chip in the first place, with internal 3.3V regulator for the USB stack... If your system does not use 3.3V elsewhere you just need to hook a bypass cap to the V3 pin and it would work.
I don't think you quite understand. The CH376 'works' but has performance issues. Since it doesn't appear to be hackable, I need another chip to replace it. 

You suggested the CH563, which looks like it could be a good choice. However without a readable datasheet and source of supply it is useless. Can you help me? If not then PSOC is still my best option.
It takes time and money to translate the documentation. I can help but only if someone is willing to pay for the labor.

As of the chips I can source them for you directly from WCH (it is a two hour drive from Shanghai to Nanjing, where WCH is located.)
Title: Re: Pic mcu alternatives???
Post by: twiddle on June 23, 2017, 03:12:02 am
Sadly true. I tried to find the 28-pin LPC1114FN28 but all I find for LPC1114 line is QFP-48 ones.

You can find adapter boards for most SMT packages that fits breadboards. I even have QFP-48 STM32F303CCT6 on such adapters.

Both the NXP DIP package chips are still listed as being in production, but it looks like they have absurdly high MOQ and none of the major distributors bother any more.
Makes me glad I managed to get 15 or so LPC1114 when element14 stocked them, they are great for testing, but I wish I had grabbed some of the LPC8XX as an alternative to ATTiny85s. If you can find anybody selling the 1114, they are ideal for getting into ARM with absolute minimal cost, gcc works well with them (as it should for most Cortex-M). 

I second the adapter boards - I've used 48 and 64-pin packages on breadboards via them - its not ideal but it gets the job done.
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on June 23, 2017, 04:16:44 am
I second the adapter boards - I've used 48 and 64-pin packages on breadboards via them - its not ideal but it gets the job done.

I use lots of adapter boards with sockets. They let you easily prototype with practically any package. This one is for TQFP:

(http://www.northernsoftware.com/forum/s100pin.jpg)

I use them even with DIP packages, which are still the easiest to deal with:

(http://www.northernsoftware.com/forum/s40pin.jpg)

For dual packages, such as SOIC or SSOP, I solder them on a PCB SSOP-to-DIP adapters and then I can easily plug them into my ZIF sockets.

Title: Re: Pic mcu alternatives???
Post by: Bruce Abbott on June 23, 2017, 03:27:15 pm
It takes time and money to translate the documentation. I can help but only if someone is willing to pay for the labor.
You don't need to translate it, just convert the pdf text to something Google Translate can handle (or tell me how to do it).

Title: Re: Pic mcu alternatives???
Post by: technix on June 23, 2017, 03:31:42 pm
It takes time and money to translate the documentation. I can help but only if someone is willing to pay for the labor.
You don't need to translate it, just convert the pdf text to something Google Translate can handle (or tell me how to do it).
Try open it with Windows version of Word 2016.
Title: Re: Pic mcu alternatives???
Post by: technix on June 23, 2017, 03:35:19 pm
I second the adapter boards - I've used 48 and 64-pin packages on breadboards via them - its not ideal but it gets the job done.

I use lots of adapter boards with sockets. They let you easily prototype with practically any package. This one is for TQFP:

(http://www.northernsoftware.com/forum/s100pin.jpg)

I use them even with DIP packages, which are still the easiest to deal with:

(http://www.northernsoftware.com/forum/s40pin.jpg)

For dual packages, such as SOIC or SSOP, I solder them on a PCB SSOP-to-DIP adapters and then I can easily plug them into my ZIF sockets.
These are fancy.

I got the most simple type - I just solder the chip and a strip of pins onto the board and good to go.
Title: Re: Pic mcu alternatives???
Post by: Sal Ammoniac on June 23, 2017, 03:37:19 pm
Some manufacturers think the hobbyist, educational and and small-scale professional markets aren't worth chasing. They make MCUs you never heard of and nobody wants.

And some of those manufacturers sell millions of those parts nobody wants.
Title: Re: Pic mcu alternatives???
Post by: igendel on June 23, 2017, 03:44:02 pm
About these adapter boards with sockets for SMD parts - Do they cause problems with external capacitors or crystals that need to be very close to the MCU pins?
Title: Re: Pic mcu alternatives???
Post by: JanJansen on June 23, 2017, 03:46:47 pm
I think Microchip is pretty much the only vendor to strip optimization from a compiler. More common is a code size limit for either programming or debugging. NXP has their own LPCXpresso/MCUXpresso (they acquired the company behind it, Code Red, a couple of years ago) which is Eclipse + CDT + gcc + their proprietary debugging/programming stuff. The only limitation as far as I know is a fairly generous programming limit. As with any ARM chip, you can also just grap the open source ARM gcc compiler, Eclipse, CDT etc to have a fully open source IDE.

A program limit or no optimize is the same to me, i would like to use all space possible for lookuptables without limits,
using all space for lookuptables can only be done with ASM for PICs, i only can code in C.
How about the competition ?, can they use all ROM for LUTs ?

Open source sounds good, if i dont have to compile anything, i like original stuff better.
Title: Re: Pic mcu alternatives???
Post by: technix on June 23, 2017, 03:55:10 pm
I think Microchip is pretty much the only vendor to strip optimization from a compiler. More common is a code size limit for either programming or debugging. NXP has their own LPCXpresso/MCUXpresso (they acquired the company behind it, Code Red, a couple of years ago) which is Eclipse + CDT + gcc + their proprietary debugging/programming stuff. The only limitation as far as I know is a fairly generous programming limit. As with any ARM chip, you can also just grap the open source ARM gcc compiler, Eclipse, CDT etc to have a fully open source IDE.

A program limit or no optimize is the same to me, i would like to use all space possible for lookuptables without limits,
using all space for lookuptables can only be done with ASM for PICs, i only can code in C.
How about the competition ?, can they use all ROM for LUTs ?

Open source sounds good, if i dont have to compile anything, i like original stuff better.
I write LUTs in C (big const array) so...

Actually for some architecture (like ARM) the open source stuff may actually be the best: For GCC the GNU folks adds architecture independent optimizations to all available architectures so ARM code may benefit from something that originated from Intel or IBM. For LLVM/clang we have Apple and Google being two of the biggest contributors, both being very will known for their ARM-based systems (iOS and Android respectively) and have every reason to add as much optimizations as they can.
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on June 23, 2017, 04:30:31 pm
About these adapter boards with sockets for SMD parts - Do they cause problems with external capacitors or crystals that need to be very close to the MCU pins?

The big socket board has SMD capacitors on the bottom. The small one only has two TH capacitors on top (0.1uF decoupling cap at the power entry and 10uF next to the ZIF, which is sometimes needed) - it is for PIC16/18 which are rather low frequency. I've never had any problems with those and I have lots of such sockets.

As to the crystals, you can see the connectors to place crystals. This certainly isn't close to the MCU pins, but I've never had any problems with those neither. Of course, this is not what you would do for production, but this works fine for testing and prototyping.
Title: Re: Pic mcu alternatives???
Post by: alm on June 23, 2017, 05:48:02 pm
A program limit or no optimize is the same to me, i would like to use all space possible for lookuptables without limits,
using all space for lookuptables can only be done with ASM for PICs, i only can code in C.
How about the competition ?, can they use all ROM for LUTs ?

Open source sounds good, if i dont have to compile anything, i like original stuff better.
With programming limit I meant the size of the file it will program in a target. That is what NXP does in their own IDE. Again, it is just a packaged version of GCC, GDB, Eclipse, CDT, etc, plus some features like dedicated register views. There are other packaged versions of this stuff like Atollic (https://atollic.com/truestudio/) (limits advanced features like multi core, tracing and RTOS, no code size). I believe CooCox CoIde (http://coocox.org/software.html) is fairly popular with Windows users wanting a free IDE without having to do much setup. Generally these third-party IDEs will support all common ARM Cortex lines like STM32, NXP LPC1xxx andTI Teva.

I do not see the problem with putting stuff in ROM in C. Something like
Code: [Select]
static const uint8_t[0x20000] = { 1, 4, 6, ... };
Should end up in ROM.
Title: Re: Pic mcu alternatives???
Post by: JanJansen on June 24, 2017, 01:55:23 pm
I do not see the problem with putting stuff in ROM in C. Something like
Code: [Select]
static const uint8_t[0x20000] = { 1, 4, 6, ... };
Should end up in ROM.

I wish that would work for my DSPIC33FJGP802
it can only be done in ASM they say, i need that without learning ASM.
Someone posted some ASM code, i dont wanto copy it without knowing what it is, unreadable stuff.
Then i wanto mix it together with C code, maybe that can mess things up also ?
Title: Re: Pic mcu alternatives???
Post by: technix on June 24, 2017, 02:04:33 pm
I do not see the problem with putting stuff in ROM in C. Something like
Code: [Select]
static const uint8_t[0x20000] = { 1, 4, 6, ... };
Should end up in ROM.

I wish that would work for my DSPIC33FJGP802
it can only be done in ASM they say, i need that without learning ASM.
Someone posted some ASM code, i dont wanto copy it without knowing what it is, unreadable stuff.
Then i wanto mix it together with C code, maybe that can mess things up also ?
Maybe you need to add some kind of keyword to tell the compiler you need to put the code in program Flash, like the PROGMEM on AVR.
Title: Re: Pic mcu alternatives???
Post by: nctnico on June 24, 2017, 02:22:38 pm
I'm not familiar with the DSPpic family but DSP usually means a Harvard architecture where you can't easely access data from the flash (ROM) except for the program machinecode because you have two seperated address spaces. The ASM code probably copies data from the ROM to RAM but if you initialise the data the C startup files should do that. Anyway nowadays it really isn't necessary to mess with thise kind of obfustigated architectures unless you need crazy performance. Just move over to ARM which has a single address space and (depending on the core) DSP extensions and SIMD instructions.
Title: Re: Pic mcu alternatives???
Post by: cv007 on June 25, 2017, 01:23:07 am
Quote
using all space for lookuptables can only be done with ASM for PICs, i only can code in C.

For the 16F, I do something like the following (if needed), I never used a dspic so maybe does not apply but usually there is a way to make the c compiler do what you want. In this case it works good for 14bit data or less.
Code: [Select]
void ascii_lookup_14seg(){
  //make known this 'function' used with 'global'
  //prepend '_' to asm name
  asm("global _ascii_lookup_14seg");
  //as much data as needed (14bit or less)
  asm("dw 0,6,544,4814,4845,3108,9053,1024");
  //return added here, is ok
}

uint16_t rom_read(uint16_t waddr)
{
  PMADR = waddr; //set address
  CFGS = 0; //flash space
  RD = 1; //start read
  NOP(); //next 2 instructions ignored
  NOP();
  return PMDAT;
}

uint8_t n = 3;
uint16_t val = rom_read( (uint16_t)ascii_lookup_14seg + n );

A normal 'const' would place the data in flash as retlw instructions (14bits flash = 8bits data), where this is 14bits flash = 14bits data. If one is trying to squeeze some more code in available space, this could help. I was using just less than half of a 4Kword pic, and decided I wanted a bootloader so I could upload a newer 'app' to page1 (but page0 code cannot change and always runs on reset). I had a couple 'const' tables that were 14bit data, so I used the code above to save about 300words which enabled me to fit everything in page0. I also wrote the reset/irq jump code needed also in C (with 'asm' keyword), so you can do most things without leaving 'c' if wanted. In the end, I gave up the bootloader idea as its really not worth the trouble and am now back to using 35% of a 4Kword part, using normal 'const', although I also have plenty of extra ram so don't even need to use 'const'.

Although I have previously used gcc with other micros (avr, arm) and have been familiar enough with the many gcc/gas options so can usually find/get what I want done, my only guide was the xc8 user manual. It had all the info I needed to move the page0 app up to make room for the reset/irq jump code, and to build an app that resided in page1.

The free version of xc8 is fine for most users and the few extra instructions will not make any difference. If you feel you can't make it without the last bit of optimizations, I believe you can spend $30 on a one month subscription to xc8 pro.

There are always different parts for different applications, but in defense of 8bitters- find me a 32bit part that can source/sink 20ma per pin with 250-350ma total, find me a 32bit part that can sleep with 100na or less, find me a 32bit part that can run from 1.8v-5.5v, find me a 32bit part that can be had in dip/soic/ssop/qfn, find me a 32bit part that comes in 6pins when I only need a few pins to do something simple, find me a 32bit part... I'll quit while I think I'm ahead :)


Title: Re: Pic mcu alternatives???
Post by: JanJansen on June 25, 2017, 01:42:25 pm
Hi, thanks for sharing.
normally i have nothing to do with pages in C, i have no clue, exept that it has to fit in 1 page.
I use lookuptables with 16 or 32 bit data.

Now i have my sinus lookup-table in DSPIC like this :
const unsigned short sinus4096[ 4096 ] = {
0,
};

i better want to have this :

const unsigned short sinus65536[ 65536 ] = {
0,
};

Or even better if it fits the ROM, then i can use more partials ( harmonix ).
Title: Re: Pic mcu alternatives???
Post by: technix on June 25, 2017, 02:47:09 pm
const unsigned short sinus65536[ 65536 ] = {
0,
};
This is huge - 256kB for a 64k-entry 32-bit LUT. Usually for this big an array I would compress the data in some way - either leveraging the mathematical properties (like for sine and cosine you only need 1/4 of one cycle of one waveform to store both) or using plain old compression algorithms (unlzma an array of data in ROM into external RAM)
Title: Re: Pic mcu alternatives???
Post by: JPortici on June 25, 2017, 02:58:25 pm


I do not see the problem with putting stuff in ROM in C. Something like
Code: [Select]
static const uint8_t[0x20000] = { 1, 4, 6, ... };
Should end up in ROM.

I wish that would work for my DSPIC33FJGP802
it can only be done in ASM they say, i need that without learning ASM.
Someone posted some ASM code, i dont wanto copy it without knowing what it is, unreadable stuff.
Then i wanto mix it together with C code, maybe that can mess things up also ?

I use rom constants on dspics all the time, i just need to declare them as const.
There should also be a flash/rom qualifier for __attribute but const should be enough. What does the compiler manual say? I'm away so i can't check

I remember you have to tick a checkbox in compiler settigs for arrays bigger than 64k (elements?)
Title: Re: Pic mcu alternatives???
Post by: JanJansen on June 25, 2017, 04:24:42 pm
Thank you JPortici, i will take a look.

When compiling there is a limit shown in the log for text, const data etc.
Using more data then this size gives error.

Especially when using LCD displays with a big menu, the text is always to much data to have, while my chip is around 50% full programmed.

edit : i,m reading this now : http://microchipdeveloper.com/faq:75 (http://microchipdeveloper.com/faq:75)
might solve things ?, gonna add codes i dont understand : __eds__  and __attribute__((space(psv))) or __attribute__((space(prog)))  whatever that is for.
I have the same attribute stuff in the interrupt code i copyd from the manual, i just ignore it.
Title: Re: Pic mcu alternatives???
Post by: JPortici on June 25, 2017, 05:07:56 pm
Read the compiler manual.
Also, the dspic programmer manual to have a better understanding of the architecturez psv etc
Title: Re: Pic mcu alternatives???
Post by: krho on June 25, 2017, 05:54:10 pm
Does the pic compiler really suck that much.. that's unable to calculate the size of array itself?
e.g does static const uint8_t[] = { 1, 4, 6, ... }; fail?
Title: Re: Pic mcu alternatives???
Post by: JPortici on June 25, 2017, 06:28:00 pm
How is it that 'you already know the size but you don't want to put it in declaration so the compiler sucks'?
I really don't get it

But i think you can, i do delcare functions with const uint8_t message[] and put "this phrase" as an input variable
Title: Re: Pic mcu alternatives???
Post by: hans on June 25, 2017, 07:24:28 pm
It's called C99. Make sure to enable it explicitly.

And like the name suggests, it's an industry standard that's already 18 years old.
XC8 does not support it. XC16 and XC32 do.

C89 is the horror where this is not allowed:
Code: [Select]
void someFunction(uint8_t* data) {
  if (write8bits) {
    for (int i = 0; i < 8; i++) {}
  }
}
Because deceleration of variables must be at start of function. |O

I'm working with other compilers, including ARM and FPGA softcores, that support C++11 and C++14 very well. XC32 does do C++11 as well, because it's GCC 4.8.x last time I checked.
Title: Re: Pic mcu alternatives???
Post by: cv007 on June 25, 2017, 08:10:44 pm
Quote
e.g does static const uint8_t[] = { 1, 4, 6, ... }; fail?
No, that works fine.

Quote
where this is not allowed
It works just fine. If you want to declare (or decelerate) variables in that for loop, go right ahead.
Title: Re: Pic mcu alternatives???
Post by: JanJansen on June 26, 2017, 09:59:35 am
YEEESSS!, it works, adding __eds__  and __attribute__((space(prog))) works, together with the allow arrays bigger then 32K option,
i have a sinus from 32768 positions now, it fills about 75% of the whole chip, i,m happy, gonna program/build a hammond organ emulation without interpolation now.
thanks all, sorry for the topic hijack.
greetings

btw : i did not test, it does compile, should work.
Title: Re: Pic mcu alternatives???
Post by: JPortici on June 26, 2017, 12:04:10 pm
Test it!

And at some point i'd move everything from uint16 to int16 and then to fract and use the dsp. Granted you can use it anyway with int types, but fract is more appropriate (with the dsp accumulators the result goes up to +/- 256.0 to handle overflows... i'd use one for summing the tonewheels)

Actually, i'd use fewer points and put the table in ram. Dspic33e is very skow at fetching data from flash (5 instructions cycles IIRC, whereas it needs 2 to fetch from ram. Also, with the dsp instructions you have multiple data fetches in a single instructions, so you can remove the lag from memory access time) and interpolate to get intermediate values if you really need more resolution. There is the thread on hot to calculate sine tables here that lists several interpolation methods with error, thd etc
Title: Re: Pic mcu alternatives???
Post by: JanJansen on June 26, 2017, 01:48:25 pm
What is a fract to be exact ?, i always like improvements.

And yes some data i use in RAM, simple things, for the sinus i had problems,
the integer version gives -32768 to +32767, while i use -32767 to +32767 for multiplying & symmetric audio,
when using sinf( x ); i get some noise, i dont know why, i generate the LUTs in some software, then copy paste the code from the edit window.
Title: Re: Pic mcu alternatives???
Post by: JPortici on June 26, 2017, 02:35:51 pm
Fixed point fractional numbers. The difference from int is in how multiplications are handled. Standard type is 1Q15 which means it goes from -1.0 to 1.0 in 1/32768 steps.. multiplications results are always between -1.0 and 1.0

The dsp however can treat the 40bit accumulators as 9Q31, from -256.0 to 256.0 in 1/2^31 steps... this is to help you avoid overflow in sums without saturating arithmetic

Then to go back to 1Q31, 32 bit, you just (saturate and) discard the upper byte

To convert from - to int is istantaneous, the data doesn't change at all, it's just a matter of how it is displayed and how you handle multiplications/divisions

Why is it better for some tasks: your sine is from -1 to +1 at full volume. Your drawbar is set at 7. Instead of multiplying by 7 and dividing by 9* you just multiply by 0.77778

*you can also use a table of multipliers so that you multiply by it and just take the higher word of the result (e.g.: 65535×7/9) to avoid any other division, but using fract is more readable... and if you move to a dsp with an FPU you just change the data type from q15 to float
Title: Re: Pic mcu alternatives???
Post by: FrankBuss on June 26, 2017, 03:03:54 pm
That's why I really like a modern 32 bit CPU. Just buy a STM32F4, and you'll have integrated hardware floating point support, runs at 168 MHz and can do sin/cos calculation in realtime with 48 kHz samplerate and normal floats (4 byte single precision, I'v tested this, no problem). Nearly the same price as a dsPIC. And no crippled or non-standard compiler, the full power of GCC for ARM.
Title: Re: Pic mcu alternatives???
Post by: technix on June 26, 2017, 03:39:03 pm
That's why I really like a modern 32 bit CPU. Just buy a STM32F4, and you'll have integrated hardware floating point support, runs at 168 MHz and can do sin/cos calculation in realtime with 48 kHz samplerate and normal floats (4 byte single precision, I'v tested this, no problem). Nearly the same price as a dsPIC. And no crippled or non-standard compiler, the full power of GCC for ARM.
If you need even more speed (increased sample rate, channel count or complicated algorithm) you can step up to Allwinner V3s or Raspberry Pi Zero W. The former is much faster (Cortex-A7 @1.2GHz) but have a lot less RAM (64MB) and lacked a GPU. The latter is still fast (ARM1176JZF-S @1GHz,) have a lot more RAM (512MB for your LUTs) and have a GPU for your highly parallel math (like FFT.)

Since both have connectivity options (wired Ethernet for V3s, Wi-Fi for Raspberry Pi Zero W,) you can use it as a gateway streaming the data to another system for computing (e.g. a workstation with a dual Intel Xeon and dual GeForce GTX 1080 Ti, or a virtual machine on Amazon EC2 or DigitalOcean.)
Title: Re: Pic mcu alternatives???
Post by: JanJansen on June 26, 2017, 03:41:15 pm
JPortici i still dont get it : my sine is from -32767 to +32767, nothing with float,
for multiply i do : unsigned long l = i; l *= volume; l >>= SHIFT; nothing special.
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on June 26, 2017, 04:19:41 pm
Just buy a STM32F4 ... Nearly the same price as a dsPIC.

Of course, if you buy one, the difference between $3 and $10 is not important. If you buy dev boards instead of chips, there may be no difference whatsoever. However, just $20 more will buy you much better processor, and for just $100 more you can buy Zynq which leaves the STM32F4 in the dust. Why do you settle for STM32F4?
Title: Re: Pic mcu alternatives???
Post by: Scrts on June 26, 2017, 06:19:07 pm
That's why I really like a modern 32 bit CPU. Just buy a STM32F4, and you'll have integrated hardware floating point support, runs at 168 MHz and can do sin/cos calculation in realtime with 48 kHz samplerate and normal floats (4 byte single precision, I'v tested this, no problem). Nearly the same price as a dsPIC. And no crippled or non-standard compiler, the full power of GCC for ARM.
If you need even more speed (increased sample rate, channel count or complicated algorithm) you can step up to Allwinner V3s or Raspberry Pi Zero W. The former is much faster (Cortex-A7 @1.2GHz) but have a lot less RAM (64MB) and lacked a GPU. The latter is still fast (ARM1176JZF-S @1GHz,) have a lot more RAM (512MB for your LUTs) and have a GPU for your highly parallel math (like FFT.)

Since both have connectivity options (wired Ethernet for V3s, Wi-Fi for Raspberry Pi Zero W,) you can use it as a gateway streaming the data to another system for computing (e.g. a workstation with a dual Intel Xeon and dual GeForce GTX 1080 Ti, or a virtual machine on Amazon EC2 or DigitalOcean.)

Did you try to write application that would do FFT on GPU on RaspberryPi?
Title: Re: Pic mcu alternatives???
Post by: technix on June 26, 2017, 11:45:37 pm
That's why I really like a modern 32 bit CPU. Just buy a STM32F4, and you'll have integrated hardware floating point support, runs at 168 MHz and can do sin/cos calculation in realtime with 48 kHz samplerate and normal floats (4 byte single precision, I'v tested this, no problem). Nearly the same price as a dsPIC. And no crippled or non-standard compiler, the full power of GCC for ARM.
If you need even more speed (increased sample rate, channel count or complicated algorithm) you can step up to Allwinner V3s or Raspberry Pi Zero W. The former is much faster (Cortex-A7 @1.2GHz) but have a lot less RAM (64MB) and lacked a GPU. The latter is still fast (ARM1176JZF-S @1GHz,) have a lot more RAM (512MB for your LUTs) and have a GPU for your highly parallel math (like FFT.)

Since both have connectivity options (wired Ethernet for V3s, Wi-Fi for Raspberry Pi Zero W,) you can use it as a gateway streaming the data to another system for computing (e.g. a workstation with a dual Intel Xeon and dual GeForce GTX 1080 Ti, or a virtual machine on Amazon EC2 or DigitalOcean.)

Did you try to write application that would do FFT on GPU on RaspberryPi?
Raspberry Pi Foundation and Broadcom have released a GPU computing library, and FFT is one of the algorithms implemented in GPU. And there is a demo program that performs FFT in command line.
Title: Re: Pic mcu alternatives???
Post by: Scrts on June 27, 2017, 02:48:59 am
Ok so you didn't. What about Allwinner stuff?
Title: Re: Pic mcu alternatives???
Post by: technix on June 27, 2017, 08:03:37 am
Ok so you didn't. What about Allwinner stuff?
Allwinner chip does not have an built-in GPU so all computation have to be handled using the Cortex-A7 core. You just pick your favorite, fastest ARM implementation of whatever algorithm you are using. Or just stream the data off to another computer that have more beefy processors.
Title: Re: Pic mcu alternatives???
Post by: FrankBuss on June 27, 2017, 10:41:39 am
Of course, if you buy one, the difference between $3 and $10 is not important. If you buy dev boards instead of chips, there may be no difference whatsoever. However, just $20 more will buy you much better processor, and for just $100 more you can buy Zynq which leaves the STM32F4 in the dust. Why do you settle for STM32F4?

Maybe because I just used the STM32L433 for a project and I really like it :) Costs only EUR 5.21 in single quantities, and I tested it, needs only about 10 mA at 3.3V and when running with 48 MHz. And this chip has the same floating point hardware support than the STM32F4 series. BTW, the STM32F401 costs only EUR 5.42 in single quantities and runs up to 84 MHz.

If you use a Zynq, probably with Linux, or a Raspberry Pi with Linux, it can be more difficult to implement hard realtime or low latency applications. With a microcontroller it is easier to program more low-level.
Title: Re: Pic mcu alternatives???
Post by: JPortici on June 27, 2017, 12:31:20 pm
A pic32MZ can be about as cheap as that stm and run up to 250 MHz! Even faster.

The endless debate...
Title: Re: Pic mcu alternatives???
Post by: Scrts on June 27, 2017, 01:02:53 pm
Ok so you didn't. What about Allwinner stuff?
Allwinner chip does not have an built-in GPU so all computation have to be handled using the Cortex-A7 core. You just pick your favorite, fastest ARM implementation of whatever algorithm you are using. Or just stream the data off to another computer that have more beefy processors.

It's just pain to use those Allwinner or Broadcom processors. External RAM, etc... You can't run them bare metal. I am all the way of using simple ARM F-series where possible.
Title: Re: Pic mcu alternatives???
Post by: FrankBuss on June 27, 2017, 01:07:08 pm
A pic32MZ can be about as cheap as that stm and run up to 250 MHz! Even faster.

At Digikey the cheapest PIC32MZ costs EUR 7.21. But it runs at 200 MHz, and has even 64 bit floating point hardware, that's nice.
Title: Re: Pic mcu alternatives???
Post by: mikeselectricstuff on June 27, 2017, 02:04:33 pm

It's just pain to use those Allwinner or Broadcom processors. External RAM, etc... You can't run them bare metal. I am all the way of using simple ARM F-series where possible.
You can run ANY processor bare metal. It's just aboiut how much work you need to do to configure it, and what tools are available to help.
 If there is a Linux BSP, you should be able to extract the needed initialisation code from that.
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on June 27, 2017, 02:19:32 pm
If you use a Zynq, probably with Linux, or a Raspberry Pi with Linux, it can be more difficult to implement hard realtime or low latency applications. With a microcontroller it is easier to program more low-level.

Quite opposite. With Linux or not, Zynq will be much better at "hard realtime" than any MCU. Zynq's real-time is measured in picoseconds.

BTW: dsPIC is also better at real-time than similarly sized ARMs because it doesn't use cache or any time-disturbing technologies. For example, background DMA operations don't disturb CPU timing. Everything is 100% predictable - exactly what you want for better real-time.
Title: Re: Pic mcu alternatives???
Post by: Scrts on June 27, 2017, 02:49:19 pm

It's just pain to use those Allwinner or Broadcom processors. External RAM, etc... You can't run them bare metal. I am all the way of using simple ARM F-series where possible.
You can run ANY processor bare metal. It's just aboiut how much work you need to do to configure it, and what tools are available to help.
 If there is a Linux BSP, you should be able to extract the needed initialisation code from that.

You can. Did you try that? Never seen a sane man doing this. I see people proposing those Allwinner chips like it would be easy to write some sort of general-purpose applications on them, but the problem that it isn't. People never tried to do some simple stuff like reading ADC values or using interrupts and still propose the same stuff.
Title: Re: Pic mcu alternatives???
Post by: nctnico on June 27, 2017, 03:03:57 pm
If you use a Zynq, probably with Linux, or a Raspberry Pi with Linux, it can be more difficult to implement hard realtime or low latency applications. With a microcontroller it is easier to program more low-level.

Quite opposite. With Linux or not, Zynq will be much better at "hard realtime" than any MCU. Zynq's real-time is measured in picoseconds.
Not if you run the realtime process from software. Besides that many microcontrollers have DMA which gets you hardware defined realtime performance for reading/writing data to peripherals. And let's not forget PWM peripherals which can deal with overcurrent protection in hardware.
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on June 27, 2017, 03:23:42 pm
Quite opposite. With Linux or not, Zynq will be much better at "hard realtime" than any MCU. Zynq's real-time is measured in picoseconds.

Not if you run the realtime process from software.

To get the best real-time performance you run your processes in PL and control them from PS. But, of course, you're right - incompetent use can reduce any MCU to a piece of junk.
Title: Re: Pic mcu alternatives???
Post by: mikeselectricstuff on June 27, 2017, 03:41:36 pm

It's just pain to use those Allwinner or Broadcom processors. External RAM, etc... You can't run them bare metal. I am all the way of using simple ARM F-series where possible.
You can run ANY processor bare metal. It's just aboiut how much work you need to do to configure it, and what tools are available to help.
 If there is a Linux BSP, you should be able to extract the needed initialisation code from that.

You can. Did you try that? Never seen a sane man doing this. I see people proposing those Allwinner chips like it would be easy to write some sort of general-purpose applications on them, but the problem that it isn't. People never tried to do some simple stuff like reading ADC values or using interrupts and still propose the same stuff.
Is that just down to poor documentation though? or non-sensible default register values?
Just observing that nobody does it doesn't mean it's any harder than any other processor unless you can cite some specific reasons.
Title: Re: Pic mcu alternatives???
Post by: JPortici on June 27, 2017, 03:50:23 pm
A pic32MZ can be about as cheap as that stm and run up to 250 MHz! Even faster.

At Digikey the cheapest PIC32MZ costs EUR 7.21. But it runs at 200 MHz, and has even 64 bit floating point hardware, that's nice.
And simd instructions
I think M7 is a better comparison
Title: Re: Pic mcu alternatives???
Post by: alm on June 27, 2017, 04:26:41 pm
Is that just down to poor documentation though? or non-sensible default register values?
Just observing that nobody does it doesn't mean it's any harder than any other processor unless you can cite some specific reasons.
Not sure about the AllWinner, but I believe Broadcom is very reluctant to give you a full datasheet unless you are a large volume customer. No publicly available datasheets beyond basic pinout information last time I checked (which admittedly was a couple of years ago). Of course you could try to reverse-engineer it from the Linux code.
Title: Re: Pic mcu alternatives???
Post by: FrankBuss on June 27, 2017, 04:37:19 pm
Not sure about the AllWinner, but I believe Broadcom is very reluctant to give you a full datasheet unless you are a large volume customer. No publicly available datasheets beyond basic pinout information last time I checked (which admittedly was a couple of years ago). Of course you could try to reverse-engineer it from the Linux code.

They provide a lot more information (but not all)

https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf (https://www.raspberrypi.org/app/uploads/2012/02/BCM2835-ARM-Peripherals.pdf)

Even the GPU (VideoCore) is now public:

https://docs.broadcom.com/docs/12358545 (https://docs.broadcom.com/docs/12358545)

Would be nice if now someone implements OpenCL for it.
Title: Re: Pic mcu alternatives???
Post by: alm on June 27, 2017, 05:03:46 pm
That is a lot better than it used to be, but still seems not enough to create start-up code on bare metal. For example, I see nothing about setting up clocks, interrupt vectors, memory etc.
Title: Re: Pic mcu alternatives???
Post by: technix on June 28, 2017, 02:02:32 am
That is a lot better than it used to be, but still seems not enough to create start-up code on bare metal. For example, I see nothing about setting up clocks, interrupt vectors, memory etc.
Broadcom just assumes you will be using the Raspberry Pi hardware which comes in those startup code already programmed in the internal mask ROM. For the Pi the SD card is not loaded until the DRAM and clocks are already up.
Title: Re: Pic mcu alternatives???
Post by: westfw on June 30, 2017, 08:56:36 am
Quote
You can run ANY processor bare metal.
Some chips have their really low-level initialization details obscured in confidential/NDA documents.   Notably Intel CPUs.  I think there's a "BIOS Implementors Guide" that is red-cover-difficult to get your hands on.  (IIRC, "Red cover" means customers can only look at it when "escorted" by an Intel Rep.   There are Orange (You can have this if you promise to keep it under lock and key) and Yellow cover (you can have this but don't give it to anyone else.)  (I had access to some Yellow-cover documents at one point.  They really didn't seem to contain stuff that should have been subject to that level of protection.  (Perhaps they were pre-release?))

Of course, you can get pretty CLOSE to bare-metal programming using someone else's BIOS.
Title: Re: Pic mcu alternatives???
Post by: JanJansen on June 30, 2017, 02:14:15 pm
Test it!

It dont works, bah, no huge sinus table for the DSPIC.
Title: Re: Pic mcu alternatives???
Post by: JPortici on June 30, 2017, 02:59:17 pm
told ya.
granted, it can be done but there are more intelligent ways, like fitting the table in RAM with fewer points and interpolating between them.
Title: Re: Pic mcu alternatives???
Post by: technix on June 30, 2017, 05:09:28 pm
Test it!

It dont works, bah, no huge sinus table for the DSPIC.
How fast does it need to be? Maybe you can use an external ROM chip for the big LUTs, especially if your processor supports accessing SPI Flash using the normal address space.
Title: Re: Pic mcu alternatives???
Post by: JPortici on July 01, 2017, 07:01:51 am
i wouldn't.
at some point there is little gain in thd/aliasing between full 16bit 64k entry and fewer entries interpolated between them (even linearly)
especially if you have a big number of those sinewaves to be mixed together and you use fixed point math. dspic doesn't have hardware floating point, but 40bit (9Q31) fixed point.

let's say you don't do a full manual, "only" 64 sines total, 44 key keyboard.
you really need 64 phase accumulators with sligthly different tunings per octave or you end up with standing waves if you cheat and only use 12

each drawbar has to mix up to 44 sines and then you have to mix the (up to) 9 drawbars together

It's impressive if you manage to pull it off :) but i don't see it happening if you have to fetch randomly from flash each time (5 intructions cycles, plus the preparing) or from external memory

perhaps he has a different approach to this problem but this is how you'd have to do it with a single processor :)

just saying, HOAX: Hammond On A Xilinx (FPGA) :)
Title: Re: Pic mcu alternatives???
Post by: JanJansen on July 01, 2017, 04:33:40 pm
How fast does it need to be? Maybe you can use an external ROM chip for the big LUTs, especially if your processor supports accessing SPI Flash using the normal address space.

Thank you Technix, i was been thinking about that also,
thing is i need to get started with testing SPI someday, and i need a EPROM burner.
Good advice.
Title: Re: Pic mcu alternatives???
Post by: JanJansen on July 01, 2017, 04:36:33 pm
this is how you'd have to do it with a single processor :)

Yes, i really hope Microchip would release a modern version of this chip with stereo audio DAC, the DSPICFJ128GP802 is very old already.
I get currently 4 notes of polyphony, with 8 drawbars + autopan @ 44K1Hz.
With all tone-wheels derived from 2 base oscillators per voice.
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on July 01, 2017, 04:45:56 pm
Yes, i really hope Microchip would release a modern version of this chip with stereo audio DAC, the DSPICFJ128GP802 is very old already.

I think newer ones come with I2S instead of DAC - dsPIC33EPxxxxx8xx, assuming you would use I2S capable digital amplifier instead of analog one. World is changing from analog to digital :)
Title: Re: Pic mcu alternatives???
Post by: JanJansen on July 01, 2017, 04:51:56 pm
at some point there is little gain in thd/aliasing between full 16bit 64k entry and fewer entries interpolated between them (even linearly)

For the Hammond clone ok, i also like to do more things with this sine LUT.
I like to generate harmonics to create a saw, triangle or square waveform.

something like this :
Code: [Select]
long out;
out = sinus[ phase & MAX ]; // base partial

phase *= 2;
out += sinus[ phase & MAX ] / 2; // second harmonic

phase *= 3;
out += sinus[ phase & MAX ] / 3; // third harmonic

and so on until the Nyquist frequency is reached ( half the samplerate ).

out /= 2;
[\code]
Title: Re: Pic mcu alternatives???
Post by: JanJansen on July 01, 2017, 04:53:32 pm
I think newer ones come with I2S instead of DAC - dsPIC33EPxxxxx8xx, assuming you would use I2S capable digital amplifier instead of analog one. World is changing from analog to digital :)

I have a analog recording studio mixing table, i dont wanto buy extra expensive digital parts,
once i get going with SPI i will try SDM DAC with converter socket, only those DACS are more expensive then the complete chip with build in DAC together.
Title: Re: Pic mcu alternatives???
Post by: JPortici on July 02, 2017, 08:33:02 am
this is how you'd have to do it with a single processor :)

Yes, i really hope Microchip would release a modern version of this chip with stereo audio DAC, the DSPICFJ128GP802 is very old already.
I get currently 4 notes of polyphony, with 8 drawbars + autopan @ 44K1Hz.
With all tone-wheels derived from 2 base oscillators per voice.

nice :)

You pic has DMA and probably also SPI in framed mode.. I read somewhere that it could mimick I2S in left/right mode

i feel you on this dspic is old i wish it would be updated... i'm in the very same situation but with another dspic with another specialty peripheral :(

i hope microchip isn't planning to stop the 16 bit line, it's the one i use the most both at work and at home.. Local microchip rep assure me they won't be made obsolete but still..

anyway they _are_ releasing new chips, GS series is a beast for digital SMPS controller and they just put out a digital SMPS controller which has a very simillar pinout and peripherals ;) (i suspect this dspic with a mask rom)

may i suggest you upgrade this dspic to a 33EP part? even though you gain one cycle latency for RAM, 2 for ROM and jumps.. core can run at 70 MIPS. This, with some new instructions optimized for loop and DSP instruction that do dual data fetch you could probably gain a few more vouces :)
Title: Re: Pic mcu alternatives???
Post by: technix on July 02, 2017, 03:20:35 pm
this is how you'd have to do it with a single processor :)

Yes, i really hope Microchip would release a modern version of this chip with stereo audio DAC, the DSPICFJ128GP802 is very old already.
I get currently 4 notes of polyphony, with 8 drawbars + autopan @ 44K1Hz.
With all tone-wheels derived from 2 base oscillators per voice.

nice :)

You pic has DMA and probably also SPI in framed mode.. I read somewhere that it could mimick I2S in left/right mode

i feel you on this dspic is old i wish it would be updated... i'm in the very same situation but with another dspic with another specialty peripheral :(

i hope microchip isn't planning to stop the 16 bit line, it's the one i use the most both at work and at home.. Local microchip rep assure me they won't be made obsolete but still..

anyway they _are_ releasing new chips, GS series is a beast for digital SMPS controller and they just put out a digital SMPS controller which has a very simillar pinout and peripherals ;) (i suspect this dspic with a mask rom)

may i suggest you upgrade this dspic to a 33EP part? even though you gain one cycle latency for RAM, 2 for ROM and jumps.. core can run at 70 MIPS. This, with some new instructions optimized for loop and DSP instruction that do dual data fetch you could probably gain a few more vouces :)
I am not familiar with the PICs, but if you are switching MCUs you can try have a look into the STM32F4 series - like STM32F405RGT6. That chip have native I2S, FPU, 168MHz operation and 1MB built-in Flash. If 1MB is not enough for your LUT you can step up to STM32F427VIT6 (2MB Flash) or STM32F429ZGT6 (1MB Flash, bigger package to allow the use of an external SDRAM chip.)

With SDRAM added to the chip you don't need a lot of Flash space any more - you can program just a bootloader into the 1MB Flash, that initializes the SDRAM and uncompresses (or copies) the actual application code with LUT from external SPI Flash into SDRAM. The STM32F429ZGT6 chip supports 2 sets of 4-bank 13-bit address 16-bit data SDRAM chips - that makes up to 1GB of SDRAM space.
Title: Re: Pic mcu alternatives???
Post by: JanJansen on July 02, 2017, 03:39:23 pm
I only use DIP packages, this one has build in audio DAC for around €5, other chips need DAC that is more expensive.
Title: Re: Pic mcu alternatives???
Post by: FrankBuss on July 02, 2017, 11:11:41 pm
I only use DIP packages

This will restrict you a lot. For me it is easier to solder TQFP than using DIP chips, and you can use it on a breadboard with an adapter (cheap at eBay). But with services like [https://oshpark.com]OSH Park[/url] and seeedstudio (https://www.seeedstudio.com/fusion_pcb.html) it is really cheap to create a professional board for your application with all required parts, even for prototyping, if you place some strategically pin headers.

My latest breakout board for a STM32L433, a NRF51822 bluetooth module and some pin headers for various ePaper displays:

(https://cdn.hackaday.io/images/9184651497818532038.jpg)

Smaller than 10 cm x 10 cm, so costs $0.49 per board (minimum 10 boards) at seeedstudio.
Title: Re: Pic mcu alternatives???
Post by: FrankBuss on July 02, 2017, 11:29:54 pm
You don't need a concave shaped tip, there are good Youtube videos about it, Dave did one recently:

https://www.youtube.com/watch?v=hoLf8gvvXXU (https://www.youtube.com/watch?v=hoLf8gvvXXU)

Pin pitch doesn't matter. The trick is not to use too much solder, lots of flux, and if there is a bridge, it is easy to fix it with solder wick.
Title: Re: Pic mcu alternatives???
Post by: FrankBuss on July 03, 2017, 01:08:39 am
In KiCAD there are hand solder version of most packages, with longer pads. If you use the default pads, which are perfect for reflow soldering, it can be difficult to solder it by hand.
Title: Re: Pic mcu alternatives???
Post by: technix on July 03, 2017, 01:12:31 am
For me it is easier to solder TQFP than using DIP chips, and you can use it on a breadboard with an adapter (cheap at eBay).

Mind let me know how do you manage to solder TQFP parts? I solder down to 0402/0.5mm BGA/0.4mm QFN without problems, due to self alignment and shorter (practically zero) pin length (allows nowhere for bridging to happen).
When I solder TSSOP/TQFP chips, bridging happens all the time. I know a concave shaped hoof tips will help, but Metcal doesn't have such tips.
Lots of flux.

I drag solder QFP packages a lot. It is normal to have solder bridges after the first pass, but it can be fixed with a big chisel tip that sucks the solder away with a lot of flux.
Title: Re: Pic mcu alternatives???
Post by: Elf on July 03, 2017, 02:56:42 am
This will restrict you a lot. For me it is easier to solder TQFP than using DIP chips, and you can use it on a breadboard with an adapter (cheap at eBay).
I agree; most of the parts I want to use these days only come in surface mount. So I just went all in and set myself up for it.

Here are some bad cellphone photos of what I was working on today:
Soldered only using a Hakko FX-888D with chisel tip, and solder wick:
(http://i.imgur.com/N0ZU1kh.jpg)

Fresh out of the reflow oven, with more through-hole parts added manually:
(http://i.imgur.com/xd1sX1n.jpg)

The oven is great; it is a ControLeo2 (http://www.whizoo.com/reflowoven) built on a $32 toaster oven (https://www.amazon.com/gp/product/B00C7EPBK6/). Total cost was somewhere around $250 plus a few evenings of time. Some care when building it and it met the profile on the first learning cycle, and has worked without issue.

I also have a hot air station, etc. but again, it is possible to get started with just a basic soldering iron. In any case I think if one prepares well there is no reason to shy away from surface mount. Even if only to make boards to break out modules to DIP for breadboarding. But I usually just go straight to PCB and keep multiple projects up in the air so that the ~2 week turnaround doesn't get to me.
Title: Re: Pic mcu alternatives???
Post by: westfw on July 03, 2017, 03:00:50 am
Quote
I solder down to 0402/0.5mm BGA/0.4mm QFN without problems, due to self alignment and shorter (practically zero) pin length (allows nowhere for bridging to happen).

So I have a board with a 48pin QFN, that I was going to solder with "smear on some paste, place chip, heat on a hotplate, and let wicking and surface tension do all the hard work" method.  But after looking at the actual board, and doing some actual experiments with the "smear paste" method on simpler components, I'm starting to have some doubts (especially give the lack of inspectability of a QFN.)

Any advice?  It seems that most of the video tutorials suggest reflowing the solder on to the pads as a separate step BEFORE placing the chip (smear flux/paste, melt, cool, smear more flux, place chip, heat again...)  That seems like it would probably help.  yes? no?
Title: Re: Pic mcu alternatives???
Post by: NorthGuy on July 03, 2017, 03:10:39 am
For me it is easier to solder TQFP than using DIP chips, and you can use it on a breadboard with an adapter (cheap at eBay).

I 100% agree. Pin-for-pin, TQFP is much faster to solder than DIP. Not to mention that you can save lots of money on board size because you will need much smaller PCB, which are also easier to work with. I have just ordered a breadboard adapter for PIC32MZ DA from OshPark with Internet, USB and LCD headers, and it was only $40 for 3 4-layers boards. Size matters!
Title: Re: Pic mcu alternatives???
Post by: Sal Ammoniac on July 03, 2017, 06:04:36 am
I know a concave shaped hoof tips will help, but Metcal doesn't have such tips.

They do. http://www.okinternational.com/metcal/english/globalnavigation/products/hand-soldering-systems/tips-and-cartridges/mx-cartridges/smtc-series-hoof (http://www.okinternational.com/metcal/english/globalnavigation/products/hand-soldering-systems/tips-and-cartridges/mx-cartridges/smtc-series-hoof)