EmbeddedRelated.com
Forums

getting started on C programming on PIC16F628A, PIC16F690, OR PIC18F2620

Started by ssylee September 9, 2007
I'm trying to get started with C programming on either one of the PIC
microcontrollers in MPLAB IDE using C18 compiler (or any other C
compiler that Microchip makes), however, I'm having some trouble
drafting a source code that has, for example, LEDs flashing or display
a "Hello World" message through printf() and in such fashion that I
can see it on a host computer. Does anyone know any good resources in
those tasks that could help me get started?

Stanley

"ssylee"  wrote...
> I'm trying to get started with C programming on either one of the PIC > microcontrollers in MPLAB IDE using C18 compiler (or any other C > compiler that Microchip makes), however, I'm having some trouble > drafting a source code that has, for example, LEDs flashing or display > a "Hello World" message through printf() and in such fashion that I > can see it on a host computer. Does anyone know any good resources in > those tasks that could help me get started? > > Stanley
Microchip has a section of their web forum dedicated to the MPLAB C18 compiler at: http://forum.microchip.com/tt.aspx?forumid=3 That's probably the best place to start. Try some of the examples included with C18 on install, and if you have questions, ask them on the C18 forum. There are plenty of helpful folks on the C18 forum that can help you get started. Regards, -Bruce http://www.rentron.com
ssylee MULTI-POSTED:
>I'm trying to get started with C programming on either one of the PIC >microcontrollers in MPLAB IDE[...] > Stanley
Your posting style stinks. Rather than this... http://groups.google.com/groups/search?q=irresponsible&enc_author=IF1nYSEAAAAF21LOw3eXRnPQVeYgNES9QHLHhJpkFgCtjKsjoyCv1ZHRGrMdZImE0Gr1e5nVtd0&scoring=d&filter=0 ...if you MUST post the same question to multiple groups, do it this way: http://www.google.com/search?q=cache:qHhBKJ-sXKYJ:en.wikipedia.org/wiki/Cross-post+adequately.answered+corrected+with.commas+individually+Disclaimers+*-*-*-marked-as-Read-in-ALL-*-groups+Newsgroups.line
On 9 Sep, 04:16, ssylee <staniga...@gmail.com> wrote:
> I'm trying to get started with C programming on either one of the PIC > microcontrollers in MPLAB IDE using C18 compiler (or any other C > compiler that Microchip makes), however, I'm having some trouble > drafting a source code that has, for example, LEDs flashing or display > a "Hello World" message through printf() and in such fashion that I > can see it on a host computer. Does anyone know any good resources in > those tasks that could help me get started? > > Stanley
The printf is hardware specific in that the compiler needs to know what hardware it is sending too i.e. lcd display ect. Flashing an LED is just a case of setting up an i/o/ pin as an output then toggling the pin level at a timed rate. www.ckp-railways.talktalk.net/pcbcad21.htm
ssylee wrote:
> I'm trying to get started with C programming on either one of the PIC > microcontrollers in MPLAB IDE using C18 compiler (or any other C > compiler that Microchip makes), however, I'm having some trouble > drafting a source code that has, for example, LEDs flashing or display > a "Hello World" message through printf() and in such fashion that I > can see it on a host computer. Does anyone know any good resources in > those tasks that could help me get started? > > Stanley >
C18 is for PIC18 chips. That leaves you with the PIC18F2620 The deeper stack and better memory lay out makes it more C friendly.