Author |
Message |
Topic: Please help for ADC voltage measurement |
ahliang530
Replies: 24
Views: 36500
|
Forum: General CCS C Discussion Posted: Mon Jan 24, 2011 6:59 pm Subject: Please help for ADC voltage measurement |
Sorry, can't help you with Proteus. It's a simulator and full of errors, bugs, etc.
I only build real circuits that I can test and use in the real world.
btw is my connection correct? |
Topic: Please help for ADC voltage measurement |
ahliang530
Replies: 24
Views: 36500
|
Forum: General CCS C Discussion Posted: Sun Jan 23, 2011 9:53 pm Subject: Please help for ADC voltage measurement |
Where is your LCD wired up to( which port )?
Have you adjusted contrst to the mfr's spec( usually .5 -.8 volts).
my wired is same as LCDD.c provided
port D
http://flic.kr/p/9cHFF1
i try ... |
Topic: Please help for ADC voltage measurement |
ahliang530
Replies: 24
Views: 36500
|
Forum: General CCS C Discussion Posted: Sun Jan 23, 2011 12:31 pm Subject: Please help for ADC voltage measurement |
Usually you have 'setup' or 'configuration' code before 'main', to tell the compiler what the I/O pins are to be used for,disabling interrupts,configuring onboard perihpherals,etc..
Since you have ... |
Topic: Please help for ADC voltage measurement |
ahliang530
Replies: 24
Views: 36500
|
Forum: General CCS C Discussion Posted: Sun Jan 23, 2011 12:08 pm Subject: Please help for ADC voltage measurement |
You seem to call lcdinit() several times???
I only call mine once, in the 'startup routine', after the code to setup the peripherals,variables,etc.
It'll be easier to debug if..
You create a ne ... |
Topic: Please help for ADC voltage measurement |
ahliang530
Replies: 24
Views: 36500
|
Forum: General CCS C Discussion Posted: Sun Jan 23, 2011 10:33 am Subject: Please help for ADC voltage measurement |
Well, your program is a good example as to why I never use Proteus !!
First, it should never have compiled as line two is wrong.
hint: read the ADC section of the PIC datasheet.
Second, as you ... |
Topic: Please help for ADC voltage measurement |
ahliang530
Replies: 24
Views: 36500
|
Forum: General CCS C Discussion Posted: Wed Jan 19, 2011 7:01 am Subject: Please help for ADC voltage measurement |
Another thing you might want to add is a small delay (~10ms) between these lines:
SET_ADC_CHANNEL(1);
analin = read_adc();
you need to allow some t ... |
Topic: Please help for ADC voltage measurement |
ahliang530
Replies: 24
Views: 36500
|
Forum: General CCS C Discussion Posted: Tue Jan 18, 2011 8:13 am Subject: Please help for ADC voltage measurement |
Rather than telling you the answer to the ADC question, YOU need to learn
how to research these things yourself. Read Page 127 of the datasheet.
How many bits resolution is the ADC?
i get wha ... |
Topic: Please help for ADC voltage measurement |
ahliang530
Replies: 24
Views: 36500
|
Forum: General CCS C Discussion Posted: Tue Jan 18, 2011 7:14 am Subject: Please help for ADC voltage measurement |
Well, your program is a good example as to why I never use Proteus !!
First , it should never have compiled as line two is wrong.
hint: read the ADC section of the PIC datasheet..
Second, as y ... |
Topic: Please help for ADC voltage measurement |
ahliang530
Replies: 24
Views: 36500
|
Forum: General CCS C Discussion Posted: Tue Jan 18, 2011 4:25 am Subject: Please help for ADC voltage measurement |
I have no problem when compiling but I face error when I simulate in the proteus simulation. Once I click start button it show 3 errors:
1. ADC conversion started before 'wait' time has expired fol ... |
|