PIC/dsPIC development

I might have to work on a project involving dsPIC code which I don't have a lot of experience with, I'm primarily an AVR and ARM guy.

What's the hip current toolchains/dev boards y'all like to use for PIC development on Linux or Windows desktops nowatimes?

Reply to
bitrex
Loading thread data ...

bitrex wrote

Dunno what a 'ds'PIC is I only program PICs (12F 16F 18F) in asm. For that I use gpasm in Linux (is part of gputils).

Designed my own programmer (based on noppp by somebody else), and wrote my own programming software, that is in my site. I do not use Microchip mplab, I do not use ice, I do not use any other slimulator. I debug via the PIC's serial port, and if it does not have one write a soft one in ... PIC asm.

Does this help?

Over time you build a library of fast asm, there is the piclist website too where you can find many asm code examples.

The PICs I use are too small or impractical for any C programming. Sometimes I write the code in C on the PC and if that works translate it into 32 bits asm. Normally floating point is not needed, 32 bits is enough for most purposes, I use a 32 bit asm math library from somebody I found on PICLIST.

But then I started coding in binary long time ago, so for me asm is a high level language. I started with PICs cracking TV smartcards that had those in it. So the dirty secrets I should know... Was still legal back then.

It is actually fun. PIC asm, and I do not even claim I know the whole 16F instruction set. Have fear?

formatting link
todays code. Its working, just tested it...

More PIC asm examples here:

formatting link

grin

Reply to
<698839253X6D445TD

Oh sweet heavens...

good grief.

Reply to
bitrex

Mplab, unless you perfer some GNu. I never had a problem with 8.x (8 bit). Mplab X is C90/C99 and some things don't port over directly. If you use the Code Configurator, be sure you check to see if the device is supported, older devices are not. I'm sure the 32 bit dspic compilier has similar quirks.

So if you inherit a project in 8.x, You'll need Win7 and ICD3 Otherwise MplabX and ICD4.

Cheers

Reply to
Martin Riddle

MPLAB-X with their compiler XC-16. It's a bit greedy with resources but oka y on a modern machine. There is a free version with no optimization. I am n ot sure how well the DSP functionality is supported by the compiler, we jus t used it as a relatively fast 16-bit micro.

The compiler is $995 but there is a 50% off discount coupon good to the end of this month. Use Coupon Code : TP1932

This family is a bit long in the tooth, but if your customer wants it..

--Spehro Pefhany

Reply to
speff

Got it, thanks!

Reply to
bitrex

I wonder how much of a future 8-bit AVR has, unfortunately. I love 'em and use the ATTiny series all the time, they're IMO a significantly superior architecture wrt high-level C/C++ development than PIC. My time from concept to working prototype on breadboard is astonishingly low, sometimes just tens of minutes.

But 8-bit PIC beats them on the long-term availability/support/"legacy" front. And 32 bit ARM is coming down in price and power consumption all the time, also astonishingly so.

Reply to
bitrex

I see a lot of requests on freelance sites, etc. for assistance maintain/debugging/future-proofing PIC code. I see very few requests for maintenance or debugging of "legacy" 8 bit AVR code.

Maybe like the Maytag repairman they just worked right first time and didn't need any further assistance, most of my AVR projects are like that nowatimes. ;)

Reply to
bitrex

Did you look at:

formatting link

I've used some of their other development boards. Not keen on their compilers, but they do work. (Just not what I'm used to.) Some of their dev boards can double as programmers, which is a nice perk.

Reply to
mpm

Thanks, those dev boards do look good not at all expensive. So apparently there's no particularly good option for an optimizing C compiler plugged into 3rd party tools e.g. Code Blocks, or Eclipse et. al. for the platform?

Reply to
bitrex

Or rather one that costs sub $1000 or $500. $500 not unreasonable for a good closed-source optimizing C compiler if I'm going to end up doing development for this platform routinely but more so for a one-off job.

Reply to
bitrex

Posted too soon, sorry, the dsPIC C compiler from them is only $250. That's not bad.

Reply to
bitrex

I think it's free... as long as you don't go over 2K of source. That may be barely enough to do anything useful, but at least it lets you kick the tires before you commit.

Reply to
mpm

Got it, so the good "trial" options on the PIC front appear to be that one which is an optimizing(?) compiler but with a 2K source limit or the freeware MPLAB non-optimizing variant.

Should be enough to start getting myself in trouble with :)

Reply to
bitrex

okay on a modern machine. There is a free version with no optimization. I am not sure how well the DSP functionality is supported by the compiler, we just used it as a relatively fast 16-bit micro.

end of this month. Use Coupon Code : TP1932

That may well be more about the people doing the design than anything inher ent in the design process. The people I've met who like PICs seem to do so just because they "like" them rather than being able to explain any partic ular features or benefits of the PICs.

While devices like the AVR often are justified because of a "modern" instru ction set (which is not really an engineering evaluation) advocates can usu ally point to some real advantages.

I'm not saying the PICs don't have advantages. I'm saying that when advoca tes can't justify their preference it makes me suspect other aspects of the ir work.

Rick C.

Reply to
gnuarm.deletethisbit

You might try the free JALV2,

formatting link
It covers most PICs, dunno about dsPIC. It's high-level, somewhat similar to Pascal, with lots of libraries. It has a quite large user-base and a Yahoo forum.

I use a PIckit3, but most any old ICSP programmer should be good to push the hexcode.

Yngve.

Reply to
Yngve Dahlstr?m

(AFAIK, the dsPIC is a very different architecture from the traditional PIC14/PIC16/PIC18.)

PIC microcontrollers are horrible to use and program, but their long-term availability is unrivalled. They are also incredibly robust. (We once had a customer who wanted help improving the temperature range of their board. It ran fine up to 135 C, but they wanted to get to 150 C. It turned out that the board had an 85 C qualified PIC on board - but that was not the problem, and was quite happy at 150 C.)

AVR's are not going away any time soon, but they might be getting more specialised. They are extremely popular in ASICs and custom chips - that was Atmel's main business, I believe.

Reply to
David Brown

bitrex wrote

Just lighting a LED can be done with one resistor too.

Reply to
<698839253X6D445TD

It is because of a zilion pics versus 1 avr sort of thing. And PICs were (are?) very popular by 'amateur' programmers. Those have questions, many real programmers too, good help. These days it is 'duinos, and moving towards 'berries.

If your application has any serious I/O to the world including internet, WiFi, USB, keyboard and monitor etc, raspis are the way to go now.

I just configured an old raspi as 4G access point for my LAN,

4G USB stick in it, 10 lines of code, bash script that is.
formatting link
canceled my cable subscription and save loads of $$$$$ a year. So far I found no difference in performance / speed, even youtube works.
formatting link
Lots of I/O via GPIO.

Only for things that need very small space and / or very low power consumption maybe a PIC. Or for fun.

Reply to
<698839253X6D445TD

What a ripoff, for that money you buy many arduinos or raspberries and program in C with gcc.

There are many other micros that do support gcc, have an instruction set that is optimized for C, and that was already 18 years ago.

That 995$ reminds me when Intel was asking similar money for the first 8051 or what was it assembler, promptly wrote my own assembler for it.

And all that (995 $) because you are too lazy to learn asm ... LOL You will have to read the datasheet anyways and learn the idiotic crippled C they present you. Or buy a trs80 and program in forth.

No wonder bloat rules. It sells.

;-)

Reply to
<698839253X6D445TD

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.