简体   繁体   English

MSP430 I2C slave产生PWM信号,master为R-pi3

[英]MSP430 I2C slave to generate PWM signal , master is R-pi3

I need to code for a MSP430FR5969 launch pad that can generate PWM signal upto 100KHz, I want to control it with R-Pi3 over the I2C bus to send the Freq and duty cycle to the MSP430.我需要编写一个 MSP430FR5969 发射台,它可以产生高达 100KHz 的 PWM 信号,我想用 R-Pi3 通过 I2C 总线控制它,以将频率和占空比发送到 MSP430。 I am very new in coding MSP430, any help would be appreciate it.我在编码 MSP430 方面很新,任何帮助将不胜感激。

thans

I find the best approach is to look at the examples provided for this particular LaunchPad.我发现最好的方法是查看为这个特定 LaunchPad 提供的示例。 You'll now find these under Resource Explorer.您现在可以在资源浏览器下找到这些。

Run the PWM example and get your head around what it's doing.运行PWM 示例并了解它在做什么。 This should be easy enough using the on-board LED.这应该很容易使用板载 LED。

Then run the I2C example and get your head round what that's doing.然后运行I2C 示例并了解它在做什么。 You can connect it straight to the Pi, but a logic analyser will really help with this.您可以将其直接连接到 Pi,但逻辑分析仪确实会对此有所帮助。

Peripheral setup is the hardest part of MSP430 coding.外设设置是 MSP430 编码中最难的部分。 Once you get this right (or just copy it from an example) the code in between is normally much easier.一旦你做对了(或者只是从一个例子中复制它),中间的代码通常会容易得多。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM