|
|
|
Beginner Questions!
|
|
Date: 2006/05/06 16:11
|
By: Andrew
|
Status: Visitor
|
|
|
|
|
|
|
Hi!
Great site firstly, loads of good advice here!
I hope someone can give me some pointers with what I'm trying to do here, I'm a complete PIC/USB beginner btw, so please don't assume I know what I'm on about 
I have the DM16302S USB Demo board, and I'm trying to control some external hardware which is already configured to accept a serial data input, and provide a serial data output.
How would I go about writing a c# program to send a data stream to the dev. board and get it to produce a serial output, and accept a serial input that i can read back into my program?
I've got the LED example from this site working, so thats a bonus 
I guess my questions are...
Does the PIC need flashing to enable it to do serial stuff? If so, what code do i need to flash it with?
Either way, what do i need to do from the c# end to be able to send and receive serial data?
Thanks!
Andrew
|
|
|
|
|
Re:Beginner Questions!
|
|
Date: 2006/05/10 12:20
|
By: Chips
|
Status: User
|
|
|
Karma: 2  
|
|
| Posts: 17 |   | |
|
Hello, If you're interested in serial comms to a pic I believe microchip have some example code for the thing they call the CDC driver, you'll need to have a rummage on their site as recently my rummaging has been limited due to time constraints. Anyway, if you're going to get the PIC to do other things you have to write the programs that run on it, so yea you have to flash, luckily gone are the days of UV lamps for the hobbiest, now its all done electronically via ICSP using just a few special pins on the PIC. USB is a bit of a deep-end leap, best thing to do is go and get the Microchip IDE which is called MPLAB from microchips site www.microchip.com , you can also download Microchip C, called C18 which integrates with that if you dont fancy assembler. There's some good example stuff in the help files for that to get you going.
Alternatively you can go and spend $ on any from a whole host of different PIC programming environments. PICBasic PRo is pretty good if you like BASIC. *cringe* (cringe only because I'm a software engineering purist and the word BASIC *cringe* always makes me do that)
In a nutshell process is: 1 Write PIC program in programming environment 2 Compile.. fix bugs .. fix bugs..fix bugs.. 3 Debug (MPLAB has an emulator so you can check some things are working ok, not much use for USB or serial) 4 Flash the PIC with the output HEX file using a programmer of your choice, no experience with the demo board you mentioned, it may already have all the programming circuitry there. But you can just as easily slap together your own circuits on a bit of vero. More info on this if you need it. 5 PIC will then be running yer prog so cross fingers and hope it works.
This is a freebie course in PIC programming which helped me when i was starting out, it doesnt really talk about USB, but it covers the fundamentals: http://www.amqrp.org/elmer160/lessons/index.html
Hope this helps, sorry its so wishy washy. but busy busy busy Chips
P.S. Looks like Matt has some new articles in the pipeline which will provide interesting reading.
|
|
|
|