doubts about PIC microcontrollers

Thread Starter

adam555

Joined Aug 17, 2013
858
Hi, I have a couple of doubts regarding PIC microcontrollers.

Is the program stored on the PIC forever; or can it be deleted over time or by accident?

Are there PICs that connect directly to a computer via USB using a COM port (as an Arduino board), or do I need an additional IC for this?

That's all... Thanks in advance.
 

shteii01

Joined Feb 19, 2010
4,644
Arduino boards that I worked with and looked at have separate chip that does USB. So when you buy Arduino board you are buying two or more chips, one of them is microcontroller and second chip for USB communications.
 

Brownout

Joined Jan 10, 2012
2,390
Hi, I have a couple of doubts regarding PIC microcontrollers.
So do I :)

Is the program stored on the PIC forever; or can it be deleted over time or by accident?
Its there forever. Or until the flash memory goes kuput. But it should last for years and years.

Are there PICs that connect directly to a computer via USB using a COM port (as an Arduino board), or do I need an additional IC for this?
Yes, definitely. You can connect to a PC using the UART or USB. You need to have a PIC that contains those interfaces. I also connect with SPI and I2C.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
Great... I was doubting if a PIC was the right choice for my project.

Apart from those issues, and now that I know that the data should be stored forever, and that I can get PICs with COM ports for direct USB connection: does anyone has any good reason why I shouldn't use PICs on a device that I intend to sale?
 

MaxHeadRoom

Joined Jul 18, 2013
28,576
If the interface is 5v standard you can go direct, if RS232 or RS485 then you need the transition chip also, the MAX232 does the RS232.
Max.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
It's the +5V from a computer's USB port.

I guess I need to buy... well, I don't know how it's call... the board to program the PIC first; or can I program them directly if they come with the COM port?
 

shteii01

Joined Feb 19, 2010
4,644
Imagine that the sales are great; would it be right to continue using PICs, or can I get cheaper ICs already programmed?

I mean, how do real companies do it...
Keep in mind that other people can buy your product and download your program from the PIC. You need PIC that you can program, sell, and that other people can not download your program from once they bought the PIC from you.
 

Brownout

Joined Jan 10, 2012
2,390
Imagine that the sales are great; would it be right to continue using PICs, or can I get cheaper ICs already programmed?

I mean, how do real companies do it...
I dunno...I thought PICs were pretty cheap. If you want a cheaper Uc, then why even start with a PIC. Start with the Uc you intend to use in your product.
 

GopherT

