Read timer registers

Hello all of You, I need help for a problem with timers.
I want to use interrupt to measure a time, and I want to make it as short and simple as possible. Within the Interrupt Service Routine I want to read the Timer, and to restart it.
To achieve this I loaded the timerone-library as well as the timerthree-library into my IDE, mostly because there is a description to this library:

read()
Reads the time since last rollover in microseconds.

(Arduino Playground, description of timer1 library)

However this is not working, and the compiler does not accept it. This is no wonder, neither in the library files .ccp nor .h is included a thing like that. (Is this a mistake?)

However, I know, there is a readable timer register (16bit). Is there a way to read this register in Arduino-C ? What library have I to use?

Many thanks an a Happy New Year

mariner

I think you need to describe exactly what you want to time, what duration you are measuring and what accuracy you need.

All of the Atmega registers are accessible in Arduino code.

...R

ThankYou, Robin2, and a Happy New Year. I could not solve this problem sticking to the official way of Arduino programming. There ist nothing mentioned like that in the Reference nor in the offical libraries.
However I learned in various websites, that all timer registers and probably all Special Function Registers are accessible under their name given in the Atmega datasheet, without declaring them before.
That must mean, that all these names, there are maybe more than 200, are in fact protected names. This is not mentioned within the offical Reference.
If someone by chance is using one of these names for other purposes, he will encounter strange effects.
Greetings
mariner

mariner:
There ist nothing mentioned like that in the Reference nor in the offical libraries.

A major shortcoming of Open Source Software is the fact that the authors much prefer writing code to writing documentation - and there is no money to pay documentation writers.

The assumption is that you will read the source code to find answers. But no thought is given to the possibility that you may not know the questions.

May I assume that you have now solved your problem?

...R

Hello Robin2, so far this problem is solved. But, You know the next problem is just around the corner.
I have some experience in assembler programming, and I find this special Arduino-C is in fact more difficult. They should implement a possibility of using assembler into the IDE.
Greetings
mariner

They should implement a possibility of using assembler into the IDE.

"They" have, in a couple of different ways. The IDE uses avr-gcc, which is well documented on the web. Or, you can use Atmel Studio to do anything you want.

Hello jremington, yes, I thought about Atmel Studio. However, setting up the Arduino IDE on your computer and get it running is very easy, in fact more easy than with any other programming system. This may be the the most important advandage of the Arduino system. In a pedagogical point of view, there are many strange things e.g. the nomenclature. This makes it unneccesarily difficult for beginners.
Greetings
mariner

I have some experience in assembler programming, and I find this special Arduino-C is in fact more difficult. They should implement a possibility of using assembler into the IDE.

There is no problem to use an ASM inside of normal Arduino code but many things you can do directly via C commands. I don't think that assembler should implemented by some special way. You can start reading here: Inline Assembler Cookbook.

Another problem is about some advanced features for debugging and testing. Native IDE is poor for this so you have to use Atmel Studio or something other. Many plugins exist for Atmel Studio. It is able to develop Arduino code directly in AS. See this: http://www.visualmicro.com.
I'm using the old Visual Studio 6.0 with couple features developed by myself for coding, simulating and testing on PC. Also Atmel Studio with Arduino plugin for debugging, partially customized by myself for my needs and of course Arduino IDE mainly just for uploading.

mariner:
In a pedagogical point of view, there are many strange things e.g. the nomenclature. This makes it unneccesarily difficult for beginners.

I wonder ...
I would not expect beginners to be equipped with any "nomenclature" baggage so I can't see how it would make things difficult.

However I can see that a person already expert in C/C++ or assembler programming might find it strange and feel like fighting against simplifications that I find very useful.

I dislike C/C++ but I have found the Arduino system makes it reasonably painless.

...R

Hello Robin2, this arduino nomenclature reminds me on the way, some parents talk to their baby. They try to simplify the langugage in order to make it easier for the baby to understand. However, the baby must now learn two different languages, at first this "babytalk" then afterwards the real language.
I am not a Computer freak or a nerd. I started this programming business "in the old days", when no higher language was available, and You had to do everything direkt in machine language. In the beginning I had a hex-editor as a real luxury, that means i had not to programm single bits, but could write in bytes. Only when the first Commodore C64 appeared on the market, I had the chance to use a real assembler with symbolic names. I never got familiar to BASIC, but continued with C.
So I am quite experienced with the programming nomenclature, and I see no sense in inventing a "baby language" for writing programms.
Greetings
mariner

So I am quite experienced with the programming nomenclature, and I see no sense in inventing a "baby language" for writing programms.

So don't waste your time with the Arduino IDE, download Atmel Studio and get to work. Atmel Studio is as good as it gets, and it is free.

For the most painless programming, you will need a different programmer.

mariner:
So I am quite experienced with the programming nomenclature,

That was my point. If you did not have that experience you would have no yardstick for criticism. If a newbie ever only needs to program an Arduino they can live all their life with what you call "baby talk" quite happily.

I am quite content with C/C++ baby talk. I will keep my adult brain for Python and Ruby.

I actually think that the problems newbies face have little to do with any specific language but rather have to do with universal concepts like loops, arrays, comparisons etc. And even the very basic fact that a computer is monumentally stupid and has to have everything set out for it in ridiculous detail.

...R