Pages: [1]   Go Down
Author Topic: Using the timers on ATmega2560  (Read 363 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 19
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi
So far very impressed with the ATmega2560 board, have got it talking to an intelligent touch screen LCD display and my laptop.
Also controlling heavy duty hydraulics system.
BUT what I need to do now is utilise the timers in the chip and the only Arduino drivers are PWM which is not what I want to.
I am guessing I can write to chip registers directly but think that some of the timer counters are probably being used by the system.
Is there somewhere I get info on what the system uses and whats left available to me.
Also would like more info on how the seial ports are controlled by Serial.write etc i.e. is the source code for these drivers available.
Thanks in advance
Phil
Logged

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19306
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Without using libraries, only Timer 0 would be used (for millis() and delay() ).

Serial uses Tx0/Rx0.  Serial1 uses Tx1/Rx1. And so on for Serial2 and Serial3.
Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Global Moderator
Melbourne, Australia
Offline Offline
Brattain Member
*****
Karma: 511
Posts: 19306
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The source is all in the install directory. In my case HardwareSerial is in:

Code:
C:\Documents and Settings\Owner\Desktop\arduino-1.0.3\hardware\arduino\cores\arduino\HardwareSerial.cpp

Yours will vary a bit depending on where you installed it.
Logged

http://www.gammon.com.au/electronics

Please post technical questions on the forum - not to me by personal message. Thanks a lot.

Pages: [1]   Go Up
Jump to: