Electronics > Microcontrollers

Micro with USB support for a software guy

(1/5) > >>

ndictu:
Hi guys,
I've been watching Dave's blog for quite a while and recently started reading these forums and it's awesome, I learned a lot from you :). I tried searching around but since I don't even know what I want I didn't find it, so I thought I would ask you, sorry if this was already discussed before.

I'm a software person but always liked playing hardware stuff so I got an Arduino some time ago, did some very basic stuff on the breadboard with it and so on. Anyway, I think it's time to move away from this to a more standalone project. The arduino hides a lot of stuff from me and it just isn't the real thing. I want to make a simple little project from scratch, design it on breadboard and then make my first PCB, get it manufactured and build it. Nothing fancy, just a microcontroller, USB port, few LEDs and some sensors (probably 1Wire since I already have DS18B20).

So, I guess what I'm looking for is a simple, cheap uC in DIP package (breadboarding+my soldering still sucks), has USB support (I want to make software that will communicate with the uC and read sensor data / write LED status, maybe even put on some bootloader and program it over the USB but that isn't that important) and then just some basic stuff like few ADCs, few PWM pins for the LEDs and support for SPI/1Wire/I2C.

I tried looking on my local electronics' shop site but from that very limited selection they have (http://www.gme.sk/sk/elektronicke-soucastky/mikroprocesory-atmel-avr-mega/552911636.html, Slovak but I guess you can understand the important stuff) I couldn't find anything that has USB support in DIP package. And since I'm unaware of a better local distributor and don't want to pay big shipping from Mouser/DigiKey just for a few micros, I'm not sure what to get.

Thanks for your time guys. Maybe if there is someone here from Slovakia you could recommend me a better distributor? :)

Psi:
I'm no Arduino expert (in fact i've never used one) but i'm sure the USB port on all the arduinos is not part of the microcontroller at all.
It's a separate chip that appears to windows/linux/osx as a typical serial port.
So the microcontroller only needs a serial port (which 99% of them do) and it can communicate over USB to a computer through this separate chip.

That's probably why you're having problems finding a cheap micro you can use that has a usb port. It's typically the expensive high spec micros that come with built in USB.

It's much easier to use a separate chip that does a USB->SERIAL bridge because then you don't need to worry about coding any USB protocol, which is quite complex and not something you want to do for your first project.

Bored@Work:
Since you mentioned Atmel 8-bit AVRs, non of the USB models come in a DIP package. But that isn't the biggest problem (you can get ready-made boards). The big problem with Atmel AVRs is that you need to know a lot about USB to get the USB periphery working. A lot needs to be done in software, the AVR USB hardware is rather dumb.

There are at least two libraries out there to help. One from Atmel, and one called LUFA. The Atmel one isn't worth to mention. LUFA is rather complete, but still requires you know USB and know what you are doing once you want to do something not covered by the included demos.

At typical alternative is to use a normal AVR with a serial interface and connect that to some FTDI FT232R. However, the FT232R also doesn't come in a DIP package. Another alternative is to look for some cheap mobile phone "data cable" for older mobile phones. They often contain TTL level serial to USB converters. Yet another alternative is to use a typical RS232 level converter (MAX232) together with the AVR and then a cheap RS232 to USB adapter.

Or look at other vendors. Microchip has the PIC18F13K50 and PIC18F14K50 in DIP with USB. Microchip also offers USB framework software for them. But again, you need to know what you are doing if you want to do anything outside what is included as demo.

ndictu:

--- Quote from: Psi on May 22, 2011, 11:12:59 am ---I'm no Arduino expert (in fact i've never used one) but i'm sure the USB port on all the arduinos is not part of the microcontroller at all.
It's a separate chip that appears to windows/linux/osx as a typical serial port.
So the microcontroller only needs a serial port (which 99% of them do) and it can communicate over USB to a computer through this separate chip.
--- End quote ---

--- Quote from: BoredAtWork on May 22, 2011, 11:23:03 am ---At typical alternative is to use a normal AVR with a serial interface and connect that to some FTDI FT232R. However, the FT232R also doesn't come in a DIP package.
--- End quote ---

Yep, I have the Dueamillanove and this is exactly what they use there. I already tried looking for this in DIP but couldn't find it, and I also hoped I could avoid doing that if I could find one uC with USB support.


--- Quote from: BoredAtWork on May 22, 2011, 11:23:03 am ---Since you mentioned Atmel 8-bit AVRs, non of the USB models come in a DIP package. But that isn't the biggest problem (you can get ready-made boards). The big problem with Atmel AVRs is that you need to know a lot about USB to get the USB periphery working. A lot needs to be done in software, the AVR USB hardware is rather dumb.

There are at least two libraries out there to help. One from Atmel, and one called LUFA. The Atmel one isn't worth to mention. LUFA is rather complete, but still requires you know USB and know what you are doing once you want to do something not covered by the included demos.
--- End quote ---

--- Quote from: Psi on May 22, 2011, 11:12:59 am ---It's much easier to use a separate chip that does a USB->SERIAL bridge because then you don't need to worry about coding any USB protocol, which is quite complex and not something you want to do for your first project.
--- End quote ---


Oh, didn't know that. I wasn't looking for a full USB stack support, just a simple FTDI-like converter so I can do text-based communication between the uC and my desktop software.


--- Quote from: BoredAtWork on May 22, 2011, 11:23:03 am ---At typical alternative is to use a normal AVR with a serial interface and connect that to some FTDI FT232R. However, the FT232R also doesn't come in a DIP package. Another alternative is to look for some cheap mobile phone "data cable" for older mobile phones. They often contain TTL level serial to USB converters. Yet another alternative is to use a typical RS232 level converter (MAX232) together with the AVR and then a cheap RS232 to USB adapter.
--- End quote ---

Yeah, I was hoping to avoid this adapter hell. I want something simple and reusable, so when I make another board I just put on the USB connector and use a standard USB cable since I have lots of those.


--- Quote from: BoredAtWork on May 22, 2011, 11:23:03 am ---Or look at other vendors. Microchip has the PIC18F13K50 and PIC18F14K50 in DIP with USB. Microchip also offers USB framework software for them. But again, you need to know what you are doing if you want to do anything outside what is included as demo.
--- End quote ---

After a quick check I found some distributor for the PICs, I could get it for 3.58eur + 5eur shipping, that's not so bad if I would order a bunch of them, maybe if I tried harder I could get better price. But I couldn't find them in the local shop where I can just go pick it up, fast and no shipping costs.

Would it be hard to just do serial communication? I don't need anything else, just read current sensor values in my software, do some logging/processing and send back settings for LEDs or something like that. Just two-way text communication
So, I guess I either go with the PICs, get a bunch of them delivered, buy a programmer and hope I can use the USB stack.
Or, get whatever AVR/... that I can find locally and try to find some DIP package USB<->serial chip right?

Maybe I'm just thinking the wrong way. Basically, I want something that I can prototype on a breadboard to read some 1Wire/SPI/I2C sensors, drive some LEDs and talk to my PC over USB, then I want to take that, make a schematic and PCB of the final design and get it manufactured, solder it (I don't think I can do any SMT) and have a permanent board I can use.

Psi:
Might be worth looking to see if there is any code available to create a USB-SERIAL bridge using an AVR thats available in DIP.
You might be able to buy two DIP AVRs of the same type and use one for the USB-SERIAL bridge and one for your code.

I know there's definitly code available to create a USB joystick out of an ATMEGA8 (which is available in DIP).
It implements the entire USB stack in software so doesnt need any hardware USB support in the micro at all

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version