USB support features of PiCs...


Closed Thread
Results 1 to 8 of 8
  1. #1
    Join Date
    Oct 2010
    Posts
    12

    Post USB support features of PiCs...

    Hi everyone,
    i am almost new at pic programming and components. There is something that i am unable to understand.
    As you know 18f25xx and 18f45xx ( but i am not sure if i can assume all 18 family) have usb support. My question is "why dont other families, like 16f and 12f, have usb support?" and "why cannot we use ubs ports to program pic microcontrollers directly? why do we need another component in our porgramming kit circuit (like 18f2550 in pickit2) if its a matter for PGD and PGC 2 bits (as long as usb has 2 data bits already)?"
    im sorry if these questions seem awkard.

    Thnx for your care...

  2. #2
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: USB support features of PiCs...

    I am not qualified to give you a real answer. But I can give you a layman's guess as an answer for the 18F, and maybe a slightly, more solid 12F answer. Have you ever programmed a 12F and run out of ram? I sure have, and that's just on a smallish program. The 16F answer is probably somewhere in between.

    The 12F devices don't have enough ram and stack space to support USB communication, let alone have enough space on the die to fit USB. And if you did cram it in there, once you programmed a USB application, you would not have any room for any code in code space. Just a USB bootloader code takes about 1000 bytes or words ... not really sure, but either way, that is a lot, especially for a 1000 byte chip.

    You may notice that on the 18F devices, you get something like USB, and you give up something else. A 18F4620 has a ton of code space, a 18F4550 has USB, but only ample code space. Anything Microchip adds to the silicon die, needs to have room. So they usually have to cut something. Otherwise, I am sure they would put everything including the kitchen sink on the chip. Another example, the 18F4431 has some great PWM and stepper motor capabilities. But not enough room for that and USB, and not enough room for a huge amount of memory, like the 18F4620.

    These are really only my guesses, but it might give you an idea or two.

    You don't really need a Pickit2, as long as you can get someone to program Microchip's USB HID bootloader onto your USB chip. But it is a good idea to have one, just in case the code somehow gets corrupted, or so you don't have to send every chip to your friend to get programmed for any new boards you make, or go to a different USB chip.

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: USB support features of PiCs...

    As for the "why can't we program directly from USB" the easy answer is there are more than just PGD and PGC. The programmer also plays with MCLR, Vcc and GND. If you look at the ICSP part of the datasheet - any datasheet for PIC's, you will see there is more going on. Walter eluded to being able to program from USB, but he is talking about bootloaders. That way it is possible, but the bootloader still needs to get in the chip somehow.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  4. #4
    Join Date
    May 2007
    Posts
    604


    Did you find this post helpful? Yes | No

    Default Re: USB support features of PiCs...

    Quote Originally Posted by cncmachineguy View Post
    ....but the bootloader still needs to get in the chip somehow.
    Unless you are using a chip that has a hardware bootloader built into device itself. Unfortunately, none available from MCHP.
    Why pay for overpriced toys when you can have
    professional grade tools for FREE!!!

  5. #5
    Join Date
    Oct 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Default Re: USB support features of PiCs...

    Thanks for your answers and care, i ve read all
    lets assume that we'r using Vdd, Vpp, Gnd. D+ and D- from usb port. do we still need a bootloader? because as i know bootlader is like a manual for writing program to pic. thus we can do it with using our computer via usb.

  6. #6
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: USB support features of PiCs...

    Quote Originally Posted by grimmjow View Post
    Thanks for your answers and care, i ve read all
    lets assume that we'r using Vdd, Vpp, Gnd. D+ and D- from usb port. do we still need a bootloader? because as i know bootlader is like a manual for writing program to pic. thus we can do it with using our computer via usb.
    Yes, we still need a bootloader to be loaded into some of the code space of the chip. Otherwise, there will not be anthing telling d+ and d- how to communicate, which registers to use, what memory to use, where to write on the chip, how to listen to the PC, etc, etc, etc. Even the PicKit is pre-programmed with code, so it can communicate and write to the chips.

    It's kind of like this: Take your PC, then pull out the bios chip (can you even do that anymore?). Then try to start it up. Is it running? You still have a hard drive plugged in. All the hardware is there, but it doesn't work because nothing is telling them what to do.

    Just what is it you are trying to do?
    Last edited by ScaleRobotics; - 2nd March 2011 at 01:02.

  7. #7
    Join Date
    Oct 2010
    Posts
    12


    Did you find this post helpful? Yes | No

    Post Re: USB support features of PiCs...

    Quote Originally Posted by scalerobotics View Post
    Yes, we still need a bootloader to be loaded into some of the code space of the chip. Otherwise, there will not be anthing telling d+ and d- how to communicate, which registers to use, what memory to use, where to write on the chip, how to listen to the PC, etc, etc, etc. Even the PicKit is pre-programmed with code, so it can communicate and write to the chips.

    It's kind of like this: Take your PC, then pull out the bios chip (can you even do that anymore?). Then try to start it up. Is it running? You still have a hard drive plugged in. All the hardware is there, but it doesn't work because nothing is telling them what to do.

    Just what is it you are trying to do?
    first of all, thank you for your care and patience.

    Actually i am not trying to do something, i am just trying to understand the point of using other integrated circuits (like 18f2550) in pickit programmer. i was thinking "if we can write programs on other pics by using bootloader on 18f2550, why cant we do it by our computer? 18f2550 is just an interface on pickit programmer board and we can create this interface virtually on our computer."

    but thnx to you understood the point.
    thnx everyone who had spent their precious time for my questions.

  8. #8
    Join Date
    Feb 2006
    Location
    Gilroy, CA
    Posts
    1,530


    Did you find this post helpful? Yes | No

    Default Re: USB support features of PiCs...

    Quote Originally Posted by grimmjow View Post
    i am just trying to understand the point of using other integrated circuits (like 18f2550) in pickit programmer. i was thinking "if we can write programs on other pics by using bootloader on 18f2550, why cant we do it by our computer? 18f2550 is just an interface on pickit programmer board and we can create this interface virtually on our computer."
    There are some programmers that almost do this. They use the parallel port on the computer to program the chip. But it still needs a little hardware to bring the chip up to programming levels, etc.

    Hopefully my bios example made some sense. Despite the chip having hardware, without code to set configure the chip, and code to tell the chip what to do with the hardware, nothing will happen.... Unless you have a programmer, like the pickit2 that puts a programming voltage to MCLR and send the bits into the chip using ICD programming port. Or load some software on the chip that sets up its hardware, and bootloader code that runs on the chip, letting it program its own code space.

    And by the way, there are many older chips that do not allow programming their own code space, so these will never be able to use a bootloader, and you must program them with a programmer.

    Walter

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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