| Author |
Message |
rikonor
Joined: 19 Feb 2008 Posts: 2
|
20 Feb 2008 15:41 Help concerning an AT89C2051 |
|
|
|
|
Hi
I'm trying to build a circuit with an Atmel AT28C2051,
It is supposed to recieve serial data on the serial port (RxD - pin 2 [port 3.0]).
However, no matter what code I write and burn onto it,
It shows "1" on all port pins (except port 1.0 % 1.1, which require external resistors, and since I'm not using those pins I did not use those resistors).
I tried writing many different programs (in C51, and of course included 'reg51.h') that are supposed to change the output levels to "0",
but it hasn't worked.
The microcontroller has an external clock (12mhz crystal and 2 22pF capcitors),
and an automatic reset (comprising of a 100kOhm resistor and a 1µF capacitor).
I read on the datasheet that after holding RST for 2 machine cycles the microcontroller is reset and all port pins are set to 'high'.
Is there anything wrong with the circuit or maybe the rom didn't get flashed at all?
(I used LEAPER-48 usb universal writer with the IC Writer program).
Help greatly appreciated,
thanks,
Or
|
|
| Back to top |
|
 |
Google AdSense

|
20 Feb 2008 15:41 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
nandhu015
Joined: 11 Feb 2006 Posts: 641 Helped: 46 Location: Tamilnadu, India
|
20 Feb 2008 17:21 Re: Help concerning an AT89C2051 |
|
|
|
|
At reset all the port pins of 2051 will be 1.
You have to change it at the startup (if you want)
Nandhu
|
|
| Back to top |
|
 |
laktronics
Joined: 06 Jan 2007 Posts: 945 Helped: 156
|
20 Feb 2008 18:21 Re: Help concerning an AT89C2051 |
|
|
|
|
Hi,
Do you mean that in your software you are trying to set port pins to zero, but it is not taking place?
If that is the case, check if your reset pin shows low voltage after power on, I mean it should be low after the initial reset pulse. If not low, correct the mistake, mostly in wiring. I would suggest you to use a 10uF capacitor with a 15K pull down at reset pin, even though your values may be also OK. The idea in reducing the resistance is to reduce the influence of the internal resistance and to make sure that the meter resistance will be less important while checking the reset pin voltage.
Another cause for all port pins being high can be due to failure of the oscillator, open/shorts in connections of the crystal, a bad crystal etc. Check osc.pin2 with a scope and see if small amplitude of oscillations exists. With a digital multimeter this pin should show around 2.5V, eventhough it may not confirm working of the oscillator.
Check continuity of ground pin to the controller by measuring Vcc across pins 10 and 20 on the chip itself.
If your programmer has verified correctly after programming, no need to worry about false programming, but if there is any mistake in your code, it may again fail to clear port pins.
Regards,
Laktronics
|
|
| Back to top |
|
 |