Attiny 85: Reading and writing servo signals

Hello community,

i'm back at the keyboard, andd for the first time moving away from my beloved nano to try out the attiny 85 board (with micro usb).

Project description: A sequencing unit to receive a servo signal (pwm range 700-2300ms) from an RC receiver, and control 2 servo signals according a predetermined sequence. Servo 1 must be delayed while an electric motor is running. I will also need a "setup routine" to adjust servo 1 end positions.

Summary of inputs/outputs:

Input 1: PWM Servo signal from receiver Input 2: Voltage input from electric motor Input 3: Pushbutton "up" to change servo position during setup Input 4: Pushbutton "down" to change servo position during setup Input 5: Pushbutton "Enter" to confirm during setup Output 6: PWM Servo 1 signal Output 7: PWM Servo 1 signal

Sooo heres problem 1: i need 2 more signal than i can handle on the attiny (5 i/o pins). I was planning on handling this by splitting up the up, down and enter to different resistors on the same channel, to give 3 different voltages to 1 analogRead pin. According to the read voltage the position will be increased or decreased or confirmed.

I'm sure i will encounter other problems, but my main question is: Can i use the attiny for this?

I want to use:

Blue 4: PWM Servo input (interrupt routine?) Blue 3: Voltage read electric motor. Blue 2: Voltage read of the up/down/enter buttons. Blie 1 & 0: Servo outputs

Can i go with this setup? Where do you see problems? Restrictions?

Thanks for your thoughts

How do you intend to program it..?

What do you mean?

I have a rough program layout in my head, but will start building it once i have the hardware reqirements cleared up.....thats my initial question

Pin 5 and 6 can do PWM using timer0 so that's good

I would use pin 7 for your servo input since that is where INT0 is

Other than that, everything looks okay.

Miniflyer: What do you mean?

I have a rough program layout in my head, but will start building it once i have the hardware reqirements cleared up.....thats my initial question

Exactly what I said.

If you program using Digispark, it will use up an amount of memory for the bootloader and be slow to boot. If you use usbasp programmer, none of the above.

If latter, you may need to disconnect certain things during programming.

bluejets:
Exactly what I said.

If you program using Digispark, it will use up an amount of memory for the bootloader and be slow to boot.
If you use usbasp programmer, none of the above.

If latter, you may need to disconnect certain things during programming.

https://m.de.aliexpress.com/item/606895785.html

This is what im planning to use,i have 2 of them here. Connected to the arduino ide…

|500x379

If P5 is Reset, can i use it as an input/output? According to the diagram it should work. If so i have just gained 1 channel which i can use for a status LED.

So my plan is:

P0: Servo 1 Output P1: Servo 2 Output P2: PWM Servo signal from receiver P3: Status LED P4: Pushbuttons 1+2+3 P5: Motor voltage read

Any showstoppers here? Will start on the program structure now.

First question: how do i adress the pins in the arduino IDE? PB0/1/2...? P0/1/2...? Do i use the black pin numbers?

Thanks :)

Currently writing the code on a nano, its much easier for debugging…