如何在wince6中增加SPI时钟频率? [英] How to increase the SPI clock frequency in wince6?

查看:95
本文介绍了如何在wince6中增加SPI时钟频率?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

我们在s5pv210 CPU上使用wince6。现在我们要通过SPI设置ad5024。当我们多次重置ad5204时,ad5024的输出可能会出错。

We use the wince6 on s5pv210 CPU. Now we want to set ad5024 through SPI. When we reset the ad5204 several times, the output of ad5024 maybe error.

当我们测试SPI_CLK时,我们得到一个1Mhz的频率波形。我们认为时钟频率可能太少。所以我们想增加频率。但我们不知道如何做到这一点。因为生成SPI时钟的一种模式设置为GPIO值为
,所以代码为:

When we tested the SPI_CLK , we get a 1Mhz frequency wave form. We think the clock frequency maybe too little. So we want to increase the frequency. But we have no idea how to  do that. Because one mode to generate SPI clock is set the GPIO value as follow code:

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

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

{

Set_PinData(g_pGPIOReg,GPG35_Output,1);

Set_PinData(g_pGPIOReg, GPG35_Output, 1);

Set_PinData(g_pGPIOReg,GPG35_Output,0);

Set_PinData(g_pGPIOReg, GPG35_Output, 0);

}

另一种模式是使用S5PV210支持的SPI驱动程序,并将时钟驱动程序设置为:

And another mode is using the SPI driver supported in S5PV210, and set the clock driver very big as :

pPublicSpi-> pSYSCONregs - > CLK_DIV.CLK_DIV5  &NBSP;   =(pPublicSpi-> pSYSCONregs-> CLK_DIV.CLK_DIV5&〜(0xF<< 0))| (0 <0);

pPublicSpi->pSYSCONregs->CLK_DIV.CLK_DIV5      = (pPublicSpi->pSYSCONregs->CLK_DIV.CLK_DIV5 & ~(0xF << 0)) | (0 << 0);

但我们可以获得4Mhz频率。慢慢地都是这样。

but we could get the 4Mhz frequency. It's to slowly all the same.

有人可以给我们任何建议吗?

Could anyone give us any suggestion?

非常感谢!

Yanbin Yue

Yanbin Yue

gg

推荐答案

我认为你完全是这样的错误道。您有什么证据表明时钟与问题有关?您发送到SPI设备的消息是否更可能错误?坏了吗?不符合规格?
处理真正的问题;不要只是尝试随机改变希望修复!

I think you're going about this the completely wrong way. What evidence do you have suggesting that the clock is related to the issue? Isn't it more-likely that the messages you are sending to the SPI device are wrong? Are out of order? Do not meet its specifications? Work on the real problem; don't just try random changes hoping for a fix!

显然,向GPIO写入1和0是一个可怕的想法。

It should be obvious that writing 1's and 0's to the GPIO is a HORRIBLE idea.

Paul T。


这篇关于如何在wince6中增加SPI时钟频率?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