Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Starting with microcontrollers....programming/etc...

Status
Not open for further replies.

ksmyarse

New Member
Hello everyone...I finally decided to start looking into microcontrollers...and ended up with more questions than before I started. Idealy I want to create USB devices for simple input/output features as a first project. Searching around came up with Cypress's usb microcontrollers (CY7C63001-PC specifically)
My question is this chip rewritable and how can I (cheaply :p) program it? Cypress has a programmer on their site for $99, which I guess is a decent deal, but it seems that it'd be useless if I switched to a different manufacturer's PICs...not to mention that the software on the included page just shows "The system cannot execute the specified program." when ran from 2k (I don't have a win9x box readily available.)

So yeah....I'm open to any suggestions on choosing a different PIC, programmer, etc....thanks!
 
I'd recommend Silicon Labs' 8051 microcontrollers. You can buy a development kit with programmer for $100. They are really fast and super easy to debug thanks to their JTAG interface. They also come with a 4K limited C compiler and a bunch of examples to get you up and running.

You shouldn't try to start with a USB device. USB requires really complicated software. Most microcontrollers have a UART which can be used to communicate with the serial port (RS232) on your computer. The serial port is much easier to work with.

Brent
 
If you want a general purpose and cheap microcontroller experience, go for PICs. I've interfaced a USBN9604 to a PIC and after implementing the relatively complex protocol of USB, the transfer rates were pathetic.
So if you want a USB device, go for cypress.
And yes, always start with simple tasks like flashing LEDs or interfacing the COM port.
If you are really game for USB, visit usb.org and download the specifications. After that, pick up Walter Oney's book on WDM drivers and learn some driver programming. A summarised version of the USB specs can be found at beyondlogic. That'll give you a good overview of what to expect.
Or you can go the cheap and easy way, which is to use FTDI's USB-to-Serial convertor. Essentially, your device will still be a serial device, and not a true USB device.
 
One option which hasn't been suggested is the PIC16C745, this is a PIC with an inbuilt USB port - it's still complicated to program the USB, but you can download application notes and examples from MicroChip (for both PIC and PC). So it's not too bad.

However, the 16C745 is an OTP (One Time Programmable) chip, so you need to buy the expensive JW version which is UV eraseable for development.

But I would certainly suggest you DON'T start with USB for your first projects, it's far too complicated - start with something far simpler.

Have a look at my tutorials is you fancy using PIC's, there's also free programming software and programmer circuits you can download.
 
I have been planning to kickstart my USB project since year ago.
However..hmm.. I'm lack of courage.. kekeke. I gotta learn the USB protocol, and driver programming in PC, that sounds terrifying.
Anyway, it is a must to do USB, as I think RS232 is going to be obselete in near future.
 
StupidDum said:
I have been planning to kickstart my USB project since year ago.
However..hmm.. I'm lack of courage.. kekeke. I gotta learn the USB protocol, and driver programming in PC, that sounds terrifying.
Anyway, it is a must to do USB, as I think RS232 is going to be obselete in near future.

Check the MicroChip application notes, in particular the details for their PICKIT1 FLASH programmer, this works entirely off a USB port, and you can download all the source code and diagrams.

I don't see serial ports disappearing off PC's as a problem really, just use a USB-Serial adaptor, either buy one or use one of the available chips as part of your design.

Most USB applications don't require (or use) high speeds, it's simply for convenience.
 
Thanks to everyone for their replies!

I have seen MicroChip's USB PIC in searching, but have yet to look further into it as a possibilty...I will defantly look it over carefully it before I plunge in to this project though.

As for the Cypress chips - I have found example firmware and software to interface the chip with the standard HID driver in Windows and a programmer using the parallel port that I think I will try to use before dropping $99 on the programmer Cypress offers (which I'm still not sure if it will work with more than Cypress's chips.)

For anyone interested here is what I came up with:
**broken link removed** - Cypress used to offer a USB Thermometer development kit using the CY7C63001 chip...complete with the programmer mentioned earler...of course now they don't offer this kit, but when they did offer this kit they didn't provide source for the windows drivers. It seems lots of people created their own and even went as far as making it compatable with the HID drivers that are part of Windows. I found HIDDemo2 on this page - **broken link removed** - Looks like all of the dirty work I would need for USB done for me. (I haven't looked at either part of the code...it's 3am here I doubt I'd understand any of it :p)
The first site also led to a homebrew programmer for the CY7C63001. It was created by X. Fenard and published in the French magazine 'Electronique Pratique.' Pitty I can't read French, but the schematic is here - **broken link removed** - and a picture of the completed programmer and the executable is on Fenard's site at - **broken link removed**

Now I need to build the programmer......Couple of questions here - I understand the resistors like #ohm and #kohm (so on) but what is a 4k7? And what wattage should the resistors be?

Also, will a black-light flourescent bulb provide enough UV to erase the chip? May sound like a stupid question, but I'm good at asking stupid questions.


Sorry if it seems like I shot down anyone's ideas, but I got lucky searching right after I started this thread. I knew that USB would be a bad choice for getting started with microcontrollers (and electronics in general, which I am still quite novice with.) but I wanted to create a device that communicated via USB and my perspective was that if I don't start with a project I'm truely interested in I'll get get bored quickly and forget about it...Idealy this project will be a controller for a carpc....Switching relays, detecting button presses, basically simple beginner stuff. After that the amount of electronics in the car to interface with are endless...
 
ksmyarse said:
Also, will a black-light flourescent bulb provide enough UV to erase the chip? May sound like a stupid question, but I'm good at asking stupid questions.

No, you really need a UV ereaser. But they do cost a lot...
The cheapest option I know is to buy a little torch wich has a F4T5 type of tube in it. You can then replace this tube with a G4T5, a germicidal UV lamp, wich will do the trick
This is how i erease my chips, and it cost about 50 euro's. That's a whole lot less then a ereaser
 
Some points to note.
1. I think the CY chip you were referring to is a low-speed usb device. If you are really keen, at least start off with a full-speed one. Otherwise, may as well go the direction of usb-to-serial convertors.
2. By recommending that you carry out simple tasks first is an essential step in microcontroller programming. If you cannot even flash LEDs, then you can forget about doing simple I/Os. If you cannot even do serial port communication, you will have to find some alternative means of providing debugging information during development. Unless you are a genius and your codes ALWAYS work, you can skip these steps.
3. Cypress programmers work only on Cypress chips. PIC programmers work on PIC chips. Few programmers on the market can serve a range of microcontrollers. That's the way things work.
4. 4K7 denotes 4700. Most probably it'll be a resistor value.
5. HID devices are devices which are compliant to the HID protocol over and on top of the main USB protocol. It's mainly for guys who shun driver development. I think it's theoretical maximum transfer rate is 0.5 Mbps. The main idea of designing USB devices to be compliant to any device class is simply shifting the programming load from the driver-side to the firmware side.

Before you start doing anything yet, start making some decisions.
1. Decide on the chip you want to use. This will depend on functionality, availability, programmability and a host of other considerations.
2. Buy or make a programmer and development board for the chip.
3. Do simple stuffs like flashing LEDs and RS232 comms.

For the USB part, there are as many considerations to make.
1. Do you want to just simply realise a USB connection, or do you want to do a fully customized one. If it's the former, go for usb-to-serial convertors.
2. Are you willing to venture into driver programming? If not, implement the HID standards over and on top of the USB specifications on your USB firmware. But note that HID class is not generally suited for large volume data transfer. If yes, dump all device classes and jump into the wonderful world of driver programming.

By any means, please do read beyondlogic's USB articles, just to get a taste of what is expected.
 
ksmyarse said:
Now I need to build the programmer......Couple of questions here - I understand the resistors like #ohm and #kohm (so on) but what is a 4k7? And what wattage should the resistors be?

4K7 is 4.7K - it's the International Standard for resistor values, and has been for many years.

The resistors only need to be 1/4 watt, nothing special.
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top