View previous topic :: View next topic |
Author |
Message |
Slick05
Joined: 05 Feb 2005 Posts: 14
|
A/D conversion |
Posted: Sat Feb 05, 2005 2:13 pm |
|
|
Hi, I am working on a project (with the 18F458) where I need to sample an incoming signal. I do not fully understand how the A/D implementaion works. Do I have to use the A/D ISR? I made a test program without using the A/D ISR and it seems to be working. What do you think? |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Feb 05, 2005 10:52 pm |
|
|
No, you don't need an isr. Typically, users don't use an isr to read
the built-in ADC.
I suspect you have the demo. That's why you have no examples
to look at. Here's how to get some example code:
Go to Google http://www.google.com
Type in this search string, including the quotes:
"read_adc" "#use delay"
This will get you lots of sample code for CCS which uses the read_adc()
function. Only CCS has the "#use delay" statement. That's why it's
useful as a search key for sample code.
Look in the manual or the Help file to see which built-in CCS functions
are useful to you. Then use the method above to find sample code.
The manual is available here: http://www.ccsinfo.com/ccscmanual.zip
Unfortunately, they didn't enable the table of contents, which makes it
not very useful, but there's nothing I can do about that. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Feb 05, 2005 10:52 pm |
|
|
Duplicate post deleted. I didn't do it. I think the board may be glitching.
Last edited by PCM programmer on Sat Feb 05, 2005 11:29 pm; edited 1 time in total |
|
![](templates/subSilver/images/spacer.gif) |
bkamen
Joined: 07 Jan 2004 Posts: 1611 Location: Central Illinois, USA
|
Re: A/D conversion |
Posted: Sat Feb 05, 2005 11:13 pm |
|
|
Slick05 wrote: | Do I have to use the A/D ISR? I made a test program without using the A/D ISR and it seems to be working. What do you think? |
No, you don't have to use an ISR if you don't mind the lock-step format of the resulting code.
Where the ISR buys you something is when you want to set multiple channels, wait for the settling time and then take the same. You could be doing other things in the meantime.
I wrote a monitor for 4 A/D channels that also uses RS232 and Timer0 IRQ's. The A/D information streams into memory while bytes are spewing out of the RS232 port, I2C data is being written/read and so on...
Partially academic, but also very useful if timing is an issue for your application. |
|
![](templates/subSilver/images/spacer.gif) |
|