![]() |
Forum Index : Microcontroller and PC projects : Simplest and cheap USB PIC18
Page 1 of 4 ![]() ![]() |
|||||
Author | Message | ||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
I was wondering what the very simplest and cheapest PIC (I'm guessing PIC18) that can do USB is and what circuit & components would be needed? Can any of them cope without xtal, caps, etc? I suppose I'd prefer a 3.3V part (though the USB is 5V). I'm thinking in terms of using it to program PIC32 cpus via ICSP to do away with any FTDI chip, and more cheaply. In that sense, a 5V PIC is OK but then I suppose it'll need some logic for ICSP at what might be 3.3V. The reason for USB is that's about all you can rely on a laptop/desktop having that's also cheap and common. John |
||||
MicroBlocks![]() Guru ![]() Joined: 12/05/2012 Location: ThailandPosts: 2209 |
John, You could have a look at these products: http://www.mikroe.com/startusb/pic/ https://www.olimex.com/Products/PIC/Proto/PIC-USB-4550/ Both have schematics available so you can see what is needed to get it working. Btw. Did you have a look at the VT100 from Geoff. It seems that is a good candidate to add a ICPS programming facility. Microblocks. Build with logic. |
||||
Geoffg![]() Guru ![]() Joined: 06/06/2011 Location: AustraliaPosts: 3282 |
There are these from Microchip. As they say, you save 15 cents by eliminating the crystal ![]() Geoff Geoff Graham - http://geoffg.net |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
TZA - Thanks but they look way more complicated than I want (and will cost more). The MCP2200 just for its GPIOs might be OK though a uC is what I had in mind. The snag seems to be the surrounding xtal/caps/etc. Geoff - thanks, will look It's not the $0.15 so much as that I don't own any xtals and to jam a few parts into a breadboard to make a PIC32 ICSP programmer I'd like it to be one part (sadly, not gonna be), or if not one then as few as possible. If not a few parts on a breadboard then a cheap (very cheap) small board is the alternative. Now it looks like FTDI boards are out. John |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
Maybe it really is best to just get a PICkit3 (or 2) or even a Raspberry Pi. The problem with alternatives is going to be the need for Windows drivers (one for XP, one for Vista, one for 7, one for 8 and frankly who wants to write any?). Unless... a very cheap USB uc could say it's a HID or CDC but accept strings that tell it what to do in terms of identifying and programming via ICSP. That should work. OK, back to the very very cheap & simple uC with USB... John |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
John Something like this http://www.embeddedadventures.com/usb_to_serial_plt-1003.htm l or is this too expensive ? I got a couple of these way back to learn about PIC and USB with MPLab Peter The only Konstant is Change |
||||
vasi![]() Guru ![]() Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
I know there are PIC18F micros that can do USB with just the internal oscillator. But on the Microchip forums they say it is also a PIC16F: [quote]The 16F1459 (now sampling) is pin compatible with the 18F14K50 and can run USB on the internal oscillator as it contains clock recovery from the USB SOF and an additional PLL (3x) that can create the 48MHz clock from the internal oscillator.[/quote] Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
Peter - thanks. Yes it is a bit expensive for this though it's quite nice otherwise. vasi - also thanks, I didn't know that about MCP2200 (other thread, about FTDI)! Must read more... (The 16F... one is in that presentation Geoff pointed out.) Currently wondering about using two of those usbasp/usbisp boards (2 so that 1 can reprogram the other to be what I really want) - though it feels a bit ugly to use atmega8 to program pic32. Not sure about voltages though :( John |
||||
vasi![]() Guru ![]() Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
JohnS, ATmega8 will work ok at 3.3Vcc with an 8MHz external crystal. Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
Thanks. I'm looking at a USBISP board which has an atmega8a on it. Has a 12MHz xtal which I think is to help with USB. Have yet to measure voltages but at least it has a 3V3 regulator on it so if I have to I can maybe cut and solder. May be OK with a resistor divider, which would be better I think. Just playing with avr-gcc, avrdude and reading Atmel data sheet... John |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Hi John Is something like this of interest to you http://proto-pic.co.uk/adafruit-trinket-mini-microcontroller -3-3v-logic/?gclid=CK-A7JHXyMECFZTLtAodIhgA6w for GBP £6.92 (inc VAT) or https://www.coolcomponents.co.uk/trinket-mini-microcontrolle r-3-3v.html?gclid=CLvq-9TXyMECFWj4wgodDlgAow at 10 for £6.13 each (inc VAT) Peter The only Konstant is Change |
||||
vasi![]() Guru ![]() Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
Hi Peter, As USB device, performance is poor. See this page. Vasi Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
@vasi I didn't think that the Trinkets would be used as USB<->Serial devices, but as a very cost effective access to a MCU mounted on a PCB with a USB connector and containing a boot-loader. I've not found anything as low in cost as these trinkets (from a UK based supplier anyway) which offers the programmability, eg ATtiny85 on-board, 8K of flash, 512 byte of SRAM, 512 bytes of EEPROM, USB bootloader with a nice LED indicator looks just like a USBtinyISP I personally like the PIC18F14K50 and the others in that family, but that's because I'm more familiar with Microchip stuff, but I've not found as low a cost board as the trinkets so far. If there is one from an EU based supplier, I'd love to know Peter The only Konstant is Change |
||||
vasi![]() Guru ![]() Joined: 23/03/2007 Location: RomaniaPosts: 1697 |
You're right, it is a good micro. I have one in smd case and I was surprised to see that is a little bigger than a smd PIC12F675, much easier to be soldered by newbies like me. Hobbit name: Togo Toadfoot of Frogmorton Elvish name: Mablung Miriel Beyound Arduino Lang |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
hmm, maybe, but I'm trying the approx $2 usbasp boards (with new firmware once I've written it). John |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
US$ 2 that's amazingly low cost ! The only Konstant is Change |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
It's this kind of thing on ebay Just search on usbasp or usbisp I bought 2 so I can reprogram one (using the other). John |
||||
G8JCF![]() Guru ![]() Joined: 15/05/2014 Location: United KingdomPosts: 676 |
Hi John Thanks for the link - GBP 1.42 and FREE P&P, just how do ,they do it ? I came across this thread which suggests that what you are attempting is entirely possible, so I'll just get a couple and wait for your release if that's OK with you Peter The only Konstant is Change |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
That's the sort of thing. Pity it just stops where it does! I have to change from libftdi to libusb which is a bit pesky but can't be helped. If I can get USBCDC into it then that might work. John |
||||
JohnS Guru ![]() Joined: 18/11/2011 Location: United KingdomPosts: 4033 |
Well, I got a big chunk of code to compile and flashed it into a usbasp board. Had to cut some routines etc out (only 8KB flash) but nothing vital. Measuring voltages and checking datasheets shows I'll need voltage dividers or the like for the pins driven into the PIC32 as the atmega8 manages a full 5V on an output pin. Pity the PIC32's ICSP pins are not 5V tolerant (weird, too, really). Input to the atmega8 is problematic as its VIH is 3V which is about all PGD from the PIC32 has at best. I'll try using an analogue in pin, that should work (a bit slower, but I don't think it'll matter). John |
||||
Page 1 of 4 ![]() ![]() |
![]() |
![]() |
The Back Shed's forum code is written, and hosted, in Australia. | © JAQ Software 2025 |