PIC development on Linux

Is anyone in the group doing PIC development on Linux?

I've got a project that really demands a sort of turbocharged 555, for which a PIC 10xxx or 12xxx would be perfect. I'm pretty sure it's small enough that it's sensible to write it entirely in assembly, or possibly in just a few lines of C.

This is for a short-run product, so I not only need to know how to do development, but information on device programmers that do a "production ready" job would be nice, too.

TIA.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com
Reply to
Tim Wescott
Loading thread data ...

I did one thing with the MPLAB IDE and PICkit3, running from Ubuntu 10.04. No complications as I recall, I just installed it and it did what it does.

Mel.

Reply to
Mel Wilson

HOLY CRAP! Microchip supports Linux! Woo hoo!

(Yes, I shoulda looked -- assume, Ass out of U and Me, etc.)

To quote Rosanne Rosannadana -- never mind!

And thank you for stating the obvious to me. Sometimes that's what we need.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com
Reply to
Tim Wescott

A long time coming, but it's here now. And remember XKCD: whenever you assert something you make an ass of the Emergency Response Team.

Mel.

Reply to
Mel Wilson

I think the low end AVR8's are more popular in some circles. There are some FOSS Linux tools around for them. I like the tiny packages and have never understood why they don't put more powerful cpus in packages like that. I'm not sure about the programming hardware.

Data:

formatting link

If you don't mind a bigger part, the TI MSP430 Launchpad board can program the Value Line DIP16/DIP20 processors and it's crazy cheap. They sold them for $4.30 for a long time though they're around $10 now.

Reply to
Paul Rubin

I looked in the DigiKey catalog for microprocessors and sorted by price. The PIC parts are at the absolute bottom of the list, and $0.40/each, qty

  1. The next-cheapest is an STM8 for half again as much. And they're available in SOT-23-6 packages, which is about as small as I'll ever need.

From a hardware designer's perspective, the PIC is a lot sweeter than the Atmel, too -- not that I need it here, but the PIC can drive something like five times as much current per pin as the Atmel.

Does anyone know if Atmel is better at delivery than they were a few years ago? I know they had a pretty bad rep, but then they changed management around 08 or so.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com
Reply to
Tim Wescott

I figured in a short run product, saving a few hours of engineering would matter more than a few cents difference in parts costs, but ok.

Interesting and worth knowing about, thanks.

Looks like distributors like Digikey and Mouser have plenty in stock.

Reply to
Paul Rubin

It's a short-run HOBBY project, so I can be an unreasonable tight wad if I want to. But yes, that's a good point.

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com
Reply to
Tim Wescott

Hi,

I used SDCC and PK2CMD for PIC18F on LINUX and it worked well enough for small sized projects. For code instance, you can refer to:

formatting link

Then, I used the MPLABX toolchain. I think this is the way to go for MICROCHIP devices.

--------------------------------------- Posted through

formatting link

Reply to
texane

I never really thought of PIC's as being "perfect" for any job - it's a great many years since I happily said goodbye to them. There are lots of small micros for incredibly low prices - you can even get a Cortex M0+ device for under half a dollar, or AVR ATTINY devices at even less. So unless you are using tens of thousands of these devices, PIC's don't make any sort of economic sense.

If you are looking for something more fun, try "greenpak" devices from . They should fit the bill for a "turbocharged

555", and are very cheap. I haven't tried them myself - I'm still looking for an excuse to play with them.
Reply to
David Brown

If your project grows to more than just a few to the 50s or 100s look at having Microchip program them for you. I did this a few years ago. Granted my device was probably a lot larger than what you are planning to use but it saved me a lot of time. You can order directly from Microchip, buy.microchip.com (also a good place to look if the distributor is out of stock or does not carry the package you want)

--
Chisolm 
Republic of Texas
Reply to
Joe Chisolm

I understand that DigiKey is an expensive place to buy electronics (but oh, the convenience!). The cheapest Cortex M0 part they have in qty 10 is $1.05 (a Freescale MKL02Z8VFG4), going down to $0.80 in qty 500, while the cheapest microcontroller they have (PIC10F200T-I/OT) is $0.40 in qty

10, going down to $0.35 in qty 100.

Maybe if I were buying 10000 at a time, straight from the factory, I could get a half-dollar M0+. But I'm not, and I don't think I can.

(I may go with the M0 part anyway, if I can still meet my BOM-cost goals.)

--

Tim Wescott 
Wescott Design Services 
http://www.wescottdesign.com
Reply to
Tim Wescott

The point is, if you are buying in quantities of 10, who cares if it is $1 or $0.50 per part? Why do you care if it is $20 per part? The time you spend looking up different prices on digikey and reading the datasheets of the different chips is worth far more than all the microcontrollers put together - even if they are $20 each.

If you can sell your time at $100 per hour, and using a real microcontroller rather than a PIC saves you 2 days work, then you are better off buying $1 Cortex M0 rather than $0.40 PIC's even if you are making 2500 boards.

Do the maths, and figure this out. Quibbling about cents for the critical component does not make economic sense unless you are a starving student or making hundreds of thousands of devices. Even if you are doing this for fun and not getting paid, your time is still worth more than these chips.

Reply to
David Brown

The elephant in this room is the software. You'll burn more time trying to figure out why it doesn't work, becaues you didn't notice that page 397 of the datasheet says you have to set bit 17 of RTIMFLG0 at least 119us before you clear bit 23 of GLCPLOP, otherwise the data will be incorrectly latched/lost/set on fire. Or that erratum note #294322 on the website points out that they forgot to mention in the datasheet and marketing material that the first serial port has never actually worked.

So far I haven't got a good handle on whose architecture is least prone to these kinds of fiddly details. Some of them try to mask it with config software generation - I'm uncertain how well they manage it.

Theo

Reply to
Theo Markettos

That is absolutely true - and again shows why fussing about the price of sub-dollar parts is irrelevant here. (Of course this concerns only the complicated parts such as the microcontroller - shaving cents off the price of resistors, LEDs, etc., is often worth the effort.) Development time is a far bigger cost than the stock of microcontrollers.

Reliability of the parts, development tools, familiarity and experience of the developers are all vital. The PICs have a good reputation for reliability, and few issues with weird errata (AFAIK), but they are a mess to program. With a Cortex chip, you can use a proper compiler, write normal C (or C++), and have a selection of quality development tools. And since the OP is familiar with Cortex development, that familiarity alone will make the difference.

Reply to
David Brown

I did some in the previous century. From the Makefile I can tell that I was using gpasm. Unfortunately I don't have it (gputils) installed on my current Linux system, but it's available on sourceforge.

For more professional work I did ISP through the devices connected to the PIC (FPGA/JTAG). For some of my hobby projects I used the NOPPP (No parts pic programmer) with the programmer running on Linux.

//Petter

--
.sig removed by request.
Reply to
Petter Gustad

But design effort cuts both ways in short runs. If you're making three of a circuit that has a low chip count then the ability to put it on stripboard can save a decent of board design work as well as time and/or expense getting those boards fabricated. 5V and 0.1" pitch through hole are still very desirable for that kind of situation. PICs are very amenable in that regard since they're available in DIP from PIC10 all the way up to the more capable PIC18 units. ARM isn't anywhere near as convenient.

--
Andrew Smallshaw 
andrews@sdf.lonestar.org
Reply to
Andrew Smallshaw

+1 for gpasm. Persoanlly I've had far less trouble with it inthe past than MPASM which has had me tearing my hair out with unnecessary silliness in the past.

One issue that comes to mind are an absurdly short limit on the absolute pathname of any input file - it was raised in one revision perhaps five years ago, but even that raised limit was still too low. Come on, this is pure amateurism. Another was that you can't hang a label on a macro invocation. Personally I can't see any legitimate reason for that to be the case other than pure idleness.

Two isolated examples to be sure, but they create an impression of a toy rather than a tool to rely on. Gpasm has no such silliness.

--
Andrew Smallshaw 
andrews@sdf.lonestar.org
Reply to
Andrew Smallshaw

OTOH, I was attracted back to PIC by application note AN1298, describing a way to do capacitive touch-sensing with practically nothing, and that was ideal for a particular project. The whole PIC application was programmed and tested with about the same level of effort that it took to get the clocks set up on a Cortex, as I saw when I started looking at doing the port. IMHO, Cortex is a high-effort architecture, and I want to see a corresponding return before I approach it. The Cortex port will be worth it if it manages to also replace the other controller that runs beside the PIC.

Mel.

Reply to
Mel Wilson

There are even 16 bit PIC24F and dsPIC30F devices in DIP packages that run at 5V. There's 17 to choose from in packages fom 18 to 40 pins.

The XC8 and XC16 compilers for the 8 and 16 bit PIC families are usable in free mode (althogh most optimizations are disabled) and are even legal to use commercially.

--
Ian Malcolm.   London, ENGLAND.  (NEWSGROUP REPLY PREFERRED)  
ianm[at]the[dash]malcolms[dot]freeserve[dot]co[dot]uk  
[at]=@, [dash]=- & [dot]=. *Warning* HTML & >32K emails --> NUL
Reply to
Ian Malcolm

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.