Dimebag wrote:I have been reading the datasheet for 18F452. I am just trying to make a start on using the datasheets to program in C without using the (read.c) and (write.c).
....
If you are looking for confirmation that accessing the UART without using a compiler vendor's packaged interface functions is an OK thing to do, I can confirm that it is. I do it myself all the time. I use the CCS compiler, but I have never used any of their peripheral interface functions. I like to program by directly accessing registers as they are documented in the PIC datasheet. Often a compiler vendor's peripheral interface function is more difficult to adapt to than the basic PIC registers themselves, and it adds another level of uncertainty regarding function usage and execution time. With my own implementations, especially the time-critical ones, I can look at the disassembly of my C code and fine-tune performance characteristics to match my application requirements. Also I find that Microchip has done a pretty good job in documenting their peripheral registers - perhaps a better job than the compiler vendors have done in documenting their function calls. So I find I am losing very little by avoiding the compiler's peripheral interface functions.