Pwm on SAM3x and control on iMx6

Discussion in 'Arduino IDE' started by msener, Dec 2, 2014.

  1. msener

    msener New Member

    Joined:
    Dec 1, 2014
    Messages:
    6
    Likes Received:
    0
    Hello,

    Can someone help me?
    I couldn't produce PWM signal at SAM3x.
    I want to enter pwm parametre and SAM3x produce PWM.

    And also at terminal I wrote:

    stty -F /dev/ttymxc3 cs8 115200 // to configuration
    echo message> /dev/ttymxc3 // to send message and i want to send pwm parametre
    cat /dev/ttymxc3 // to read message but i can't take any message

    Thanks.
     
  2. gionji

    gionji Member

    Joined:
    Jun 28, 2013
    Messages:
    38
    Likes Received:
    0
    Hi

    you need to write a Arduino code that reads integer or simply a byte (values from 0 to 255) and then set this value with analogWrite function>

    void setup(){
    pinMode(9, OUTPUT);
    Serial.begin(115200);
    }

    void loop(){
    int readedByte = 0;

    if(Serial.available()){
    readedByte = Serial.read();
    analogWrite(9, readedByte);
    }
    delay(20);
    }
     
  3. Karthikeyan Jaganathan

    Karthikeyan Jaganathan New Member

    Joined:
    May 23, 2015
    Messages:
    3
    Likes Received:
    0
    Hi,

    If I use the command analog write to produce the PWM waves, the maximum duty cycle achievable was around 1200 microseconds......... but for my application i need to produce a maximum of 2200 microsesconds....... Is there any other way to produce PWM signal ?
     

Share This Page