USB functions with PIC18F4550

In summary, the pic chip has usb wiring ability. Does this mean i can create a very cheap burner, or that it can comunicate to a computer?To connect to other USB peripherals, like a flash drive, you need it to be a USB host device.
  • #1
Mike Charlie
16
0
It is my understanding that this pic chip has usb wiring ability. Does this mean i can create a very cheap burner, or that it can comunicate to a computer?

In the case of the cheap burner being possible could i implement the chip into the circuit and then program it later (that's just an example, would probably use it to give the device updates in real life)?

In the case of the communication would it be possible to wire it up to a flash drive and all of the data that is put into chip to then be past into the flash drive or does it need direct access to a computer?

Or is it a case of being able to do both at different times i.e. being able to update it when i develop updates and then reconnect the flash drive to the system to continue giving information.

Thanks in advance.
 
Engineering news on Phys.org
  • #2
I'm not sure what you mean by a "very cheap burner". But to connect to other USB peripherals, like a flash drive, you need it to be a USB host device.

I have used that PIC series as a USB slave (as a serial COMM device attached to a "normal" computer" -- you should also be able to emulate a mouse or a mass storage device). But I've not used it as a host. I'm not sure if the chip has enough poot to handle all the host requirements and MicroChip's doc and examples are so convoluted that I just gave up after I got one thing working. You can find the whole doc set and software for my PIC board here:
http://www.etantdonnes.com/DOC/USBPIC/USBPICindex.html

And somewhere on the MicroChip site they have the whole example software package along with their free C compiler.
 
  • #3
By cheap burner I meant programmer (couldn't think of the word at the time), I want to be able to build the project (a darts scorer) and then at a later date program in updates. However my understanding is that there is a separate programmer for the chip, and it is programmed before it is put into the circuit, so I was wondering whether it was possible using the USB function to program the microcontroller when it is still in the circuit.

http://www.edaboard.com/thread126795.html

I believe that the above link does what I am thinking, however it is very limited in its explanation. I just need it confirming before I go and buy the pic chip
 
  • #4
Ah... To get started you will need an external programmer. I use the PicKit-2, which I think has been superseded, but it was not very expensive anyway. It connects to an In-Circuit-Serial-Programming (ICSP) connector, so you don't have to swap the PIC chip from place to place. Once you get going you can probably find some boot-loader that would allow you to program over the USB itself.

However you could use an Arduino (which has an Atmega controller rather than a PIC) to do what you want. It's already setup with the boot-loader and has a huge catalog of programming libraries and such like.
 
  • #5
I currently have an arduino (Mega ADK to be exact) but because the project is supposed to be permanent I don't want to go overkill on the microcontroller as this will cause expense (the whole project is supposed to be on a budget).

Also what is the website showing how to do, its very confusing due to the lack of instructions
 
  • #6
If you're building this thing as a commercial product then I guess it's a good idea to minimize the price, but if it's a one-off the amount of time you spend futzing around with the PIC will probably be way more than the cost of the cheapest Arduino. Especially since you are starting from scratch in either case...

As to "the website", I guess you mean the link I sent for my USBPIC. It's all the information I have on a board I designed and programmed which uses the PIC chip you asked about. If you insist on using the PIC in your project, the source code linked on that page includes a working USB serial implementation.
 
  • #7
I am making this as a one off however I am hoping it will get me further business with different companies (so I want to create it one way even if its harder as to minimise the work I will have to do if it is succesful).

The website I was on about was the one I listed (the one you listed I actually understood). It seems to me that it is showing how to program the chip using hardly any components. I have reposted the URL below.

http://www.edaboard.com/thread126795.html

I also found this.

http://www.diolan.com/pic/bootloader.html
 
  • #8
Well that's a relief that you understood my page...

Reading the edaboard page it seems that the writer used a "JDM programmer" to get something on the PIC. Googling that, turns up a socketed programmer board, so I guess they plugged their PIC into that and got it programmed and then put it on the minimal board that they built.

I'd guess that you might be able to use the JDM to get a bootloader onto the PIC initially and then figure out how to upgrade via USB. My preference would be to get the PICkit ICSP programmer and use it for upgrades as well, but that's just me...

You might look at the BitWhacker board which does sort of what you want:
https://www.sparkfun.com/products/762
I was unsuccessful at reverse engineering the bootloader but you may be more tenacious.
 
  • #9
  • #10
That programmer appears to have a standard serial port connection. First there aren't too many of those around anymore as everyone has gone USB, and second they never, AFAIK, had power on them -- the page says it gets power over the serial...

I'm sure you could make it work, but I'd look for one that has USB. I don't know what software you'd need on the host either. You'll have to do that research yourself.

Your schematic looks like the basic idea for getting a PIC and USB port going, presuming that whatever boot-loader you use looks at RB4.
 
  • #11
I actually have the port on both of my computers haha.

I get what you are saying.I did look at the PICkit 2 that you suggested using however I am not too sure how to use it, the programmers that I'm looking at all seem to have the easy plug it into computer, place mcu into slot and program but the PICkit looks more complicated than this. If you could advise how to use it then I may get that as it is supported by Microchip
 
  • #12
The advantage of ICSP is that you don't have to shuffle a DIP back and forth between sockets, which means you don't have to use DIPs at all. I used an SOIC package on my board -- which is half the size and still (almost) solderable.

The Pickit has a USB i'face to the host and you can make a simple ribbon cable extender to go to your board. It comes with software for Windows, I'm not sure about others, like Linux, though.
 
  • #13
Would it come with an accurate description of which pins I would need to connect in order to program it then?
 
  • #14
I'm pretty sure you can figure it out when you get it. You can also look at the schematic for my board to see what pins are used on the PIC.
 
  • #15
Thanks I think that really settles all of my queries. Thanks for all the help
 

Related to USB functions with PIC18F4550

1. What is a PIC18F4550 microcontroller and what are its USB functions?

The PIC18F4550 is a microcontroller developed by Microchip Technology, commonly used in various electronic devices. It has built-in USB functionality, meaning it can communicate with other devices through a USB connection.

2. How does the PIC18F4550 communicate with USB devices?

The PIC18F4550 has a built-in USB module that allows it to communicate with USB devices. It works by converting data from the microcontroller into a format that can be transmitted through a USB connection, and vice versa.

3. Can the USB functions of PIC18F4550 be used for data transfer?

Yes, the USB functions of PIC18F4550 can be used for data transfer between the microcontroller and other USB devices. This can include sending and receiving data, as well as controlling and monitoring the flow of data.

4. What are the advantages of using PIC18F4550 with USB functionality?

Using the PIC18F4550 with USB functionality allows for easy and fast communication between the microcontroller and other devices, without the need for additional components. It also simplifies the design process and reduces the overall cost of the project.

5. Are there any limitations to the USB functions of PIC18F4550?

Some limitations of the USB functions of PIC18F4550 include the maximum data transfer rate, which is 12 Mbps for USB 2.0. It also has a limited number of USB endpoints and requires specific coding for USB communication. Additionally, the PIC18F4550 may not be compatible with all USB devices.

Similar threads

  • Programming and Computer Science
Replies
2
Views
884
Replies
6
Views
1K
Replies
1
Views
1K
Replies
2
Views
2K
  • Computing and Technology
Replies
3
Views
1K
Replies
7
Views
2K
  • Computing and Technology
Replies
5
Views
938
  • Computing and Technology
2
Replies
36
Views
3K
Replies
2
Views
3K
  • Electrical Engineering
Replies
6
Views
3K
Back
Top