PIC circuit using USB

Status
Not open for further replies.

lonfire

New Member
Hi,
i'm new to using PICs, i have programmed other micros before however.. i'm designing a system where the use can plug the device into their PC's USB port and send some parameters to the PIC which it can store.. the circuits normal operation will be disconnected from the USB port where it can recall the parameters..

looking at using a 18F4550 PIC..

the system will also output data to 4x I2C 8bit bus expanders and read the status in from 3 push button switchs.. nothing 2 complicated..

anyother advice about programming PICs that you think might be useful?

thanks
chris
 
lonfire said:
the system will also output data to 4x I2C 8bit bus expanders and read the status in from 3 push button switchs.. nothing 2 complicated..

The complicated part is the USB section, check the application notes at MicroChip for details. The rest of your requirements are easy enough to do.
 
hi nigel,
thanks for that.. i'm going to buy one of the micro chip USB evaluation boards and have a play..

also getting a in circuit programming board also..

is the version of mplab on microchips site fully functional and free? i notice that the c18 compiler is free for the student version and after 60 days it doesn't do the code optimisation.. are there other c compilers i could use?

thanks
chris
 

MPLAB is completely free!, none of the fully functional C compilers are free though!
 
If your computer supports it, you might want to try making your circuit use the parallel port or serial port.

After all, those two ports are compatible with any OS installed (even DOS).
 
I've had good success with the FTDI FT232R serial -> USB chip. It was super simple to work with and there is free Windows virtual com port and interface DLL's available. The chip is $4.50 USD at mouser.

I've only used the virtual com port drivers so far, but I'm planning on making a simple VB program based on their sample code, it's doesn't look that hard.
 

That's because it's a serial interface and NOT a USB one, so you only need to deal with serial in VB. The FT232 DLL's deal with the USB part, and provide a virtual serial port for you to connect to.
 
I'm not sure if I understand your post, but there are 2 sets of drivers. One is a virtual com port (VCP). If you are using the virtual com port drivers, like I am now, you can access the chip like a com port, using a terminal program, or you could write a Windows program to access that com port like a regular serial device.

The other set of DLL's do not use the virtual com port. In fact one problem I've found is you can't have the virtual com port drivers and the regular USB drivers installed at the same time, at least I haven't been able to. With the regular USB drivers and DLL's you have a vB or programming language you are using, command set. It gives you the added ability to access the underlying USB stuff, like getting and setting the device info like VID, PID, internal serial number... With the regular USB drivers you're device will not show up as an added com port, and you will not be able to acces it that way; only through the DLL's.

Their programming reference is here:
**broken link removed**
 

MPLAB and MCC18 are two different tools. MPLAB is fully functional, MCC18 goes into slightly crippled mode after 60 days.
HTSoft PICC18 is another good PIC C complier. There are others, none of which I would recommend.
 

Sorry, my mistake - the last time I saw it they only provided the serial method - but it was years ago
 
Hi,

Has anyone successfully connected to an ICD2 clone in MPLAB using the FTDI chip to convert a laptop's USB port to a serial port.

I bought a SemiTech based converter, and MPLAB returns the error "Non-existant port" when I try to connect.
 
lonfire:

Unfortunatly as stated, the USB part is a pain in the behind. I will never know why they designed it with all the overhead.

Serial or parallel would be a lot easier. However, those ports are normally
on the back of the computers which is also a pain.

Let me know what you find. I know there are USB to RS232 chips out there, and somewhere on the web I did see a project, PIC or Atmel that did the low level USB stuff. These things have a protocol and all kinds of commands, IDs, etc. This project hook to USB and IDed itself as a device. You have to load drivers on the PC as well to make it work.

I did find this. It is for Atmel, but open source.
**broken link removed**

It is not the site I found way back, I am pretty sure that one was for MicroCHIP.
 
clockdoctor said:
Hi,

Has anyone successfully connected to an ICD2 clone in MPLAB using the FTDI chip to convert a laptop's USB port to a serial port.

I bought a SemiTech based converter, and MPLAB returns the error "Non-existant port" when I try to connect.
I'm not really understanding the question, but I have little experience with ICD2 The ICD2 programmer should be totally seperate from the FTDI chip. It's like asking if the LED you have is connected is effecting your programming. Does the ICD2 share the same pins as your serial connection to the FTDI chip?

EDIT: Actually I just though you might be using this to connect the programmer to your laptop, rather than the project to your USB connection. If that's the case. I don't know, you would have to tell us more about what you are trying to accomplish. Do you have the Virtual Compart Drivers installed? If this is what you are tyring to do, it would have been easier to just get one of the many premade rs-232 -> USB cables out there.
 

We have a half duplex USB to RS-485 adapter that uses FTDI FT232R and the virtual com port drivers. This is a great choice over RS-232 for multiple controller network. https://d-light.us/
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…