LabVIEW Embedded

cancel
Showing results for 
Search instead for 
Did you mean: 

pwm modulation on blackfin

Hi All

I'm trying to modulate PWM timer (working on 1MHz) with sinusoidal signal at 50 Hz on Blackfin 537.

the VI working done, but i'm cannot control the frequency on modulating signal, however it's look like the FOR loop proccesing time is 1.7msec. why ?

 

My software: Labview 8.6 , ADI_Blackfin 8.6

Hardware : ADSP-BF537 EZ-KIT, silicone ver 0.2

0 Kudos
Message 1 of 14
(10,049 Views)

Hi Eyal-E,

 

I tried to rebuild your program. Your screen shot did not display what is the code in the true so I couldn't complete my program.

 

The time required to processing the code (the for loop) is not something we can control and is restrained by the hardware specifications. One way to test to how long their loop is taking is to place in it a Flat Sequence Structure. Use that with the Get Date Time function or with the elapsed time function. Calculate the difference between start and stop. If the difference is closer to a millisecond (like 0.9 or 1.0 millisecond), the answer is that yes it will be possible to generate a PWM cycle with less than a millisecond. .  If the time difference is 1.5 milliseconds, then the answer is no, it not possible to generate one less than that value. If the minimum time required to execute the logic inside the loop is 1.7 milliseconds, then that is minimum time and that is not in our control.

 

Please let me know if you have further questions.

Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 2 of 14
(10,027 Views)

I meant what is there in the false case in your program (not the true case as I said in my previous post)

Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 3 of 14
(10,026 Views)

One more thing to check.  

 

Please check if you have JTAG debugging enabled. JTAG intterrupts the processor everytime it updates the front panel, which means that the code will run many times slower.  If you disable debugging or use serial debugging, it might work much faster. 

 

Please let me know if this helps.

 

Thanks,

Karunya R

 

Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 4 of 14
(10,022 Views)

Hi Karunya

Thanks a lot for your responding.

1. Can you send me example for sinus pwm modulation with adjustable freq (between 1-100 Hz) connected to TMR0.

2. Why the output of TMR0 seen only on Led 3 and not on Timers header connector (P11).

3. Can you send me some example for communication between Blackfin and any PC (serial or network communication protocol) for adjusting few parameters and datalogging.

 

My computer with laptop now under construction, i'll send you my VI ASAP.

Best regards,

Eyal.

 

0 Kudos
Message 5 of 14
(10,001 Views)

Hi Eyal,

 

1. Can you send me example for sinus pwm modulation with adjustable freq (between 1-100 Hz) connected to TMR0.

There is a shipping example with LabVIEW for Blackfin that demonstrates how to use the PWM modulation. You probably might have to modify it a little to adjust it for adjustable frequency.  Please let me know if you have already tried to use this.

 

2. Why the output of TMR0 seen only on Led 3 and not on Timers header connector (P11).

There are a couple of functions to set the LEDs such as BF Toggle LEDs. You should be able to set which LED is let or not lit using those functions. Can you please clarify your question further using an example?

 

3. Can you send me some example for communication between Blackfin and any PC (serial or network communication protocol) for adjusting few parameters and datalogging?

There is an example in the example finder in LabVIEW that demonstrates how to use TCP communicatin with the Blackfin board. There is an example called Web LED.lvproj. The location of the example in the example finder  is under Toolkits and Modules->Blackfin->Fundamentals-> Web LED.lvproj. The demo itself creates a simple web server on BF 537. If you open up the block diagram, you can see that a number of TCP communication VIs are used to communicate with your blackfin board to set up the webpage.

 

Hope this helps! Please let me know if you have any further questions on this.

 

Thanks,

Karunya R

I need sometime to do some research on this one as well.

Warm regards,
Karunya R
National Instruments
Applications Engineer
Message 6 of 14
(9,985 Views)

Hi Karunya,

