PWM

I am trying to develop BLDC motor controls with Arduino. I have programmed PWM signal in simulink blocks and sample time is (5e-6). Can I send this signal using arduino digital output blocks in simulink to the motor driver board.

Also the sample time of of my simulation is 5e-6, can arduino run on this sample time which reffers to a frequency of 5MHz.

Please help me.

What is "5e-6" ? Post a link to its datasheet or user-manual.

A 5MHz sample rate on a 16MHz Arduino is stretching the envelope.

...R

5e-6 a common format for representing scientific notation, 5 * 10 ^ -6 = 0.000005

5 microseconds, or 2 mhz. What sort of samples are you taking?

If it's just digital port reads, you might be able to do it, but you'd need to do direct port manipulation to make it fast enough. 5 microseconds gives you only 80 instructions to work with, which is really pushing the limit of what you can do with Arduino. Certainly, digitalRead() and digitalWrite() are a no-go!

DrAzzy: 5e-6 a common format for representing scientific notation,

Never occurred to me.

I thought the OP was referring to a piece of software or some protocol. :)

...R

Does your program also take the much slower switching time of a motor driver power mosfet in account. I think ~500khz might be the practical limit for that part. Leo..

DrAzzy: 5 microseconds, or 2 mhz. What sort of samples are you taking?

This is incorrect. That should be megahertz, not millihertz. It is 2 MHz. There's a pretty big difference there.