Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Beginner
823 Views

Intel Edison PWM Limits

I am trying to get data from an SSI encoder and need to pulse the clock at around 10 microseconds for each high and low. I have tried using both Python and Arduino IDE to make this work and the smallest pulse I can get is 100 microseconds (measured with a scope). What are the Edison's limits when it comes to this? If anyone has gotten code to send pulses at 10 microseconds or less please share. Here is my Arduino IDE code

int CLOCK = 4;

int DATA = 2;

int b1 = 0;

String datastring = "";

void setup()

{

pinMode(CLOCK, OUTPUT); //clock

pinMode(DATA, INPUT); //data

delay(500);

Serial.begin(115200);

}

void loop()

{

digitalWrite(CLOCK,HIGH);

datastring = "";

for(int i = 0; i<12; i++)

{

delayMicroseconds(10);

digitalWrite(CLOCK,LOW);

delayMicroseconds(10);

digitalWrite(CLOCK,HIGH);

int b1 = digitalRead(DATA);

datastring+=b1;

}

Serial.println(datastring);

delayMicroseconds(50); //wait for next position bits

}

0 Kudos
1 Reply
Highlighted
Community Manager
23 Views

Hi Colin,

 

 

In fact the normal Edison pulse is around 100 microseconds. If you want to improve the pulse speed of your code I would suggest you to implement Fast memory mapped IO. I'm wondering if you have checked this link http://www.i-programmer.info/programming/hardware/8770-exploring-edison-fast-memory-mapped-io.html http://www.i-programmer.info/programming/hardware/8770-exploring-edison-fast-memory-mapped-io.html? The guys at i-Programmer have developed a great guide on how to make use of the Atom CPU to work with the GPIO. This way you should be able to generate shorter pulses.

 

 

Regards,

 

-Pablo
0 Kudos