Author |
Message |
Topic: Analysis of the ADC converter of the 18F458 |
vever001
Replies: 17
Views: 36033
|
Forum: General CCS C Discussion Posted: Tue Dec 14, 2010 7:54 pm Subject: Analysis of the ADC converter of the 18F458 |
Are you sure it needs 30 + instructions to quit the instruction handler ?
Because I see the retfie instruction who seems to quit the instruction (handler ?).
Tacq, _can_ be programmed into the c ... |
Topic: Analysis of the ADC converter of the 18F458 |
vever001
Replies: 17
Views: 36033
|
Forum: General CCS C Discussion Posted: Tue Dec 14, 2010 4:38 pm Subject: Analysis of the ADC converter of the 18F458 |
Thanks a lot for your answers it really helps me
So I suppose I shouldn't use the adc_done interruption since it isn't as precise/accurate as a simple delay.
I have one more question:
Do ... |
Topic: Analysis of the ADC converter of the 18F458 |
vever001
Replies: 17
Views: 36033
|
Forum: General CCS C Discussion Posted: Tue Dec 14, 2010 2:44 pm Subject: Analysis of the ADC converter of the 18F458 |
Sorry I forgot to say that he's using the adc_done interruption...
But this doesn't change anything I think...He doesn't have the acquisition delay.
But apparently the conversion is correct till ... |
Topic: Analysis of the ADC converter of the 18F458 |
vever001
Replies: 17
Views: 36033
|
Forum: General CCS C Discussion Posted: Tue Dec 14, 2010 12:21 pm Subject: Analysis of the ADC converter of the 18F458 |
Hi,
I read the assembler code in the lst file and I have this:
.................... valeur_adc=read_adc();
0182: BSF FC2.2
0184: BTFSC FC2.2
0186: BRA ... |
Topic: Analysis of the ADC converter of the 18F458 |
vever001
Replies: 17
Views: 36033
|
Forum: General CCS C Discussion Posted: Thu Dec 09, 2010 5:42 pm Subject: Analysis of the ADC converter of the 18F458 |
Omg sorry I forgot you were using a 40Mhz ocillator
Sorry for the inconvenience
Anyway thanks a lot ! |
Topic: Analysis of the ADC converter of the 18F458 |
vever001
Replies: 17
Views: 36033
|
Forum: General CCS C Discussion Posted: Thu Dec 09, 2010 1:30 pm Subject: Analysis of the ADC converter of the 18F458 |
Just one more question:
Why are you using 64 for the divider of the adc clock ? |
Topic: Analysis of the ADC converter of the 18F458 |
vever001
Replies: 17
Views: 36033
|
Forum: General CCS C Discussion Posted: Thu Dec 09, 2010 9:24 am Subject: Analysis of the ADC converter of the 18F458 |
Thanks a lot PCM Programmer !
You're a genius and your explanations and examples are always amazing.
I understand much better now.
Thanks |
Topic: Analysis of the ADC converter of the 18F458 |
vever001
Replies: 17
Views: 36033
|
Forum: General CCS C Discussion Posted: Wed Dec 08, 2010 2:15 pm Subject: Analysis of the ADC converter of the 18F458 |
Also I would like to see, if it's possible, the assembly code for the read_adc() function.
I searched in the folders of PICC but without success...
Thanks |
Topic: Analysis of the ADC converter of the 18F458 |
vever001
Replies: 17
Views: 36033
|
Forum: General CCS C Discussion Posted: Wed Dec 08, 2010 1:21 pm Subject: Analysis of the ADC converter of the 18F458 |
ok. Sorry I thought the read_adc() function was waiting until the conversion is finished (so the time of 2 conversion woudn't be the same as it is a successive approximation ADC) but in fact it always ... |
Topic: Analysis of the ADC converter of the 18F458 |
vever001
Replies: 17
Views: 36033
|
Forum: General CCS C Discussion Posted: Wed Dec 08, 2010 12:15 pm Subject: Analysis of the ADC converter of the 18F458 |
Hello all,
I need to test the ADC of a 18F458.
So I will put an analog signal on the AN0 pin, then the ADC will convert it, and then I use a MCP4921 or so to get an analog signal.
So I can compar ... |
Topic: Read temp from lm35 and converting it |
vever001
Replies: 16
Views: 23090
|
Forum: General CCS C Discussion Posted: Sun May 16, 2010 8:23 pm Subject: Read temp from lm35 and converting it |
Arf sorry I forgot to put resistors for these leds...Now it works...
Again...sorry for the inconvenience |
Topic: Read temp from lm35 and converting it |
vever001
Replies: 16
Views: 23090
|
Forum: General CCS C Discussion Posted: Sun May 16, 2010 6:14 pm Subject: Read temp from lm35 and converting it |
I have one more question:
I need to switch on a red led if the temperature is over 100°C
I simply did this:
if(temp1 > 100)
{
output_high(PIN_b7) ... |
Topic: Read temp from lm35 and converting it |
vever001
Replies: 16
Views: 23090
|
Forum: General CCS C Discussion Posted: Sun May 16, 2010 5:57 pm Subject: Read temp from lm35 and converting it |
I finally succeeded to get the right temp displayed
I was wrong about the conversion
Now it works great with this code :
temp1= 5*temp*(100.00/1023.00);
Thanks again for your help ... |
Topic: Read temp from lm35 and converting it |
vever001
Replies: 16
Views: 23090
|
Forum: General CCS C Discussion Posted: Sun May 16, 2010 5:50 pm Subject: Read temp from lm35 and converting it |
When I put 64 on the lm35 (0.64V) I get
0083
And then when I put 65 (0.65V) I get
0086
So the temp returned by the read_adc() function is an hexa value...
But then I need to convert it to dec ... |
Topic: Read temp from lm35 and converting it |
vever001
Replies: 16
Views: 23090
|
Forum: General CCS C Discussion Posted: Sun May 16, 2010 5:22 pm Subject: Read temp from lm35 and converting it |
Ooops sorry it works now !
Sorry for any inconvenience |
|