Internal pullup problem

I made a minimum system atmega328 smd with an external 16mhz xtal, I checked all the pins with a multimeter and there was no connection to ground or vcc. then I checked using serial monitor on the digital pin using INPUT_PULLUP, but pins 6 and 7 changed from logic high and low randomly. why does this happen and how to fix it?
Sch



Is that Arduino pins 6 and 7 or physical pins on the chip? For the latter it's far preferred to refer to them as PBx or PCx or PDx as there are various SMD packages.

Please show your schematic.

Note:
I can probably not help you.

2 Likes

...and in addition to the schematics, If you also showed us your code we could understand better

I add schematic
i using optiboot bootloader from minicore 2.2.2.

I add schematic

The SI abbreviation for hertz is Hz, with a capital H, as it is named after Heinrich Hertz.
m stands for milli. M stands for Mega

So you mean a 16MHz xtal.

Good Grief. That nit didn't need picking. I believe we all know what he ment.

I can't recall the last time I came across a 16 milli-hertz crystal.

1 Like

Sorry, but it's one of my pet hates.

Yes, 16000hz

You still did not state which pins 6 and 7 are. With the chance that I'm wrong, the analog pins ADC6 and ADC7 are analog inputs only; you can not read them with digitalRead(), you can not write the with digitalWrite() and they do not have internal pull-ups.

Pin 6 is PD6 phisical pin is pin 10
pin 7 is PD7 phisical pin is pin 11

In that case I'm afraid that I do not know the answer for your problem.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.