Giter VIP home page Giter VIP logo

arduino-timerone's People

Contributors

ltalionis avatar

arduino-timerone's Issues

[fix included] mega and leonardo not supported

What steps will reproduce the problem?
1. make a sketch that uses pins 11 on mega.
2. Registers fail to setup (PORTB1 instead of PORTB5)
3. fails to get pwm on pin 11.

Included is a fix for Timer1.cpp that remaps the pins and ports according to 
the mcu.
It now works on mega and leonardo hardware.

Thank you,
Charles

Original issue reported on code.google.com by [email protected] on 21 Jul 2013 at 1:01

Attachments:

start() doesn't appear to work on Uno or Nano

// This code should flash the LED every second.
// However the start() function doesnt seem to work
// But resume() does.
// But resume doesn't reset the counter, hence its not possible to restart the 
counter from the beginning (time 0)



#include <TimerOne.h>

 int state=0;

void setup() 
{

  pinMode(13, OUTPUT);    

  Timer1.initialize(1000000); // set a timer of length 100000 microseconds (or 0.1 sec - or 10Hz => the led will blink 5 times, 5 cycles of on-and-off, per second)
  Timer1.attachInterrupt( timerIsr ); // attach the service routine here
  Timer1.stop();
  Timer1.start();
//Timer1.resume(); 
}

void loop()
{
  // Main code loop
  // TODO: Put your regular (non-ISR) logic here
}

/// --------------------------
/// Custom ISR Timer Routine
/// --------------------------
void timerIsr()
{
    state=state^1;
    digitalWrite( 13, state );
}





Original issue reported on code.google.com by [email protected] on 28 Nov 2013 at 1:24

ReadReceiver Sketch Incompatible with TimerOne-v8, works with TimerOne-v2

What steps will reproduce the problem?
1. Install timerone v8 & pinChangeInt library
2. Run ReadReceiver example sketch.
3. Connect RC receiver to pins D2, D3, and D4.
4. Run the sketch and open the serial monitor

What is the expected output? What do you see instead?
Upon inputting "p", some response should come back to the serial monitor, but 
nothing comes back.

After downgrading to TimerOne, v2, the ReadReceiver sketch operates as 
expected, and provides good times for the 3 RC channels.

I did not attempt this test with TimerOne-v7. 

What version of the product are you using? On what operating system?  Noted 
above.
Arduino 23, Windows 7, Arduino nano board

Please provide any additional information below.
Serial monitor data user TimerOne-v2:
PinChangeInt ReciverReading test
time:   0:1018  1:0 2:0 2
time:   0:1018  1:0 2:0 2
time:   0:1449  1:1670  2:1830  9
time:   0:470   1:1735  2:1830  12
time:   0:470   1:1735  2:1237  12
time:   0:2171  1:197   2:1237  15
time:   0:1171  1:1551  2:1569  108
time:   0:1171  1:1551  2:1569  199

When using TimerOne-v8, only the first line of text (from the setup portion of 
the sketch) is seen.  No times are ever printed.


Original issue reported on code.google.com by [email protected] on 11 Dec 2011 at 6:50

Proposed update

I'm new to this and not sure of the etiquette for proposing a change to 
existing libraries.

I started development of a timer using Timer1, but then came across your 
TimerOne library.  Rather than create something new, I'd like to propose some 
amendments, but I'm not sure how I go about it.

To give you a feel, my suggested amendments are as follows:

 *  - Add (long) assignments and casts to TimerOne::read() to ensure calculations involving tmp, ICR1 and TCNT1 aren't truncated
 *  - Ensure 16 bit registers accesses are atomic - run with interrupts disabled when accessing
 *  - Remove global enable of interrupts (sei())- could be running within an interrupt routine)
 *  - Counter reset to 1 rather than zero.  Datasheet vague on this, but experiment shows that overflow interrupt 
 *  - flag gets set whilst TCNT1 == BOTTOM, resulting in a phantom interrupt.  Could code around, but unnecessary complexity
 *  - Start() amended to start counter and handle all interrupt enabling.  
 *  - Point restart() at start().  Can't see any real difference

Andrew


Original issue reported on code.google.com by [email protected] on 7 Oct 2011 at 7:31

Incompatible with core Servo and SPI libraries

The TimerOne library can't be used together with either the Servo or the SPI 
library.
In the case of Servo, TimerOne wins, whereas in the case of SPI, SPI wins and 
TimerOne won't function.
Tested with Arduino 1.0 on an Arduino Pro Micro 328 8MHz.

I suppose this is because Servo and SPI also make use of the Atmel's Timer1? Is 
there some way to workaround this? At least it's interesting that SPI and Servo 
work happily together.

In case it's not solvable, a big warning in the docs would be very useful. :)

Original issue reported on code.google.com by [email protected] on 18 Apr 2012 at 4:21

TimerOne error on arduino DUE


1. When compiling for Arduino due board the error appears in io.h

Arduino: 1.5.4 (Windows NT (unknown)), Board: "Arduino Due (Programming Port)"

In file included from MPPT_bombeo_FrecMax.ino:10:
C:\Program Files\Arduino\libraries\TimerOne/TimerOne.h:40: fatal error: 
avr/io.h: No such file or directory
compilation terminated.




Original issue reported on code.google.com by [email protected] on 20 Mar 2014 at 8:53

Wanted: TimerOne for timer2, TimerTwo

Wanted: TimerOne for timer2, TimerTwo

Who has time to create a similar timer for timer2? Now I have to use 
FrequencyTimer2 which is different and not so handy.

Albert van Dalen

www.avdweb.nl

Original issue reported on code.google.com by [email protected] on 2 Apr 2013 at 10:16

The period isn't correct. why?

What steps will reproduce the problem?
1. Timer1.initialize(500); 
2. Timer1.pwm(9, 512, 500);

What is the expected output? What do you see instead?
The output should be a 0.5 ms period square wave, and it isn't.

What version of the product are you using? On what operating system?
TimerOne-v8, Arduino 1.0, 328P chip, Linux 64 bits

Please provide any additional information below.


Original issue reported on code.google.com by [email protected] on 30 Dec 2011 at 3:16

Missing keywords and example

I'm using your library and noticed that there are no keywords or examples.
I added the missing keywords file, and a short working example - perhaps you 
would like to add them to your zip.
My files are in the attached zip.


Original issue reported on code.google.com by [email protected] on 10 Dec 2011 at 2:05

Attachments:

led blink

Hello, 

I was try to make the pin 13 to blink every 1/2 sec and i was use the bellow 
code without success, can you please tell me what is the mistake ?

#include <TimerOne.h>

#define led 13

boolean x = false;

void setup()
{
    pinMode(led,OUTPUT);
    Timer1.initialize(1);
    Timer1.attachInterrupt(myint);

}

void loop()
{
    digitalWrite(led,x);

}

void myint()
{
    x!=x;
}

Original issue reported on code.google.com by [email protected] on 13 Dec 2011 at 5:55

TimerOne-v7 error

What steps will reproduce the problem?
1. Include library into Arduino/hardware/libraries/
2. Write "#include <TimerOne.h>" in some project
3. Compile

What is the expected output? What do you see instead?
Expected output: Compiling. What I see instead: An error saying that 
"TimerOneTesting.h" doesn't exists.


To solve the problem the line number 39 of "TimerOne.cpp" must be replaced by 
this: #include "TimerOne.h"

Original issue reported on code.google.com by [email protected] on 7 Nov 2011 at 3:05

In member function 'void TimerOne::start()': TimerOne.cpp:143: error: 'PSRSYNC' was not declared in this scope

What steps will reproduce the problem?
1. Unpack\install arduino-1.0.1-windows.zip
2. copy Timer1 library to \arduino-1.0.1\libraries
3. Start Arduino IDE, load  ISRBlink example sketch and verify compile 
(CTRL+R). Succeeds as expected.
4. Attempt to run same sketch with AtTiny84:
a) Arduino.cc, click Playground, click "Arduino on other Atmel Chips" on the 
left pane, click link to "Attiny 44/45/84/85" (navigates to 
http://hlt.media.mit.edu/?p=1695), download "ATtiny.zip"
b) unzip ATtiny.zip, and place "attiny" folder into arduino-1.0.1\hardware
c) Start Arduino IDE, select Tools, Board, ATtiny84 (either 1 or 8mhz)
d) Load the ISRBlink sketch and attempt to compile (CTRL+R)

What is the expected output? What do you see instead?
Expect: Like the Arduino Uno board, to compile.
Result:
C:\arduino-1.0.1\libraries\TimerOne\TimerOne.cpp: In member function 'void 
TimerOne::start()':
C:\arduino-1.0.1\libraries\TimerOne\TimerOne.cpp:143: error: 'PSRSYNC' was not 
declared in this scope

What version of the product are you using? On what operating system?
Arduino 1.0.1  (IDE)
damellis-attiny-6bff522.zip (Support for other AVR chips in the Arduino IDE, 
i.e. ATTiny84)
TimerOne-v9.zip (The version of TimerOne for this bug report)


Please provide any additional information below.
I do not know if this is an Arduino IDE issue, or an issue with the hardware 
definitions in damellis-attiny-6bff522.zip or an issue with TimerOne library.

Original issue reported on code.google.com by [email protected] on 26 Aug 2012 at 5:39

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.