View previous topic :: View next topic |
Author |
Message |
DKH Guest
|
external ADC |
Posted: Tue May 01, 2007 12:22 pm |
|
|
Does anyone here have an example how to conect and program an external ADC(for example ADC0804)?
tks
Nina |
|
|
SherpaDoug
Joined: 07 Sep 2003 Posts: 1640 Location: Cape Cod Mass USA
|
|
Posted: Tue May 01, 2007 1:41 pm |
|
|
Start with EX-AD12.C in your examples folder. It uses either the LT1298 or the MCP3208 converters, but it is a place to start. _________________ The search for better is endless. Instead simply find very good and get the job done. |
|
|
nina
Joined: 20 Apr 2007 Posts: 111
|
external adc |
Posted: Tue May 01, 2007 2:43 pm |
|
|
thanks SherpaDoug....do you have any example showing how to conect and program this devices?
tks
Nina |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue May 01, 2007 2:58 pm |
|
|
One question would be, why do you want to use an external 8-bit A/D
chip when your PIC likely has an internal 10-bit A/D ? |
|
|
nina
Joined: 20 Apr 2007 Posts: 111
|
external ADC |
Posted: Tue May 01, 2007 3:25 pm |
|
|
PCM programmer..
My load cell has 10000 lbs (at full load) if I have a 10 bits ADC I just have 1024 reading then I would have reading like...10, 20, 30,40,50...100,110,120,130...until 10000 lbs. I need more precision thats why I need use an external ADC
tks
nina |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Tue May 01, 2007 9:32 pm |
|
|
Quote: |
Does anyone here have an example how to conect and program an external ADC(for example ADC0804)?
|
You will find how to connect the ADC0804 to any uP it in the datasheet.
It has 8 bit paralel output [DB0...DB7] ChipSelect, Read, Write and an Interrupt
signal that will give a down level at the end of conversion cycle.
It is quite old and it will be out of spec according to your project needs.
Quote: |
My load cell has 10000 lbs (at full load) if I have a 10 bits ADC I just have 1024 reading then
I would have reading like...10, 20, 30,40,50...100,110,120,130...until 10000 lbs.
I need more precision thats why I need use an external ADC
|
The point is, as PCM Programmer said, why are you trying with an external 8
bit ADC while you already have a built in 10 bit ADC module inside the PIC.
To get a monotonic reading increment of 1 lb you will need a resolution of 14 bits.
Humberto |
|
|
nina
Joined: 20 Apr 2007 Posts: 111
|
external ADC |
Posted: Wed May 02, 2007 6:53 am |
|
|
sorry humberto...I missed when I sad ADC0804. I intend use a ADC (at least 16 bits resolution).
Thanks for explanation about how to conect external ADC, I will check and if I have some doubt I will post here.
About programming PIC to get reading from external ADC. Do I just need do this or do I need something else?
setup_adc_ports(ALL_ANALOG);
setup_adc(ADC_CLOCK_INTERNAL);
delay_ms(5);
printf("-------Ready to read-----");
while (TRUE)
{
set_adc_channel(0);
delay_us(20);
valor1=read_adc();
delay_us(30);
printf(")%4.0f ->%1.2f :::",valor1,volt1);
printf(lcd_putc,"%2.2f",valor1);
}
Tks
nina |
|
|
|