I am very new to PIC microcontrollers and will be using one to develop an A/D project.
I will be using PicBasic Pro and likely the 18F2420 or 18F4420 (language choice is due to the fact that I am a fluent VB programmer). I don't know much C anymore and would like to avoid asembly until I get a basic Idea of what I am doing with these uCs.
I have worked my way through the datasheets for this PIC and older generations. I have learned a lot by comparing old samples of code for the older generations of PICs to the new datasheet etc... Though I have made progress, I am still very in the dark about many things.
My biggest issue at this point is understanding all of the timing issues.
I had planned on using a 10MHz XTAL and running at either 10MHz or using the PLL option to get 40MHz. After pulling my hair out, I fail to understand the ADCON2 bits 0-5. I have looked that the tables, Parameter 130, code samples etc. From what I gather the older PICS did not have the TAD setting and this had to be done by pauses in the code... that still does not help me figure out what TAD setting to use or what Fosc setting to use.
The best I can figure is that for
10MHz I need a Fosc/16 (16/10 = 1.6) 40MHz I need a Fosc/64 (64/40 = 1.6)I figured this out with some help from code on other websites and the datasheet, but really don't understand what it all means. As well that leaves me with the TAD settings of either 0,2,4,6,8,12,16 or 20 Which I have no idea how to calculate.
Could somebody pleae be kind enough to explain how this all works? I would like to be able to calculate these settings for this OR ANY PIC. A laymens explanation would be great, as again, I am not at all familiar with PIC clock and timing issues or lingo.
Once I get that figured out, we can move on to UART timing.
Thanks in advance, Bill