What is the lowest speed at which the ATmega328P can run?

I looked at the datasheet of the ATmega328P and although I am not the best at reading them, I saw there was some pins that were responsible for the clock, my question is can I slow down the ATmega328P to 1Hz by using an external clock? also as a bonus question, can I code the ATmega328P manually in binary?

Why would you want to slow down the processor so drastically ?

You could write a program in binary and upload it if you really want to

well, I wanted to once build a CPU but then I got lazy and lazy and even more lazy until the point at which I don't want to use a microprocessor but instead use my AtMega chip but I wish to code it in binary and to be able to actually see each command happen I want to run it at 1Hz

I answered that in the comment to UKheliBob. is it possible to do what my question was asking?

I believe the AT328P will work at DC. That is one clock cycle will be executed for every edge (not sure if rising or falling) of the external clock.

As for programming in binary, it is absolutely doable, although I have no idea how. I know an any compiler will generate the binary code. Perhaps this is a way to start.

:slight_smile: thank you Johny. I don't need a compiler I am going full chad mode and just using switches. is it possible you know any link to a datasheet that tells you the commands in binary the microcontroller can execute?

I doubt that you can slow the 328 down that much but you could possibly force the processor appear to execute instructions as infrequently as you like

Good luck programming the chip in binary. Do you mean assembly language or are you going direct to the metal and using machine code ?

I read it as "or going mental and using machine code" XD. yes i am using machine code dont question

The ATmega328 should run at 1 Hz CPU clock.

The complete processor data sheet describes all the machine instructions in complete detail, but you already know this, right?

1 Like

yup, I knew it....... (not rly but thx for telling me)

I do not know of one. Perhaps ask Atmel (Micorchip).

I won't question it having done it myself, albeit with a very simple microprocessor (the SC/MP), back in the 1970s

Mind you, it was either that or not program it at all because I did not have a computer to write assembler code on, let alone turn it into machine code for me

the only reason I am doing this in binary is to have full control over the processor because I want to make a DIY CPU and then a DIY mini computer that hopefully it will be able to run Snake and although you are able to do that with the normal Arduino it would take ages

Well, if that's what you want to do, then why not use one of the legacy microcomputer chips so you can work with the address and data busses directly?

You want CPU clock to work once every second. Cool, make sure you let us know how it goes

I am a bit worried to buy it just yet, I will see how the Arduino performs first

why do I smell a lot of sarcasm :face_with_raised_eyebrow:

not make the inbuilt clock work at 1Hz, I meant to have an external clock that pulses every 1Hz

This statement does not inspire confidence.

The ATmega328p can go down to 0 MHz but the change from cycle to cycle has to be less than 2%.

AVR® Instruction Set Manual (microchip.com)