Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 22:14 04 Jul 2025 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

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 Kingdom
Posts: 4033
Posted: 08:22pm 22 Oct 2014
Copy link to clipboard 
Print this post

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.

JohnEdited by JohnS 2014-10-24
 
MicroBlocks

Guru

Joined: 12/05/2012
Location: Thailand
Posts: 2209
Posted: 10:47pm 22 Oct 2014
Copy link to clipboard 
Print this post

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: Australia
Posts: 3282
Posted: 11:32pm 22 Oct 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4033
Posted: 11:33pm 22 Oct 2014
Copy link to clipboard 
Print this post

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.

JohnEdited by JohnS 2014-10-24
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4033
Posted: 11:50pm 22 Oct 2014
Copy link to clipboard 
Print this post

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...

JohnEdited by JohnS 2014-10-24
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 03:08am 23 Oct 2014
Copy link to clipboard 
Print this post

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: Romania
Posts: 1697
Posted: 03:51am 23 Oct 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4033
Posted: 04:22am 23 Oct 2014
Copy link to clipboard 
Print this post

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 :(

JohnEdited by JohnS 2014-10-24
 
vasi

Guru

Joined: 23/03/2007
Location: Romania
Posts: 1697
Posted: 07:27am 24 Oct 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4033
Posted: 07:55am 24 Oct 2014
Copy link to clipboard 
Print this post

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...

JohnEdited by JohnS 2014-10-25
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 10:52am 25 Oct 2014
Copy link to clipboard 
Print this post

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: Romania
Posts: 1697
Posted: 11:24am 25 Oct 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 676
Posted: 11:35am 25 Oct 2014
Copy link to clipboard 
Print this post

@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: Romania
Posts: 1697
Posted: 11:49am 25 Oct 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4033
Posted: 05:01am 26 Oct 2014
Copy link to clipboard 
Print this post

  G8JCF said   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

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 Kingdom
Posts: 676
Posted: 07:06am 26 Oct 2014
Copy link to clipboard 
Print this post

US$ 2 that's amazingly low cost !
The only Konstant is Change
 
JohnS
Guru

Joined: 18/11/2011
Location: United Kingdom
Posts: 4033
Posted: 07:36am 26 Oct 2014
Copy link to clipboard 
Print this post

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).

JohnEdited by JohnS 2014-10-27
 
G8JCF

Guru

Joined: 15/05/2014
Location: United Kingdom
Posts: 676
Posted: 09:47am 26 Oct 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4033
Posted: 10:10am 26 Oct 2014
Copy link to clipboard 
Print this post

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 Kingdom
Posts: 4033
Posted: 09:59am 27 Oct 2014
Copy link to clipboard 
Print this post

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    
Print this page
The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2025