View previous topic :: View next topic |
Author |
Message |
ulihuber
Joined: 16 Mar 2005 Posts: 5
|
Posted: Wed Mar 16, 2005 10:02 am Post subject: Problem with getrc() |
|
|
Hi all,
I am new to this group and just starting with AVRs. Reason for my posting is a problem with a preprogrammed AT90S2313. I don't have access to the code but I know that the application was programmed with basic. As I am very interested in this system, I try to solve a problem without having access to the full code to give hints to the developer.
Yes, you are right, strange approach......
There are 3 values to be read from potis which is done with
P_faktor = Getrc(pinb , 2)
I_poti = Getrc(pinb , 1)
D_faktor = Getrc(pinb , 0)
Those statements are part of the original code and were submitted to me by the developer.
Now to the strange effect: While first two lines result in a proper value, the third doesn't. Viewed on the scope, I can see short positive pulses on all three pins, but only the two first have the typical capacitor discharge curve which changes when the potis are adjusted.
The third one (Pin12) is just a rectangular shape. No discharge curve at all. It looks like there is just a low resistant switch at work.
The developer swears, that there are no interrupts at work and no changes to output regeisters etc.
Do you have any idea about the reason of Pin 12 not working ?
Best regards
Uli |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Wed Mar 16, 2005 12:47 pm Post subject: |
|
|
Hi!
- Was it working before and suddenly just stopped?
- Did you get the preprogrammed AT90S2313 alone or on a PCB?
- Does the system of the developer work OK? (Only yours is not OK).
- Are you the only customer for the developer? (The code is only for you).
Luciano |
|
Back to top |
|
|
ulihuber
Joined: 16 Mar 2005 Posts: 5
|
Posted: Wed Mar 16, 2005 1:08 pm Post subject: |
|
|
Hi Luciano,
the processor is for a project which was developed in a cnc forum. So it is not a special project for me.
The PCB comes from this project too. I have two of them and everything cross checked. There is just the RC to ground on this pin.
It never worked for me - the developer made checks, i.e output of calculated values through RS232 and he is sure about a proper function. But he has no equipment to measure what is going on with the pin. I got new processors from him and they don't like me too (
I heared about others having the same problem with this processor.
Uli |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Wed Mar 16, 2005 3:39 pm Post subject: |
|
|
Code: |
On your PCB, what are the values of the resistors and capacitors?
PIN 12 (PB0) =
PIN 13 (PB1) =
PIN 14 (PB2) =
+--------+
| |
| 2313 |
| |
| | R?
| x |---------/\/\/\/-
| | ^
+--------+ |--------+
|
|
-----
----- C?
|
|
GND
|
|
|
Back to top |
|
|
RickB
Joined: 27 Jan 2005 Posts: 29 Location: Eugene, Oregon USA
|
Posted: Wed Mar 16, 2005 3:55 pm Post subject: |
|
|
Uli:
If you move the pot on the nonworking pin to a working pin and the working pot to the nonworking pin, does the problem move with the pot or stay with the pin?
Rick |
|
Back to top |
|
|
ulihuber
Joined: 16 Mar 2005 Posts: 5
|
Posted: Wed Mar 16, 2005 4:27 pm Post subject: |
|
|
Hi Luciano,
it is identical on all pins:
R=10 k
C=10nF
@RickB:
I did not yet move RC to other pins. But I checked the board and replaced poti and capacitor. And the problem exists on my two boards.
Uli |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Wed Mar 16, 2005 5:55 pm Post subject: |
|
|
Hi Uli,
I don't know if possible, but try to set the three potentiometers in
the center position (5k) and compare the three discharge curves
with the oscilloscope. They should be identical.
Luciano |
|
Back to top |
|
|
ulihuber
Joined: 16 Mar 2005 Posts: 5
|
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Wed Mar 16, 2005 7:20 pm Post subject: |
|
|
Hi Uli,
The 3 PINs are set the GND after the same time after reset.
(Compare the 3 pictures).
All the 3 pins have a problem.
Send these 3 JPG files to the developer.
Luciano |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Thu Mar 17, 2005 1:55 am Post subject: |
|
|
Hi Uli,
Click on the two links below and you will download the files GETRC.BMP
and GETRC_ALL.BMP.
(You will see some advertisement during the download process).
The GETRC.BMP file depicts my oscilloscope screen during the discharge
of the capacitor in GETRC with C=10nF and R=4.7K. As you will see, at the end
of GETRC the voltage on the MCU pin is about 2 volts.
(On your pictures the voltage goes down to GND).
This link is valid for 7 days:
http://s32.yousendit.com/d.aspx?id=0GLVIRG61AVCG1HV5JNLDQARM7
The GETRC_ALL.BMP file depicts my oscilloscope screen during charging
and discharging of the capacitor in GETRC with C=10nF and R=4.7K.
As you will see the charging time is 50 ms in GETRC. At the end of the
discharge the voltage is about 2 volts and after 200 more ms about 0 volts.
This link is valid for 7 days:
http://s36.yousendit.com/d.aspx?id=288WQ9RS86HQ02PPXVB9RJVD5K
The test was done on PB2 of a Mega16.
(The PIN with Alternate Function AIN0 which is also the alternate
function of the PB0 of your MCU 2313).
Luciano |
|
Back to top |
|
|
ulihuber
Joined: 16 Mar 2005 Posts: 5
|
Posted: Thu Mar 17, 2005 1:38 pm Post subject: |
|
|
Hi Luciano,
thank you very much for your work in analysis of my problem.
Yes, you are right: All Pins are pulled to ground at the same moment. I hope that the developer can find a reason for it. Up to now he says, there were no port initialisations until the getrc's are completed.
Best Regards
Uli |
|
Back to top |
|
|
Luciano
Joined: 29 Nov 2004 Posts: 3149 Location: Italy
|
Posted: Thu Mar 17, 2005 10:10 pm Post subject: |
|
|
Hi Uli,
Click on the link below and you will download the file GETRC_2CH.BMP.
(You will see some advertisement during the download process).
The GETRC_2CH.BMP file depicts my oscilloscope screen during the
charging and discharging on two PINs of a Mega16.
(Cut and paste of two oscilloscope screens).
In my code the function GETRC() is called twice in a loop.
As you can see, the second function call begins immediately after
the first function call ends.
When I look at your 3 JPEG pictures I see that the second and third
function calls begin before that the first function call ends.
(Observation based on the signal present on the reset pin).
This link is valid for 7 days:
http://s10.yousendit.com/d.aspx?id=13XB8T43N6IFJ2L7VVI8CQQJ9A
Luciano |
|
Back to top |
|
|
|