Joined Nov 23, 2012
8,009
Once your product is designed and debugged. You can send the code to Microchip and they can send you a case of chips with your firmware already loaded on the chips. They can also lock the chip so it cannot be reprogrammed. I think they can also lock the chip to prevent anyone from duplicating the firmware (to some degree - not completely fool proof.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
Thank you so much.

I was asking about alternatives to the PIC because it all depends on the volume of sales: if I'm just going to sell 3 devices a month, there would be no point ordering a box of hundreds of ICs already programmed and locked.

I was actually planning it with 3 changes involved: first the prototype in Arduino -which is almost ready-; then pass it to cheaper PICs and make it all pretty for sale; and if everything goes well, then order the programmed ICs -which I guess for a given volume are even cheaper than the PICs-.
 
Last edited:

shteii01

Joined Feb 19, 2010
4,644
Thank you so much.

I was asking about alternatives to the PIC because it all depends on the volume of sales: if I'm just going to sell 3 devices a month, there would be no point ordering a box of hundreds of ICs already programmed and locked.

I was actually planning it with 3 changes involves: first the prototype in Arduino -which is almost ready-; then pass it to cheaper PICs and make it all pretty for sale; and if everything goes well, then order the programmed ICs -which I guess for a given volume are even cheaper than the PICs-.
Arduino uses ATmel chips. Sounds like you will need ATmel chips. PIC is not ATmel chip.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
Arduino uses ATmel chips. Sounds like you will need ATmel chips. PIC is not ATmel chip.
Yes, I got the bad habit of calling them all PIC.

But why are you saying it, because of the programming? I don't think that will be a problem, the code is quite simple.

I'll go for the cheapest that gives me the minimum requirements I need.
 

NorthGuy

Joined Jun 28, 2014
611
Unlike Arduino, you'll need a PCB to mount your PIC on. Then you'll need soldering, assembly, connectors, cases. Saving few cents on MCU is the least of your worries.

That said, I don't think anything can beat PICs pricewise on the low end.
 

ErnieM

Joined Apr 24, 2011
8,377
I see a few fine points going awry here. Since I've used PICs in several products...

You can either buy per-programmed chips or program them yourself. While Microchip can and will do the programming many major vendors such as Digh Key will also do programming, and simple marking too such as a colored dot.

However my preferred way is to program them in house. All that is needed is five pins (or even simple thru holes) one can connect a programmer to. Thus any changes made today can be inside the production units today.

Code locking so it cannot be read out is done when the device is programmed. You vcan do it yourself if you wish.
 

MrAl

Joined Jun 17, 2014
11,342
Hi,

Some points to think about...

1. Many PIC's can be locked with the programming software, which probably makes it impossible to read with just software. If the chip is disassembled by a real pro however, the program can be extracted. This is probably true of any chip though.

2. Almost all PIC's can interface with RS232 pretty easy, and the higher end chips can interface with USB. With RS232 you can also use an RS232 to USB converter module to make an RS232 project interface with USB.
For just RS232, you can bit bang the really low end series chips, and the slightly higher end chips have a port built into the chip as a peripheral.

3. Data retention over long time periods is getting better. It's now around 30 to 40 years at 85 degrees C i think for the program memory, and maybe less for the EEPROM. But check the data sheet specs for a more accurate estimate because this could change year to year.

4. The on board RC oscillator can be calibrated and it stays pretty well calibrated, at least in my experience with these chips. This means many applications wont need an external crystal. RTC clocks still need an accurate tic source however.
 

Thread Starter

adam555

Joined Aug 17, 2013
858
Unlike Arduino, you'll need a PCB to mount your PIC on. Then you'll need soldering, assembly, connectors, cases. Saving few cents on MCU is the least of your worries.

That said, I don't think anything can beat PICs pricewise on the low end.
You can either buy per-programmed chips or program them yourself. While Microchip can and will do the programming many major vendors such as Digh Key will also do programming, and simple marking too such as a colored dot.
I guess it will all come down to the number of ICs I'll need; once I know that I'll also have to consider the costs of shipment, and whether or not each seller can also provide me with other components at good price.

Code locking so it cannot be read out is done when the device is programmed. You vcan do it yourself if you wish.
1. Many PIC's can be locked with the programming software, which probably makes it impossible to read with just software. If the chip is disassembled by a real pro however, the program can be extracted. This is probably true of any chip though.

3. Data retention over long time periods is getting better. It's now around 30 to 40 years at 85 degrees C i think for the program memory, and maybe less for the EEPROM. But check the data sheet specs for a more accurate estimate because this could change year to year.
Having users read the code is not one of my worries; but whether or not the could could be erase over time or by accident.

2. Almost all PIC's can interface with RS232 pretty easy, and the higher end chips can interface with USB. With RS232 you can also use an RS232 to USB converter module to make an RS232 project interface with USB. For just RS232, you can bit bang the really low end series chips, and the slightly higher end chips have a port built into the chip as a peripheral.
Once I'm finished testing it with Arduino I'll start testing all these options; starting with the easiest to design, and than aiming towards driving the costs down as much as possible.

I guess that the higher end chips with USB interface will be my starting point.

4. The on board RC oscillator can be calibrated and it stays pretty well calibrated, at least in my experience with these chips. This means many applications wont need an external crystal. RTC clocks still need an accurate tic source however.
I'm not sure what's all this; I never used a microcontroller before, apart from Arduino. Though I guess this has to do with frequency at which the program will run and the connection bauds...

I'll definitely have to learn all this along the way... which rather drives me more than making any money. :)
 
Top