1. Attached our VI that modulating PWM output TMR0 (duty cycle) by sinusoidal wave (this technique used on generation AC voltage from DC source by Mosfet driver).

2. I'm mean what is the hardware connection from TMR0 output (at blackfin) to any header connector except the LED indicator.

Thanks, Smiley Happy

Eyal.

 

 

Download All
0 Kudos
Message 7 of 14
(9,978 Views)

Hi Eyal,

 

 

I want to organize your questions to a single place so that I am able to understand what all is going on with this.

  1. The processing time for the For loop is 1.7 milliseconds. You want it to be lower than that?
  2. Communication with the Blackfin board using serial or TCP/IP
  3. You want to see the output of TMR0 to a header connector and not on LEDs

 

Processing time less than 1.7 milliseconds

I had provided suggestions to you on my post on 3-26 on using timing functions to check for execution time of the logic itself. Please let me know if you have tried those and what the results were.I tried to use your VI however, I am not getting any values from the sin function. Can you please confirm that this is the same in your case? It doesn't appear that the VI is functioning.

 

Communication with the Blackfin board using serial or TCP/IP

 I had suggested an example on 3-31. I hope this one works for you.

 

Output of TMR0 to a header connector and not on LEDs 

I need to research this. Is there a reason that you do not want to use the LEDs?

 

I look forward to your reply with the answers to my questions!

 

Thanks,

Karunya R

 

Warm regards,
Karunya R
National Instruments
Applications Engineer
0 Kudos
Message 8 of 14
(9,961 Views)

Hi Eyal,

 

I wanted to get back to you on your question on using the header output with the PWM. This sould be possible. The pinout of the TMR0 corresponds to pin 6 of the P11 connector (Timer) and pin 9 is ground. However, TMR0 corresponds also to LED4 in the AD chip. See the attached pictures. This clearly means that the timer line shares its output with LED and P11 connector. This means that if you use the PWM functions with your VI, you can't use the LED functions there simultaneously as it would lead to a conflict. LabVIEW will display the conflict. Actually, if you add the TMR0 EIO into your project, the LED4 EIO disappears from the list.

 

So to make your LED not blink, set the polarity of the LED to negative. Even though the LED still gets a single from the TMR0, it will not blink anymore and thereby there not be an interrupt generated by it.

 

Please let me know if you have any further questions about this.

 

Thanks,

Karunya

Warm regards,
Karunya R
National Instruments
Applications Engineer
Download All
0 Kudos
Message 9 of 14
(9,941 Views)

Hi Karunya,

  1. I'm downloaded the datasheet of ADSP-BF537 EZ-KIT. From that I'm understand that I'm can't work with TMR0 and LED4 in the same project.
  2. What I'm mean in my question is why I'm see the signal that generated to TMR0 only on LED4, and not between pins 6 and 9 on header P11. The signal was checked by oscilloscope.
  3. Following your request to measure the execution time of FOR loop by using flat sequence and timer, I can't do it because in working with BlackFin, labview compiling the VI and downloaded him to the RAM of EZ-KIT, and the VI looking like freeze (not on running mode) and I'm doesn't see any change on indicators. To demonstrate this operation, I'm measure the time of steps on one cycle of output signal. Attached image from oscilloscope, you can see that the time of one step (is equal to one iteration of FOR loop) is around 1.7 msec.
  4. My main question is how to increase the iteration cycle of executed FOR loop, or any other suggestion to create modulated PWM by sinusoidal signal with adjustable frequency of sinusoidal signal (at range of 10-100Hz).
  

Note: my mission is to create modulated PWM, when carrier signal on 100kHz (natural frequency of TMR0) and modulated by signal (that change the % of duty cycle for TMR0) is absolute sinusoidal at range of 10-100Hz (because the % of duty cycle can be 0-100%).

The absolute sinus that you see on the image got from Low Pass filter by the oscilloscope software.

0 Kudos
Message 10 of 14
(9,900 Views)