# Grounding GPIO pins during 8051 programming

I'm trying to make a programmer for the 8051 microcontroller IC's, specifically the AT89C2051. I saw a circuit online (the blowit programmer) in which the unused GPIO pins are left floating.

When the 8051 is in normal execution mode, the outputs are always high-impedance or grounded, and applying external ground never hurts the IC, but applying external VCC causes the IC to not operate correctly if I set a logic low on the same GPIO pin in software.

I checked the datasheet and it does not mention anything about the state of the pins that are not used when programming the IC.

I'm curious. For this IC or any other 8051 based IC, is it a problem if I ground all unused GPIO pins during programming?

I also think if I can do that, then a side benefit would be less noise, but then again I'm not sure if that benefit applies because each GPIO pin has an internal pull-up resistor.

• Those use a high ($12\:\text{V}$) programming voltage. The datasheet, from page 4-20 through 4-22, tells you what to do. As far as the remaining pins, do NOT do anything with them. They should float. If you aren't instructed to ground a pin, then don't. The default is to assume N/C (no connection) unless stated otherwise. (Do note that P1 may operate in either direction, input or output, depending on what you are doing at the time.) – jonk Jun 15 '19 at 5:48
• Wow, it's been a while since I saw the AT89C2051 being used in a new design, which isn't so surprising considering that its new price is pretty steep, because it's basically only used where someone has a verified design and needs the original, >25 years old microcontroller. Are you sure you want to go through cost and effort to work with this microcontroller? There's significantly cheaper, yet better, MCUs available, and there's cheaper, yet better, programming and debugging hardware for them. – Marcus Müller Jun 15 '19 at 6:41
• @MarcusMüller I got tubes of them "back in the day." (I hadn't known at the time how many I might need.) I used for them for a push-button "Jeopardy" game allowing up to 8 game players in once case and a cheap hobbyist power supply supporting both constant voltage and constant current modes in another case. I have many left over. I might use them in a new project where I had existing useful code floating about that I could "borrow" to push along another project. (Given that the new price is steep, perhaps I should go market the stupid things. They were very cheap when I bought them.) – jonk Jun 15 '19 at 6:54
• nice! Yeah, "steep" isn't the right word – they're still about 1 US peso each, but cheapo 8-bitters come at half that. I also think it's worthwhile having a bunch of "I know exactly how to program these to fulfill an easy job" MCUs lying around, for whenever you need something that does something after something pushed some button or so. – Marcus Müller Jun 15 '19 at 6:59
• @MarcusMüller Well, crap. That's about what I paid for the darned things. Yup, lots of MCUs are cheaper and I use them today: PIC10(L)F322 for example. But you get a lot of pins for USD1. Thanks for the link. I will take down my "sell" page now. (hehe.) – jonk Jun 15 '19 at 7:08