Comments (4)
Looks like this was fixed long ago.
// Mighty-1284 - Maniacbug
//
#elif defined(__AVR_ATmega1284P__)
#define TIMER1_A_PIN 12 // PD5
#define TIMER1_B_PIN 13 // PD4
#define TIMER1_ICP_PIN 14 // PD6
#define TIMER1_CLK_PIN 1 // PB1
#define TIMER3_A_PIN 6 // PB6
#define TIMER3_B_PIN 7 // PB7
#define TIMER3_ICP_PIN 5 // PB5
#define TIMER3_CLK_PIN 8 // PD0
I'm closing this old issue. If there's still a problem, please reopen and explain...
from timerone.
Sorry, but it is not fixed. According to ATmega164A/164PA/324A/324PA/644A/644PA/1284/1284P datashhet (Section 1.1 - Pinout - PDIP...),
OC1A - PD5 port is assigned to PIN19 = Maniacbug D 13
OC1B - PD4 port is assigned to PIN18 = Maniacbug D 12
ManiacBug PIN mapping
+---\/---+
(D 0) PB0 1| |40 PA0 (AI 0 / D24)
(D 1) PB1 2| |39 PA1 (AI 1 / D25)
INT2 (D 2) PB2 3| |38 PA2 (AI 2 / D26)
PWM (D 3) PB3 4| |37 PA3 (AI 3 / D27)
PWM/SS (D 4) PB4 5| |36 PA4 (AI 4 / D28)
MOSI (D 5) PB5 6| |35 PA5 (AI 5 / D29)
PWM/MISO (D 6) PB6 7| |34 PA6 (AI 6 / D30)
PWM/SCK (D 7) PB7 8| |33 PA7 (AI 7 / D31)
RST 9| |32 AREF
VCC 10| |31 GND
GND 11| |30 AVCC
XTAL2 12| |29 PC7 (D 23)
XTAL1 13| |28 PC6 (D 22)
RX0 (D 8) PD0 14| |27 PC5 (D 21) TDI
TX0 (D 9) PD1 15| |26 PC4 (D 20) TDO
RX1/INT0 (D 10) PD2 16| |25 PC3 (D 19) TMS
TX1/INT1 (D 11) PD3 17| |24 PC2 (D 18) TCK
PWM (D 12) PD4 18| |23 PC1 (D 17) SDA
PWM (D 13) PD5 19| |22 PC0 (D 16) SCL
PWM (D 14) PD6 20| |21 PD7 (D 15) PWM
+--------+
Therefore, the code should be changed from
#elif defined(__AVR_ATmega1284P__)
#define TIMER1_A_PIN 12 // PD5
#define TIMER1_B_PIN 13 // PD4
#define TIMER1_ICP_PIN 14 // PD6
to
#elif defined(__AVR_ATmega1284P__)
#define TIMER1_A_PIN 13 // PD5
#define TIMER1_B_PIN 12 // PD4
#define TIMER1_ICP_PIN 14 // PD6
from timerone.
I confirm the problem is not solved.
This code :
void setup() { //Timer1.initialize(1000); //Timer1.attachInterrupt(timerIsr); analogWrite(P_FAN_PWM, 128); }
Produces correct result
while this code
void setup() { Timer1.initialize(1000); Timer1.attachInterrupt(timerIsr); analogWrite(P_FAN_PWM, 128); }
Creates a very thin spike instead of the square wave the above code produces
from timerone.
I just ran into the same issue. Things work fine on the ATmega1284 when you modify known_16bit_timers.h
to read:
// Mighty-1284 - Maniacbug
//
#elif defined(__AVR_ATmega1284P__) || defined(__AVR_ATmega1284__)
#define TIMER1_A_PIN 13 // PD5
#define TIMER1_B_PIN 12 // PD4
#define TIMER1_ICP_PIN 14 // PD6
#define TIMER1_CLK_PIN 1 // PB1
#define TIMER3_A_PIN 6 // PB6
#define TIMER3_B_PIN 7 // PB7
#define TIMER3_ICP_PIN 5 // PB5
#define TIMER3_CLK_PIN 8 // PD0
#endif
This also enables TimerOne to run on a non-P ATmega1284. Tested with an ATmega1284-MU.
from timerone.
Related Issues (20)
- External input for the timer1 to generate an interrupt when the counter reaches the maximum HOT 4
- Errors when using TimerOne with new Arduino Nano Every HOT 3
- Inverted PWM HOT 1
- [Error:] Not Working for the Digispark with Attiny85 HOT 1
- is it possible to attach overload metheds to the timer
- TimerOne issue in combination with BMP085 Adafruit driver
- Lacking support for pwm pins 0 and 1 on ATTiny85
- probably flaw of start() HOT 2
- 100% Duty cycle is not completely 100% (see picture) HOT 6
- Timer will not delay for long periods
- Timer1 hangs delay() function. HOT 1
- First cycle after start() is half the specified interval on Teensy 3.6
- Two glitches at start of timer on Teensy 2.0++ HOT 1
- Is the TimerOne library not compatible with the GPL license?
- Support for ATtiny84/44/24
- Support for ATtiny13 HOT 1
- Compile Error with Updated A-Star 328PB Board Info HOT 6
- Feature Request
- New release? HOT 1
- Missing support for Atmega128 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from timerone.