doubts about PIC microcontrollers

Discussion in 'General Electronics Chat' started by adam555, Aug 8, 2014.

  1. adam555

    Thread Starter Active Member

    Aug 17, 2013
    858
    39
    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.
     
  2. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,386
    496
    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.
     
  3. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    So do I :)

    Its there forever. Or until the flash memory goes kuput. But it should last for years and years.

    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.
     
  4. adam555

    Thread Starter Active Member

    Aug 17, 2013
    858
    39
    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?
     
  5. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    Nope. I wouldn't hesitate using a PIC in a commercial product.
     
  6. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,515
    2,369
    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.
     
  7. adam555

    Thread Starter Active Member

    Aug 17, 2013
    858
    39
    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?
     
  8. adam555

    Thread Starter Active Member

    Aug 17, 2013
    858
    39
    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...
     
  9. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,386
    496
    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.
     
  10. Brownout

    Well-Known Member

    Jan 10, 2012
    2,375
    998
    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.
     
  11. GopherT

    AAC Fanatic!

    Nov 23, 2012
    6,004
    3,761
    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.
     
  12. adam555

    Thread Starter Active Member

    Aug 17, 2013
    858
    39
    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: Aug 9, 2014
  13. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,386
    496
    Arduino uses ATmel chips. Sounds like you will need ATmel chips. PIC is not ATmel chip.
     
  14. adam555

    Thread Starter Active Member

    Aug 17, 2013
    858
    39
    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.
     
  15. NorthGuy

    Active Member

    Jun 28, 2014
    603
    121
    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.
     
  16. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,386
    1,605
    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.
     
  17. MrAl

    Well-Known Member

    Jun 17, 2014
    2,425
    490
    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.
     
  18. atferrari

    AAC Fanatic!

    Jan 6, 2004
    2,648
    761
    That, IIRC, could be refreshed somehow.
     
  19. adam555

    Thread Starter Active Member

    Aug 17, 2013
    858
    39
    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.

    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.

    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.

    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. :)
     
  20. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,386
    496
    [​IMG]
     
Loading...