Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 19, 2024, 02:48:55 02:48


Login with username, password and session length


Pages: 1 [2]  All
Print
Author Topic: strange problem with adc in18f4550  (Read 6401 times)
0 Members and 1 Guest are viewing this topic.
picavr
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 263
-Receive: 100


« Reply #25 on: August 15, 2012, 11:27:59 23:27 »

Has I've said once before ISIS will work spot on and using the scope in ISIS will not show noise like it would in real time.
yes iknow there is a probleme
 work in isis = the  ADCON configuration is correct
work in isis = the  program is  correct  in 95%
isis cant simulate the noise or other physical influence

my problem is it work with atmega32 (program translated from bascom avr to proton picbasic)

******************PIC vs AVR*************************
****************************************************
and i have an information for all
in proton picbasic the program occupate 79.29% of32kb in 18f4550
in bascom avr its ocupate 92% of 32kb atmega32
in this case the 18f4550 is better (or picbasic is better then bascom avr !!?)
*********************************************************
 *********************************************************


Posted on: August 16, 2012, 12:16:48 00:16 - Automerged

Hi all,
Assuming that the ADC is working correctly now and assuming that the signal of the sensors changes slowly, you may connect the capacitors to the input of multiplexer (one for sensor) and ground for dynamically reduce the internal resistance of the sensor.

Bye
Pasca
no i cant use the capacitor big then 10nf ,because i am limited by the time (4052 used)
and with atmega32 there no capacitor use in the adc input

"""""""""""""""""""""""""""""NOTA"""""""""""""""""""""""""""""""
when i chortcut AN0 with 33k without signal i measure the voltage at AN0 =500mv !!!!!!!!!!!!!!!!!!!





Posted on: August 16, 2012, 12:24:28 00:24 - Automerged

yes iknow there is a probleme
 work in isis = the  ADCON configuration is correct
work in isis = the  program is  correct  in 95%
isis cant simulate the noise or other physical influence

my problem is it work with atmega32 (program translated from bascom avr to proton picbasic)

******************PIC vs AVR*************************
****************************************************
and i have an information for all
in proton picbasic the program occupate 79.29% of32kb in 18f4550
in bascom avr its ocupate 92% of 32kb atmega32
in this case the 18f4550 is better (or picbasic is better then bascom avr !!?)
*********************************************************
 *********************************************************


Posted on: August 16, 2012, 12:16:48 00:16 - Automerged

no i cant use the capacitor big then 10nf ,because i am limited by the time (4052 used)
and with atmega32 there no capacitor use in the adc input

"""""""""""""""""""""""""""""NOTA"""""""""""""""""""""""""""""""
when i chortcut AN0 with 33k without signal i measure the voltage at AN0 =500mv !!!!!!!!!!!!!!!!!!!




i thik this (500mv)  come from the mcu
in the datasheet there no information (only  in figure 21-3)
Logged
motox
Cracking Team
Active Member
****
Offline Offline

Posts: 187

Thank You
-Given: 255
-Receive: 319



« Reply #26 on: August 15, 2012, 11:41:45 23:41 »

The only possible thing I can imagine is a burnt pin.
What is the RA0 pin voltage with the pin floating?
Can you test with another PIC18F4550?
Logged
picavr
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 263
-Receive: 100


« Reply #27 on: August 15, 2012, 11:53:28 23:53 »

yes i tesed it with two other mcu ,,,the same result

Posted on: August 16, 2012, 12:45:58 00:45 - Automerged

i change to an3 ,,,the same result
Logged
motox
Cracking Team
Active Member
****
Offline Offline

Posts: 187

Thank You
-Given: 255
-Receive: 319



« Reply #28 on: August 16, 2012, 12:09:21 00:09 »

Is the 4052 connected to the AN0 and AN5? Or are the PIC pins only pulled to ground by the 33k resistors?

Try to isolate the problem. Isolate the AN0 pin and forget the rest of the board.
Hold the PIC in reset and measure the RA0 pin voltage (pin must be floating). Insert the pull down resistor and repeat the measurement.
Write a small program to test only the ADC channel 0 with the pull down resistor. Measure again the voltage with the ADC running.

Tell me all the results.
Logged
picavr
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 263
-Receive: 100


« Reply #29 on: August 16, 2012, 12:21:37 00:21 »

Is the 4052 connected to the AN0 and AN5? Or are the PIC pins only pulled to ground by the 33k resistors?

Try to isolate the problem. Isolate the AN0 pin and forget the rest of the board.
Hold the PIC in reset and measure the RA0 pin voltage (pin must be floating). Insert the pull down resistor and repeat the measurement.
Write a small program to test only the ADC channel 0 with the pull down resistor. Measure again the voltage with the ADC running.

Tell me all the results.
you can see at photo transmited ,now i work only with AN0
all the result transmitet are with AN0
AN0 free result=1023
AN0 chortcuted with gnd (near 7805) =3
 AN0 chortcuted with 33k gnd   =100  (voltage measured =arround 0.6V)
AN0 chortcuted with 2.2k gnd   =15  (voltage measured =arround 0.05V)

no change
Logged
motox
Cracking Team
Active Member
****
Offline Offline

Posts: 187

Thank You
-Given: 255
-Receive: 319



« Reply #30 on: August 16, 2012, 01:18:29 01:18 »

You forgot this measurement:

- Hold the PIC in reset and measure the RA0 pin voltage (pin must be floating - remove the 33k resistor). Check if the measured voltage corresponds to a floating pin. Tip: while measuring put one finger in the multimeter tip and with the other hand touch first the positive side of the power supply and then the ground. The multimeter should show the voltage rising and falling according to where you touch.

- Insert the pull down resistor and repeat the measurement.

Posted on: August 16, 2012, 01:34:02 01:34 - Automerged

I have a doubt:
Capter 10.1: The TRISA register controls the direction of the RA pins, even when they are being used as analog inputs.
The user must ensure the bits in the TRISA register are maintained set when using them as analog inputs.

I checked that, they are set to input.

Posted on: August 16, 2012, 01:56:02 01:56 - Automerged

but "AN0 free result=1023" looks like a pull-up.
Yeah, but this micro doesn’t have a pull-up on RA0/AN0 pin. According to his info, this ‘pull-up’ is limiting the current to around 20uA…don’t know where it comes from…
« Last Edit: August 16, 2012, 12:28:55 12:28 by motox » Logged
picavr
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 263
-Receive: 100


« Reply #31 on: August 16, 2012, 12:46:19 12:46 »

hello every bady
mclre is desactivated,i will activated for test

Posted on: August 16, 2012, 01:26:48 13:26 - Automerged


case 1
 -system off (vdd=0) ( lcd off)
 -then hold on reset
-system on (vdd=5v) (lcd on but no caractere on lcd)
voltage mesured on an0:
an0 free =5v
an0 33k with GND =40mv (0.04v)

case 2
-system on(vdd=5v) (lcd active)
 -then hold on reset
 
voltage mesured on an0:
an0 free =5v
an0 33k with GND =0.6v

i can see there the voltage decrease in case 1 (0.04v<0.5v)

Logged
motox
Cracking Team
Active Member
****
Offline Offline

Posts: 187

Thank You
-Given: 255
-Receive: 319



« Reply #32 on: August 16, 2012, 01:35:10 13:35 »

My conclusion is the PICs are broken.
I use the PIC18F4550 a lot and never experienced something like that.
Logged
Pasca
Newbie
*
Offline Offline

Posts: 34

Thank You
-Given: 27
-Receive: 42


« Reply #33 on: August 16, 2012, 01:42:42 13:42 »

My conclusion is the PICs are broken.
I use the PIC18F4550 a lot and never experienced something like that.
I would not be so sure.

@picavr
Please can you repeat case 2 without initialize adc in software?
Can you connect oscilloscope probe on AN0 when res 33k is connect between AN0 and GND in normal operation mode (ADC run) to see what signal is there?
If you dont have oscilloscope can you connect parallel 100nF or more capacitor to 33k res and verify that voltage across res decreases?
I'm sorry, but you have to be tough to win it.

Bye
Pasca
« Last Edit: August 16, 2012, 01:56:57 13:56 by Pasca » Logged

More I know, more I need to know. Less I know, meglio sto!!!
picavr
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 263
-Receive: 100


« Reply #34 on: August 16, 2012, 03:02:13 15:02 »

bingo!!!
i make a new poor pcb (attached)
and there is no noise
33k attached at an0 and gnd the result is 0 yes ZERO
an5 free =15

you can see the result on lcd
an515v => an5=15 (15/1023)

an00v => an0=0 (0/1023)

i think the problem is not the GND plane ,because in the new one ,the pcb is not goood

but in the new pcb all other pin are free
i will cut all other pin in my real pcb and i will post the result

Posted on: August 16, 2012, 03:29:12 15:29 - Automerged

AND THE PROBLEM IS RESOLVED
I FOUND THAT THE PIN AN1 IS PULL UP WITH 12V (NOT 5V) by an 4.7k  witout zener diode (5.1v)
thank to all

(((((((((((((((((((((((((((((((((((((((((((((( IN 18f4550))))))))))))))))))))))))))))))))))))))))))))))
if you pulled up a adc input with a voltage (  >vdd) by a resistance you are in PROBLEM
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Logged
motox
Cracking Team
Active Member
****
Offline Offline

Posts: 187

Thank You
-Given: 255
-Receive: 319



« Reply #35 on: August 16, 2012, 03:19:00 15:19 »

Picavr, next time provide a complete schematic like I asked before:
The above schematic doesn’t correspond to your hardware. Show us a complete schematic.

I FOUND THAT THE PIN AN1 IS PULL UP WITH 12V (NOT 5V) by an 4.7k  witout zener diode (5.1v)
If I knew about that circuit I would told you to check that in the first place.
Logged
picavr
Active Member
***
Offline Offline

Posts: 173

Thank You
-Given: 263
-Receive: 100


« Reply #36 on: August 16, 2012, 05:47:46 17:47 »

i think after that:
then pic18f (or all pic) mcus ar note overprotected in adc mode
for the complete pcb   all pin (an0-an5) are protected  by a zener diode 5.1v
but in an1 it not placed (missed)
***************************************************************************************************
*before this project ,i cant imagine an analogic input pulled up to voltage (> 5v) can cause this phenomene in other analogic pins    *
***************************************************************************************************

i have some experience with pic  ( 1999-2005) and after with avr (2006-2012) ,never imagine 
thanks for all
Logged
Pages: 1 [2]  All
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC