Results 1 to 2 of 2

Thread: Arbtoix-M robocontroller's ATMEGA644PA, which pins are PWM, MOSI, MISO, SCK pins ?

  1. Question Arbtoix-M robocontroller's ATMEGA644PA, which pins are PWM, MOSI, MISO, SCK pins ?

    I was using Arduino boards always but I try to learn the Arbotix-M board now to use on my robotic projects now, I am a newbie with Arbotix-M.

    I try to find out the correct pin mapping for the Arbtoix-M robocontroller which uses the ATMEGA644PA; because I will try to use nrf24 and an arduino compatible pololu Dual G2 High Power Motor Shield/Driver on the Arbotix-M board to control my robot. Thus, I will change t he .cpp file of motor driver's connected pins according to that to use on the pololu motor driver.

    I found this datasheet for the ATMEGA644PA and it says there are 6 pwm pins but it doesn't say which ones on the pictures shared there http://www.waveshare.net/datasheet/A...Tmega644PA.PDF.

    In the internet there are lots of different pin mappings for the ATMEGA644PA so I was not so sure. Therefore, would you share me the correct pin mapping pictures for ATMEGA644PA that is used on the Arbotix-M board please ? thank you very much.

  2. #2

    Re: Arbtoix-M robocontroller's ATMEGA644PA, which pins are PWM, MOSI, MISO, SCK pins ?

    I am not sure if there is such a picture... What I do is look at the sources.... Look where your Arbotix setup is and look in variants\arbotix2\pins_arduino.h... Or some such file and you will see things like:
    Code:
    const uint8_t PROGMEM digital_pin_to_port_PGM[] = {
        PB, /* 0 */
        PB,
        PB,
        PB,
        PB,
        PB,
        PB,
        PB,
        PD, /* 8 */
        PD,
        PD,
        PD,
        PD,
        PD,
        PD,
        PD,
        PC, /* 16 */
        PC,
        PC,
        PC,
        PC,
        PC,
           PC,
        PC,
        PA, /* 24 */
        PA,
        PA,
        PA,
        PA,
        PA,
        PA,
        PA  /* 31 */
    };
    
    const uint8_t PROGMEM digital_pin_to_bit_mask_PGM[] = {
        _BV(0), /* 0, port B */
        _BV(1),
        _BV(2),
        _BV(3),
        _BV(4),
        _BV(5),
        _BV(6),
        _BV(7),
        _BV(0), /* 8, port D */
        _BV(1),
        _BV(2),
        _BV(3),
        _BV(4),
        _BV(5),
        _BV(6),
        _BV(7),
        _BV(0), /* 16, port C */
        _BV(1),
        _BV(2),
        _BV(3),
        _BV(4),
        _BV(5),
        _BV(6),
        _BV(7),
        _BV(0), /* 24, port A */
        _BV(1),
        _BV(2),
        _BV(3),
        _BV(4),
        _BV(5),
        _BV(6),
        _BV(7)
    };
    
    const uint8_t PROGMEM digital_pin_to_timer_PGM[] = {
        NOT_ON_TIMER,     /* 0  - PB0 */
        NOT_ON_TIMER,     /* 1  - PB1 */
        NOT_ON_TIMER,     /* 2  - PB2 */
        TIMER0A,         /* 3  - PB3 */
        TIMER0B,         /* 4  - PB4 */
        NOT_ON_TIMER,     /* 5  - PB5 */
        NOT_ON_TIMER,     /* 6  - PB6 */
        NOT_ON_TIMER,    /* 7  - PB7 */
        NOT_ON_TIMER,     /* 8  - PD0 */
        NOT_ON_TIMER,     /* 9  - PD1 */
        NOT_ON_TIMER,     /* 10 - PD2 */
        NOT_ON_TIMER,     /* 11 - PD3 */
        TIMER1B,         /* 12 - PD4 */
        TIMER1A,         /* 13 - PD5 */
        TIMER2B,         /* 14 - PD6 */
        TIMER2A,         /* 15 - PD7 */
        NOT_ON_TIMER,     /* 16 - PC0 */
        NOT_ON_TIMER,   /* 17 - PC1 */
        NOT_ON_TIMER,   /* 18 - PC2 */
        NOT_ON_TIMER,   /* 19 - PC3 */
        NOT_ON_TIMER,   /* 20 - PC4 */
        NOT_ON_TIMER,   /* 21 - PC5 */
        NOT_ON_TIMER,   /* 22 - PC6 */
        NOT_ON_TIMER,   /* 23 - PC7 */
        NOT_ON_TIMER,   /* 24 - PA0 */
        NOT_ON_TIMER,   /* 25 - PA1 */
        NOT_ON_TIMER,   /* 26 - PA2 */
        NOT_ON_TIMER,   /* 27 - PA3 */
        NOT_ON_TIMER,   /* 28 - PA4 */
        NOT_ON_TIMER,   /* 29 - PA5 */
        NOT_ON_TIMER,   /* 30 - PA6 */
        NOT_ON_TIMER    /* 31 - PA7 */
    };
    The first two parts here show which port each pin is on and the MASK.. So pin 0 is PB0...

    The digital_pin_to_timer_PGM structure actually puts in the actual pin mapping in the comments.

Thread Information

Users Browsing this Thread

There are currently 3 users browsing this thread. (0 members and 3 guests)

Similar Threads

  1. Question(s) Arbotix-M ISP pins
    By gmui in forum Arbotix, Microcontrollers, Arduino
    Replies: 3
    Last Post: 02-09-2017, 01:08 PM
  2. Question(s) JTAG and I/O pins shared
    By vinjk in forum Robot Computers
    Replies: 2
    Last Post: 05-27-2014, 01:12 AM
  3. problem with arbotix m digital pins
    By crchisholm in forum Arbotix, Microcontrollers, Arduino
    Replies: 4
    Last Post: 02-22-2014, 06:54 PM
  4. Question(s) A Motor Controlled By Two Pins
    By Megasundato in forum Software and Programming
    Replies: 4
    Last Post: 08-31-2011, 01:39 PM
  5. IO pins
    By Bevels in forum Arbotix, Microcontrollers, Arduino
    Replies: 8
    Last Post: 06-23-2009, 01:56 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •