Author Topic: questions on PIC18F2550's USB device  (Read 760 times)

0 Members and 1 Guest are viewing this topic.

Offline iamericminTopic starter

  • Contributor
  • Posts: 13
  • Country: us
questions on PIC18F2550's USB device
« on: September 23, 2019, 03:40:36 pm »
Hi,

I'm a noob just getting started with PIC microcontrollers. After lots of research and googling I discovered the PIC18f2550. The fact that it comes in a DIP package with full-speed USB seems too good to be true, so I have some clarifying questions. Sorry if I sound confusing, english is not my first language.

1) Is the USB just like a serial port? Can I upload programs directly through the USB port? Can I interface it through a serial terminal and send it serial commands? How does it compare to the Atmega32u4?

2) I looked up some USB connection circuits and none of them have any passive components. Is it really that simple? The Atmega32u4 requires a resistor for both D+ and D-, so I just want to make sure. Do I have to set pull-up resistors through software?

3) I found out that I need a USB bootloader to actually use the uC's USB device. However, every website I visit has their own version of the bootloader or simply doesn't give me one. Where can I find a reliable USB bootloader to use in all my projects? I assume you just burn it through a Pickit 3, just like with an AVR-ISP programmer?

I know some of these questions might seem obvious, but as a complete beginner I just want to clear any misunderstandings before I buy a dev kit, such as this one: https://www.mikroe.com/startusb-pic.

Thanks!
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9964
  • Country: us
Re: questions on PIC18F2550's USB device
« Reply #1 on: September 23, 2019, 04:04:20 pm »
When an MCU has a USB device peripheral, it is just hardware.  The MCU code sets up the USB device configuration and the host queries the setup.  You could implement a serial port, a mass storage device, a HID device (my favorite) or some brand new device for which you write a PC USB driver.  The peripheral itself has nothing whatsoever to do with chip programming (usually).  You need a USB protocol stack and a deep understanding of the configuration tables.

When you think about USB on the Arduino, you should be thinking about the ATmega16U2 that handles the USB connection.  It has the USB peripheral, implements the protocol stack and talks to the PC.  There are some output pins on the 16U2 chip that look like a serial port and they are used for programming the ATmega328P and as a serial port.

The ATmega328P never deals with the USB connection itself.

https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf

There are variations in Arduino boards, not all use the 16U2, some use a different USB chip.
« Last Edit: September 23, 2019, 05:39:41 pm by rstofer »
 

Offline george4657

  • Contributor
  • Posts: 10
  • Country: ca
Re: questions on PIC18F2550's USB device
« Reply #2 on: September 23, 2019, 06:59:09 pm »
Microchip no longer sells their PICDEM Full Speed USB demo board but you can still get their user guides and firmware.
These guides will answer your questions.
The 18f4550 is 40 pin version of same chip.
 
"https://www.microchip.com/Developmenttools/ProductDetails/DM163025"
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf