View previous topic :: View next topic |
Author |
Message |
rkim01 Guest
|
New to C with PIC |
Posted: Sun Jul 23, 2006 4:35 am |
|
|
Hi, everyone.
Here is another newbie
Anyway I know how to use C but it is quite different to use with PIC
Well, I have PIC C compiler and would like to use it.
I tried to turn on LED with it using 16F627 but I guess I need some tutorial of how to start using C for PIC
Could anyone direct me where and how I can start?
Cheers |
|
|
MikeValencia
Joined: 04 Aug 2004 Posts: 238 Location: Chicago
|
|
Posted: Sun Jul 23, 2006 9:09 am |
|
|
I would suggest getting a demo board such as the PICDEM-2 from Microchip, and then write simple programs to toggle the LED(s), use I2C to read a temperature sensor, use PWM to sound a piezoelectric buzzer, use RS232 to do printf to Hyperterminal, read/write an external eeprom, etc.
A good beginner's book is "Embedded C Programming and the Microchip PIC" by Barnett, Cox and O'Cull.
I prefer the simple programs and demo board approach myself though. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Sun Jul 23, 2006 10:30 am |
|
|
You can also study the examples that come with the compiler.
I take a different approach though. To me, its how do I turn on and off and LED with a PIC. This involves some electrical knowledge and knowledge about microcontrollers. Information about the PIC can be found in its datasheet. Now is when I would say, how do I do this with C. Its the reverse of the approach that you are taking. I could do the same goal with basic, pascal, C, assembly. But I first need to know how to physically do it. |
|
|
rkim01 Guest
|
|
Posted: Sun Jul 23, 2006 5:02 pm |
|
|
Mark wrote: | You can also study the examples that come with the compiler.
|
where is the examples in compiler? Cos i have PIC C compiler and I can't find any though.. Basically I need some kind of tutorial or examples that I can take through. Thanks. |
|
|
Mark
Joined: 07 Sep 2003 Posts: 2838 Location: Atlanta, GA
|
|
Posted: Sun Jul 23, 2006 7:27 pm |
|
|
In the folder called "Examples" |
|
|
|