Author |
Message |
Topic: A/D with ref on AIN2 & AIN... |
abx
Replies: 16
Views: 11541
|
Forum: General CCS C Discussion Posted: Tue Jun 12, 2007 7:40 am Subject: A/D with ref on AIN2 & AIN... |
I've checked the ADC configuration registers and all seems ok.
I've also ordered the release for my compiler...
Note that all work well on a PIC16F877A. But there is not enough memory for my complet ... |
Topic: A/D with ref on AIN2 & AIN... |
abx
Replies: 16
Views: 11541
|
Forum: General CCS C Discussion Posted: Tue Jun 12, 2007 5:38 am Subject: A/D with ref on AIN2 & AIN... |
We have provided zener diode for the final board.
The bridge is for prototype board to se if we can adjust the A/D ref between the analog input on AN0 & AN4.
The input signal is 2.5V +/- 0.4. |
Topic: A/D with ref on AIN2 & AIN... |
abx
Replies: 16
Views: 11541
|
Forum: General CCS C Discussion Posted: Tue Jun 12, 2007 3:39 am Subject: A/D with ref on AIN2 & AIN... |
I have a resistor bridge :
0V -> 10K -> AIN2 -> 5K -> AIN3 -> 10K -> +5V.
I've tried with 1K, 0.5K and 1K, with the same result.
What is the minimun ref value ?[/img] |
Topic: A/D with ref on AIN2 & AIN... |
abx
Replies: 16
Views: 11541
|
Forum: General CCS C Discussion Posted: Tue Jun 12, 2007 2:14 am Subject: A/D with ref on AIN2 & AIN... |
That is done yet.
The A/D is working correctly with AN0 & AN4.
The problem is on the refs. When the program pass the command line :
setup_adc_ports(A_ANALOG_RA3_RA2_REF);
the ref AIN2 fall ... |
Topic: A/D with ref on AIN2 & AIN... |
abx
Replies: 16
Views: 11541
|
Forum: General CCS C Discussion Posted: Tue Jun 12, 2007 1:36 am Subject: A/D with ref on AIN2 & AIN... |
The comment in the PIC18F258 is a little bit confuse :
#define A_ANALOG_RA3_RA2_REF 0x8C // A0 A1 A5 Ref=A2,A3
Now, it'ok for the A/D conversion with no refs. thanks.
But the problem with ... |
Topic: A/D with ref on AIN2 & AIN... |
abx
Replies: 16
Views: 11541
|
Forum: General CCS C Discussion Posted: Tue Jun 12, 2007 12:37 am Subject: A/D with ref on AIN2 & AIN... |
Excuse me, I've forgotten the compiler version :
CCS PCH C Compiler, Version 3.182, 21972
Filename: C:\Tempo\test2.LST
ROM used: 3834 (12%)
... |
Topic: A/D with ref on AIN2 & AIN... |
abx
Replies: 16
Views: 11541
|
Forum: General CCS C Discussion Posted: Tue Jun 12, 2007 12:28 am Subject: A/D with ref on AIN2 & AIN... |
Here is the code :
#include <18F258.h>
#device ICD=TRUE
#DEVICE ADC=10
#use delay(clock=20000000)
#fuses NOWDT, HS, PUT, NOPROTECT, BROWNOUT, NOLVP, NOCPD, NOWRT, NODEBUG
#use rs232(baud ... |
Topic: A/D with ref on AIN2 & AIN... |
abx
Replies: 16
Views: 11541
|
Forum: General CCS C Discussion Posted: Mon Jun 11, 2007 3:05 pm Subject: A/D with ref on AIN2 & AIN... |
Ok, I'll do it tomorow. All the hardware is at the office.
Thanks. |
Topic: A/D with ref on AIN2 & AIN... |
abx
Replies: 16
Views: 11541
|
Forum: General CCS C Discussion Posted: Mon Jun 11, 2007 2:50 pm Subject: A/D with ref on AIN2 & AIN... |
I've tried the magic number to test. I have the same results with the constants that are defined in the 18F458.H |
Topic: A/D with ref on AIN2 & AIN... |
abx
Replies: 16
Views: 11541
|
Forum: General CCS C Discussion Posted: Mon Jun 11, 2007 1:18 pm Subject: A/D with ref on AIN2 & AIN... |
Hi,
I configure the A/D converter on my µP (i.e. PIC18F458) with external refs on AIN2 & AIN3 respectively at 2V & 3V.
After a reset, when I test the voltage on each ref pin I get the right ... |
|