Bootloader question


Closed Thread
Results 1 to 17 of 17
  1. #1
    gzorzi's Avatar
    gzorzi Guest

    Default Bootloader question

    Can I use bootloader if I use code-protected fuse ?

    Can I check the distributions of my software if I use bootloader utility ?

    Thanks

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Bootloader:

    You cannot change the Codespace if it has been protected.
    You cannot access the Configuration Fuses
    You cannot access the ID (Serial Number) Bytes.
    You CAN read back Codespace (even if it has been protected) with a suitably enabled Bootloader... but I'm NOT going to tell you how.

    ICSP:

    You can change the Codespace if it has been protected.
    You can change the Configuration Fuses.
    You can access the ID (Serial Number) Bytes.
    You cannot Verify if the Codespace has been protected.
    You cannot change back the protection fuses (once a PIC is protected, it remains protected).

    Melanie

  3. #3
    gzorzi's Avatar
    gzorzi Guest


    Did you find this post helpful? Yes | No

    Default

    OK but...
    How can I protect my firmware if I want to use bootloader to upgrade my firmware easy ?

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Use ICSP. The very fact you have a Bootloader, means your software is unprotected. The idea of protceting your code is just that - it is PROTECTED. You can't have a "I want it protected from everyone but me" scenario - it's either protected, or it isn't. You can't have both.

  5. #5
    gzorzi's Avatar
    gzorzi Guest


    Did you find this post helpful? Yes | No

    Default

    Question:
    But the ID (Serial Number) is a register read only or is a register free where I can write anythink only with ICSP.

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    The ID (Serial) bytes are only accessible by your programmer (including ICSP). They are NOT accessible internally to your program. See "Special features of the CPU" section of your PIC's Datasheet.

  7. #7
    gzorzi's Avatar
    gzorzi Guest


    Did you find this post helpful? Yes | No

    Default

    If I write both ID and bootloader with ICSP Can I after only read with program ID value ?

  8. #8
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Your program cannot access the ID bytes.
    The bootloader cannot access the ID bytes.

    The ID bytes can only be read by your programmer software.

  9. #9
    gzorzi's Avatar
    gzorzi Guest


    Did you find this post helpful? Yes | No

    Default

    OK but if I want that my firmware run only with a unique code identification where can I do ?

  10. #10
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    There's so many things you can do, the limit is your own imagination...

    If you have code protected your product, then it is reasonably safe as long as you don't have a bootloader installed and rely on ICSP or an external programmer to update your software. I use several methods depending on the value and copyability of the products by competitors...

    Cheap products are code protected. They can only be code updated if the PIC is on a socket. We either send out a new PIC, or the product has to be returned to the factory for update.

    Some high-risk products that need field updating have a specially written bootloader that will only work with our own host software. The PIC is usually surface mounted on the PCB and the PCB has liquid ceramic adhesive compound poured over it. You cannot get at the PIC or it's connections without destroying the device or the PCB.

    Other products are fully copy protected and have ICSP circuitry on-board. They can be field upgraded the normal way using a programmer, although the code cannot be read back.

    Some products also have the processor linked to an external Hardware device that will provide a Unique Serial Number. Only if your software matches that number then the software will run... this means that your PIC will ONLY function in the target PCB and nowhere else. The Dallas DS18S20 Temperature Sensor looks just like a Transistor... but contains a unique 64-bit Serial Number. If your software matches the number it runs, if it doesn't, then it won't. Some customers are not very trustworthy. They swap serial numbers between boards, then send old boards back 'under warranty'. The embedded serial number in hardware can prove those customers misbehaving.

    Other products will stop working after a preset time and have to be reset by a field engineer.

    Like I said... your imagination is your limit.

    Melanie

  11. #11
    gzorzi's Avatar
    gzorzi Guest


    Did you find this post helpful? Yes | No

    Default

    I have LCD display on PORTB. Can I use ICSP on board with PIC18F458 without manual switch . What circuit schematic can I use for ISCP and LCD connection ?.

  12. #12
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    http://ww1.microchip.com/downloads/e...Doc/30277d.pdf

    Forgot to add... if RB6 and RB& is connected to your LCD, it should have no affect as LCD's have minimum pin loading, so isolation will probably not be required (depending on how good your programmer is)... try it and see. I generally try to assign control buttons to RB6/7 so that they're out of circuit (normally open-circuit with internal pull-up's) and don't interfere with ICSP.

    Personally, I isolate Vdd from my PCB's +5v supply with a Diode and Capacitor to Vss (and have only the PIC powered via the ICSP connector when programming. It goes without saying that you will have to Diode isolate MCLR as well.

    Melanie

  13. #13
    gzorzi's Avatar
    gzorzi Guest


    Did you find this post helpful? Yes | No

    Default

    Thanks I see the connection
    I never program PIC on-board with ICSP.
    If I use JDM programmer the power supply of PIC can do the on-board power supply ?
    What is it the best solution for on-board ICSP circuit ?
    Thanks

  14. #14
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I cannot answer questions about your JDM programmer - I don't know it.

    Appended is a schematic of the ICSP portion that I employ if I'm putting ICSP on a board. If your PIC isn't a 28-pin 16F type, change the pins appropriately to suit, but the circuit basically remains the same.

    R1 and C2 are the usual arrangement for MCLR. D2 prevents the programming voltage Vpp from damaging the rest of your board. During programming the PCB supply (+5v PCB) is switched off. The PIC is powered from the programmer +5v at the ICSP pin. Diode D1 prevents the ICSP programmers +5v from powering-up the rest of the PCB, limiting to applying power just to the PIC being programmed. C1 is just for decoupling.

    Like I mentioned previously, if I'm going to employ ICSP, then I ensure circuitry on RB6/RB7 is relatively benign. Push Button controls that are normally Open-Circuit with internal pull-up's are my favourite choice for these pins. LCD pins should not cause too many headaches, but as always test beforehand.

    Melanie
    Attached Images Attached Images  

  15. #15
    gzorzi's Avatar
    gzorzi Guest


    Did you find this post helpful? Yes | No

    Default

    OK is a good solution.

    I haven't JDM programm all the suggestion are welcome but I prefer that JDM works with ICProg (I see some solution but I don't know the best) . Now I use stand-alone P16PRO with ICProg and LPT connection and is OK.

    The JDM works olso with LVP setting ?.
    If YES the connection circuit is it the same ?
    I don't know if PGM pin must be connect to JDM pin

  16. #16
    gzorzi's Avatar
    gzorzi Guest


    Did you find this post helpful? Yes | No

    Default

    I see that the ICSP programmer power supply the board where there is a PIC to program and there are some solution with diode to isolate MCLR and VDD to the onboard power supply and ICSP connector . OK is it right. But if my board has the 2 power supply to program the PIC (5V and 13V) Can I use this power to supply the programmer without to use an external power supply only for the programmer ? I will use a switch on MCLR pin for normal and program operation.

  17. #17
    Join Date
    Nov 2003
    Location
    Greece
    Posts
    4,115


    Did you find this post helpful? Yes | No

    Default

    If your Codespace is protected AND you have some serial number in this space, you can copy the serial number in the EEPROM area the first time the PIC is run. I used this technique once, where the half of the serial number was secret (user could not see/alter it) and the second half was 0000 by default and could be changed by the user as a password.

    That project included a PC software that was paired with the secret serial number of the PIC.

    Ioannis

Similar Threads

  1. 18F4550 Bootloader enter via eeprom setting
    By bradb in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 22nd November 2008, 23:51
  2. Bootloader question
    By ronjodu in forum Off Topic
    Replies: 3
    Last Post: - 29th March 2006, 00:07
  3. Simple Question
    By koossa in forum mel PIC BASIC Pro
    Replies: 8
    Last Post: - 14th December 2005, 14:43
  4. Bootloader + EEPROM / DATA Command Question
    By CocaColaKid in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 15th September 2005, 20:01
  5. Bootloader Problems
    By rossfree in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 11th February 2005, 17:51

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts