Reply by Ryan Weihl December 15, 20052005-12-15
richardscheff@gmail.com wrote:
>> He has a AT89C4051 it can sink 20ma per pin. The regular 8051 of course can >> not. The AT89C4051 can not source enough current to drive an LED. >> >> It is all in the data sheet. > > I realy don't care that much about driving an LED. > > I just looked at the design to see if I missed anything. > > The only thing I got to work for about 5 minutes is that one pin would > either go high or low based on another pin. > > It worked after I changed my capacitor from 10uF to 1uF. I got so > exited that I tried to run part of my origanal program which is to > generate a 40khz pulse. > > The original problem happened. All pins are high except both analog > pins. > So I reloaded the working program, in hopes to prove that maybe my code > is bad. > The problem persists. All pins are high except the analog pins. > > > I have 5 chips to play with and three so far exhibit the same results. > I can not imagine that they are all bad. > > I'm left to believe that I can not use Keil as a reliable > compiler/assembler. > Or that my programmer is not working. > But if it programs and reads a chip exactly as it was programmed, I > can't imagine it being the problem. > And if I try running a hex file I downloaded and it still does not > work, it probably isn't Keil either. > > > The circuit is simply power, ground, capacitor connected to reset and > 5V, external oscillator connected to pin5. > > All that is left is to turn the chip around so that the notch is not > pin 1. >
can you tell me the URL of your program. would like to try to run it here. rw
Reply by Neil Kurzman December 15, 20052005-12-15

richardscheff@gmail.com wrote:

> > He has a AT89C4051 it can sink 20ma per pin. The regular 8051 of course can > > not. The AT89C4051 can not source enough current to drive an LED. > > > > It is all in the data sheet. > > I realy don't care that much about driving an LED. > > I just looked at the design to see if I missed anything. > > The only thing I got to work for about 5 minutes is that one pin would > either go high or low based on another pin. > > It worked after I changed my capacitor from 10uF to 1uF. I got so > exited that I tried to run part of my origanal program which is to > generate a 40khz pulse. > > The original problem happened. All pins are high except both analog > pins. > So I reloaded the working program, in hopes to prove that maybe my code > is bad. > The problem persists. All pins are high except the analog pins. > > I have 5 chips to play with and three so far exhibit the same results. > I can not imagine that they are all bad. > > I'm left to believe that I can not use Keil as a reliable > compiler/assembler. > Or that my programmer is not working. > But if it programs and reads a chip exactly as it was programmed, I > can't imagine it being the problem. > And if I try running a hex file I downloaded and it still does not > work, it probably isn't Keil either. > > The circuit is simply power, ground, capacitor connected to reset and > 5V, external oscillator connected to pin5. > > All that is left is to turn the chip around so that the notch is not > pin 1.
1> Kiel is a Very good product. The Demo Version is limited. 2> the Metalink assembler is free. 3>here is a link to someones working board http://chaokhun.kmitl.ac.th/~kswichit/Proto2051_web/Proto2051.html The Basic setup 10 Gnd 20 Vcc with a .1uF ceramic cap to gnd. 1 Reset 10uF to Vcc and 10K to gnd 5 Ocs In IF you are using square wave oscillator with a TTL output. If you are using a Crystal it goes from 4 to 5 with a 22pf cap to gnd on each one. 4> www.8052.com is a good place for 8052 based information. 5> Are you sure your code is working? try to write 0 to a port, 100 NOPs write FF to the port, then jump back to 0. Or Google for a demo hex file. Good luck. PS the Notch IS pin 1 if the notch is to your left pin1 is the bottom left pin.
Reply by December 14, 20052005-12-14
> He has a AT89C4051 it can sink 20ma per pin. The regular 8051 of course can > not. The AT89C4051 can not source enough current to drive an LED. > > It is all in the data sheet.
I realy don't care that much about driving an LED. I just looked at the design to see if I missed anything. The only thing I got to work for about 5 minutes is that one pin would either go high or low based on another pin. It worked after I changed my capacitor from 10uF to 1uF. I got so exited that I tried to run part of my origanal program which is to generate a 40khz pulse. The original problem happened. All pins are high except both analog pins. So I reloaded the working program, in hopes to prove that maybe my code is bad. The problem persists. All pins are high except the analog pins. I have 5 chips to play with and three so far exhibit the same results. I can not imagine that they are all bad. I'm left to believe that I can not use Keil as a reliable compiler/assembler. Or that my programmer is not working. But if it programs and reads a chip exactly as it was programmed, I can't imagine it being the problem. And if I try running a hex file I downloaded and it still does not work, it probably isn't Keil either. The circuit is simply power, ground, capacitor connected to reset and 5V, external oscillator connected to pin5. All that is left is to turn the chip around so that the notch is not pin 1.
Reply by Neil Kurzman December 14, 20052005-12-14

Meindert Sprang wrote:

> <richardscheff@gmail.com> wrote in message > news:1134443700.200259.92680@z14g2000cwz.googlegroups.com... > > I set up my circuit exactly as you described. It still does not work. > > I was hoping someone might have experienced this problem and know the > > solution. All pins are high except for the two analog comparators. > > > > I was looking at the circuit sschematic with the LEDs. It looks like > > the 8051 is acting as the ground for the LEDs and not the power supply. > > Does that mean that pins are designed to be open to ground or closed. > > Sort of. Read below. > > > My design is for the 8051 to supply the 5V for the LEDs. > > Is this why the pins are acting opposite to what I expect? > > Supplying 5V from a 8051 to a LED is not possible. A 8051 pin is actually an > open-drain output with a weak pull-up current source. So the output can sink > (flow to ground) few milliamps, enough to drive a led. But it can source > (supply from VCC) only 50 micoamps which is not enough to drive a LED. > > You should really read a datasheet about this, where it is all described. > > Meindert
He has a AT89C4051 it can sink 20ma per pin. The regular 8051 of course can not. The AT89C4051 can not source enough current to drive an LED. It is all in the data sheet.
Reply by Meindert Sprang December 13, 20052005-12-13
<richardscheff@gmail.com> wrote in message
news:1134443700.200259.92680@z14g2000cwz.googlegroups.com...
> I set up my circuit exactly as you described. It still does not work. > I was hoping someone might have experienced this problem and know the > solution. All pins are high except for the two analog comparators. > > I was looking at the circuit sschematic with the LEDs. It looks like > the 8051 is acting as the ground for the LEDs and not the power supply. > Does that mean that pins are designed to be open to ground or closed.
Sort of. Read below.
> My design is for the 8051 to supply the 5V for the LEDs. > Is this why the pins are acting opposite to what I expect?
Supplying 5V from a 8051 to a LED is not possible. A 8051 pin is actually an open-drain output with a weak pull-up current source. So the output can sink (flow to ground) few milliamps, enough to drive a led. But it can source (supply from VCC) only 50 micoamps which is not enough to drive a LED. You should really read a datasheet about this, where it is all described. Meindert
Reply by Ryan Weihl December 13, 20052005-12-13
richardscheff@gmail.com wrote:
> I set up my circuit exactly as you described. It still does not work. > I was hoping someone might have experienced this problem and know the > solution. All pins are high except for the two analog comparators. > > I was looking at the circuit sschematic with the LEDs. It looks like > the 8051 is acting as the ground for the LEDs and not the power supply. > Does that mean that pins are designed to be open to ground or closed. >
the port pins are outputs, you set them low or high. As wired if you make them low it will turn on the LED
> My design is for the 8051 to supply the 5V for the LEDs. > Is this why the pins are acting opposite to what I expect? >
yes rw
Reply by December 12, 20052005-12-12
I set up my circuit exactly as you described.  It still does not work.
I was hoping someone might have experienced this problem and know the
solution.  All pins are high except for the two analog comparators.

I was looking at the circuit sschematic with the LEDs.  It looks like
the 8051 is acting as the ground for the LEDs and not the power supply.
 Does that mean that pins are designed to be open to ground or closed.

My design is for the 8051 to supply the 5V for the LEDs.
Is this why the pins are acting opposite to what I expect?

Reply by Ryan Weihl December 12, 20052005-12-12
Ryan Weihl wrote:
> richardscheff@gmail.com wrote: >> The oscilator is 20MHz. Should that make a difference. >> I have tried the reset connected to a cappacitor to 5V. >> And I have tried the reset connected to ground. >> Atmel says the reset is suposed to be raised high for 2 machine cycles >> and then set low. >> So I have manually raised it and set it low. >> That has no effect. >> > 20 MHz should be ok, but check the marking on the chip. > I had them in 14MHz also. > Reset: I connect pin 1 10uF or so to +5V and 10k to ground. > rw
found this in my bookmarks: www.iguanalabs.com/2nd2051.htm re
Reply by Ryan Weihl December 12, 20052005-12-12
Ryan Weihl wrote:
> richardscheff@gmail.com wrote: >> The oscilator is 20MHz. Should that make a difference. >> I have tried the reset connected to a cappacitor to 5V. >> And I have tried the reset connected to ground. >> Atmel says the reset is suposed to be raised high for 2 machine cycles >> and then set low. >> So I have manually raised it and set it low. >> That has no effect. >> > 20 MHz should be ok, but check the marking on the chip. > I had them in 14MHz also. > Reset: I connect pin 1 10uF or so to +5V and 10k to ground. > rw
oh ' make sure you have an "F" on the bottom side. there was a note from atmel in 2002 that any 2051 before revision "F" had a problem about high current when shut off. rw
Reply by Ryan Weihl December 12, 20052005-12-12
richardscheff@gmail.com wrote:
> The oscilator is 20MHz. Should that make a difference. > I have tried the reset connected to a cappacitor to 5V. > And I have tried the reset connected to ground. > Atmel says the reset is suposed to be raised high for 2 machine cycles > and then set low. > So I have manually raised it and set it low. > That has no effect. >
20 MHz should be ok, but check the marking on the chip. I had them in 14MHz also. Reset: I connect pin 1 10uF or so to +5V and 10k to ground. rw