[Novize] Timer1 and its Prescaler Thingie

Hey guys!

I’m just about to Bit-Bang my EEPROM. But one thing decouples me from it sadly.

I already read about the prescaler to use if the frequency of the µC is way to large to have a nice µs value range. And I actually get the concept. But I don’t have an idea how to implement it practically.

As you can see I initialized the timer with 600µs. But since the prescaler story tells me that this won’t be real µs values I have to rethink all that. I need to use a prescaler of 8 if I want to have 600µs. And therefore I have to calculate 1200µs * 0.5µs since prescaler 8 has ~0.5µs per Tick. BUT: How do I know which prescaler I’ve used? Theres 1, 8, 64, 256 and 1024. I think prescaler “1” is default. But how can I change? I did not found any method to change them within TimerOne-Libary.
Or am I missing something?

I fact what I’m looking for all the time is something like “timer.setPrescale(8)” and then I can use “timer.initialize(1200)” and I have a 600µs timing.

#include <TimerOne.h>

void setup()
{
	Serial.begin(9600);
	TimerOne timer = TimerOne();
	timer.initialize(600);
	timer.start();
	timer.attachInterrupt(onInterrupt);


  /* add setup code here */

}

void loop()
{

  /* add main program code here */

}

void onInterrupt()
{
	Serial.print(".");
}

I'm just about to Bit-Bang my EEPROM.

That makes no sense.

Regardless of HOW you think you need to set the timer frequency, etc., you really need to explain WHAT you are trying to do.

I need to reach the EEPROM via the UNI/O Bus Protocol

UNI/O Datasheet <<<

Because Arduino does not support UNI/O I need to do it “manually” via bit-banging the bus. Still I need to keep certain pulse intervalls like Standy-pulse for 600µs etc.

Thats why I need to get sure the TimerOne.h will provide me with the fitting µs

I need to reach the EEPROM via the UNI/O Bus Protocol

The EEPROM (the one built into the Arduino) does NOT use that protocol.

An external EEPROM might. It behooves you to provide as much information as possible up front.

Both the serial clock and data are embedded together
through Manchester encoding.

Have you googled Manchester encoding and Arduino? I'm relative certain that this has been done before. No need to re-invent the wheel. If you want to anyway, at least look at how they dealt with the timer.

Guys Guys… :o I know enough about UNI/O. I just want to know how to set the prescaler (if needs to be set explicitly) in Timer1. So it’s a pure library specific questions :smiley:

Please try not to continue to the UNI/O mechanics etc. Already made that up :slight_smile: