LabVIEW Interface for Arduino Discussions

取消
显示结果 
搜索替代 
您的意思是: 

16 Bit PWM Labview Arduino Uno

Hello,

I'm currently using the LIFA to control a PWM signal but problem is LIFA only allow me to make an 8 bit PWM which resolution is too low for what i'm trying to do. I've started reading arduino and labview code to see if i could easily use the 16-bit PWM with Timer 1 adding this Library http://playground.arduino.cc/Code/Timer1 but i really have no idea where to start from.
So here I am, maybe some of you have already done this.

Thanks for reading this and for any forecoming answer.

0 项奖励
1 条消息(共 9 条)
11,939 次查看

What are you trying to do with PWM?

0 项奖励
2 条消息(共 9 条)
6,688 次查看


Well I need it to make a -10 to +10 constant signal and then control a motor through a variator. This signal will be my instruction to regulate the speed of the motor. But 8-bit resolution give me a 0,5V precision only at the end of the process. That's why I need to control the PWM of the 16 bits Timer, at least with a 10bits resolution

0 项奖励
3 条消息(共 9 条)
6,688 次查看

What motor and what motor controller are you using?

0 项奖励
4 条消息(共 9 条)
6,688 次查看

Ok, I've finally found some way to do it. I've made a modification in The PWM write Pin VI to add a 4th Command. So now i use a 16bit number as the set value that i split into two 8bits words with an AND fonction. So i now have one 8 bits word and another one with only 2 significants bits.

In the Arduino code, I use this fonction  "Timer1.pwm(command[2],(4 * command[3]+command[4]))" to reassemble the two 8bits words as a 10bit set value. That works fine, here is the 16 to 2*8bits VI and arduino code for the case, maybe it will help somebody else.

case 0x0A:    // PWM Write Pin

     // Define output pin, and its mode

     pinMode(command[2], OUTPUT);

     // Initialize

     Timer1.initialize(5000);         // initialize timer1, and set a 1/2 second period

                                      // Note that this breaks analogWrite() for digital pins 9 and 10 on Arduino.                                                                  

     Timer1.pwm(command[2],(4 * command[3]+command[4])); // setup pwm on pin X 

       Serial.write('0');

      break;


Thanks for answering me.

0 项奖励
5 条消息(共 9 条)
6,688 次查看

Hi Falcoob

I am facing the exact same problem as you were.

However I do not really understand how you widened the resolution of the PWM to 10 bit.

Do you mind explaning it?

\\ Søren

0 项奖励
6 条消息(共 9 条)
6,688 次查看

You may find it easier to use a 16 bit PWM that has a SPI interface.  See:

<http://www.adafruit.com/products/1455>

LIFA has built in support for SPI.

hrh1818

0 项奖励
7 条消息(共 9 条)
6,688 次查看

Salam,

Working 16 Bit PWM Labview Arduino Uno

just follow the steps in the readme file.

0 项奖励
8 条消息(共 9 条)
6,688 次查看

Hello I would like to control PWM pin 9 and 10 of the Arduino UNO with 16-bits, right now it is only possible with 8-bits of resolution using LINX, is there a way to do it?

0 项奖励
9 条消息(共 9 条)
5,311 次查看