Giter VIP home page Giter VIP logo

Comments (4)

PaulStoffregen avatar PaulStoffregen commented on August 18, 2024

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.

MadGarra avatar MadGarra commented on August 18, 2024

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.

vdesmedt avatar vdesmedt commented on August 18, 2024

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.

eeproto avatar eeproto commented on August 18, 2024

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)

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.