![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| HI, I am wanting to start learning to program PIC's with C. I have a PIC18F252. I have the ISP working. I am using MPLAB with C18 compiler. What documents or tutrorials are available to learn how to address the USART and do A/D conversions using "C" ? Any help would be greatly appreciated. Mike | |
| |
| | (permalink) |
| There is some example code in the directory where you installed the C18 compiler: C:\MCC18\example\users_guide NOTE: You may need to have specified that the samples be included when you installed the C18 compiler. Other useful things: C:\MCC18\doc\periph-lib C:\MCC18\example\getting_started
__________________ --- The days of the digital watch are numbered. --- Last edited by kchriste; 22nd November 2007 at 04:54 AM. | |
| |
| | (permalink) |
| Have you used these modules before? Well you can use a library function to set up the UART or ADC, which personally I do not recommend because if you don't understand everything it's doing to the letter then there's a significant chance you're not going to be using it right. If you DO know exactly what you want to do, then just assign the reg directly. That's what most people do. I have always just looked up the module functionality and assigning them in C is straightforward: ADCON=0b11110000; You will probably need to write an interrupt handler, that's in a format specific to a particular C compiler. The syntax is different for PICC18 and MCC18.
__________________ I thought what I'd do was I'd pretend I was one of those deaf-mutes. | |
| |
| Bookmarks |
| Thread Tools | |
| Display Modes | |
| |
| | ||||
| Title | Starter | Forum | Replies | Latest |
| Question about Inchworm+ | Quan | Micro Controllers | 54 | 28th October 2007 01:21 AM |
| UNIT Committment solution using Dynamic programming | arijit18 | Electronic Projects | 1 | 18th October 2007 09:28 PM |
| my first 16F88 has me stumped | Hank Fletcher | Micro Controllers | 15 | 3rd August 2007 04:22 PM |
| Programming languages | sram | General Electronics Chat | 9 | 2nd March 2007 05:15 PM |
| Good Computer Programming Book | ThermalRunaway | Chit-Chat | 21 | 16th September 2005 11:05 PM |