完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
在CY8C4247LQ-43上,我观察到CyPress SPI模块的不同行为。我使用主模式和子模式摩托罗拉,SCLK模式CPHA=0,CPOL=0,过采样=8,RX/TX数据位=8,MSB第一,SS数1,活动Low,FIFO缓冲区大小为8字节。DATARATE是1MHZ,SPI组件没有RX/TX中断。
编写了ADESTO闪存芯片读写功能,使用UDB SPI模块工作正常,但在SCB SPI模块不工作的情况下,经过调试发现,通过SCB SPI组件发送数据序列是错误的,只从UDB SPI发送数据0x55。观察波形。(对于调试,我只使用简单的库函数在SPI上写入单字节),同样地,对于SCB SPI观察到的波形。我已经附加了包含波形差异的图像。 有人知道如何解决这个问题吗? SCBYSPI数据图像 326.6 K 以上来自于百度翻译 以下为原文 I have observed different behavior of the Cypress SPI modules on CY8C4247-LQI-483. I have use Master mode and submode Motorola, with SCLK mode CPHA=0 and CPOL=0, Oversampling=8, RX/TX data bits=8, MSB First, Number of SS:1, Active Low, with a FIFO Buffer size of 8 bytes. The datarate is 1MHz and the SPI component has no rx/tx interrupt. I have written function to read/write data into adesto flash IC , while using UDB SPI module it worked properly , but in case of SCB SPI module it is not working . after debugging , I found that is error in sending sequence of data though SCB SPI component .i just sent the data 0x55 from UDB SPI and observed the waveforms .(for debug I have just use simple library function to write single byte on SPI ) similarly waveforms observed for SCB SPI . I have attached the images which contain the difference in waveforms . Has anyone an idea how to fix this issue ?
|
|
相关推荐
19个回答
|
|
你好,
不知道到底发生了什么。看起来0x55没有被写入SCB SPI总线。无论如何,最好的办法是制作一个工作和非工作版本的档案,并在这里提供,所以其他论坛成员可以检查源代码。 当做 以上来自于百度翻译 以下为原文 Hi, not sure what really happens. It looks like that 0x55 is not written to the SCB SPI bus. Anyway, best thing would be that make an archive of the working and non-working version and provide it here, so other forum members can check the source code. Regards |
|
|
|
子璇ALICE 发表于 2018-11-23 20:07 你好, 我已经附上两个工作(即UDB SPI工作代码)和非工作(即SCB SPI非工作代码)。 请看一看。! 你的快速反应对我很有帮助。 WorkStudioUB.CyWrk.Soviv.Zip 1.7兆字节 WorkStudioS.CyWrk.Access 1.5兆字节 以上来自于百度翻译 以下为原文 Hello , I have attached both working (i.e UDB SPI working code ) and Non Working (i.e SCB SPI Non working code ). Please have a look . ! Your quick response will be helpful for me .
|
|
|
|
你好, 好的,所以这些项目可以检查行为。我这里没有4247个设备,只有4245个,所以我把项目改编成了这个。从我看来,在UDB SPI上,MOSI线在传输之后变低。这不是SCB SPI的情况。 然而,在这两种情况下,在SPI SCLK信号的第一上升沿之前,MOSI线都是低的。因此,这与您提供的信号形成对比,似乎SCB块在4247和4245之间的工作方式不同。 也许有一个论坛成员有一个4247设备,并可以检查。为了完整性,你写了你的SPI从属是某种闪存。请提供有关这个设备的信息,这样我们就可以检查是否有一个SCB配置将与这个设备一起工作。 当做 以上来自于百度翻译 以下为原文 Hi, okay, so with those projects the behaviour can be checked. I don't have a 4247 device here, only a 4245, so I adapted the projects to this. From what I can see it seems that on the UDB SPI, the MOSI line goes low after the transmission. This is not the case for the SCB SPI. However, in both cases the MOSI line is low before the first rising edge on the SPI SCLK signal. So, this is in contrast to the signals you provided - it seems the SCB block works differently between 4247 and 4245. Maybe there's a forum member having a 4247 device and can check. For completeness, you wrote that your SPI slave is some kind of flash memory. Please provide information about this device, so we can check if there's a SCB configuration which will work with this device. Regards |
|
|
|
子璇ALICE 发表于 2018-11-23 20:26 感谢您的支持,但这是关于数据字节发送SCB SPI,基本库函数发送数据SPI不正常工作的SCB块,我不知道这是为什么发生。 有人能帮我吗?? 我只想在SCB SPI上发送一个字节,我刚刚包含了库函数,没有做任何额外的事情。但是波形仍然不正确(对于发送数据),现在写我没有连接任何从机。 下面是我的基本代码中使用的函数。 int() { 在主模式下启动SPIG1LX启动();/SPI SCB启动 SWTXXUARTAR11START(); CyGloalActuabess;/*启用全局中断。*/ *将初始化/启动代码放在此处(例如MyStimSistAd())*/ SWIXTXUUARTY1PUTCHAR(“A”);//调试字符 (;) { *将您的应用程序代码放在这里。*/ SWXTXUUARTY1PtuCHAR(“A”); CyTeles(1000); SPI1 1SPIUARTWRITETXDATA(0x55);/ /在SPI上发送数据 /Note:这个函数不是在SPI上正确发送数据。 } } 以上来自于百度翻译 以下为原文 Thank u for your support , but this is regarding data byte sending over SCB SPI , basic library function to send data on SPI is not working properly for SCB block , i don't know why this is happening . can anyone help me .?? i just want to send a byte over SCB SPI properly , i had just included Library function not done anything extra . but still the waveform is not proper (for sent data ), write now i have not connected any slave . Following is the function that are used in my basic code . int main() { SPI_1_Start(); // SPI SCB Start in Master Mode SW_Tx_UART_1_Start(); CyGlobalIntEnable; /* Enable global interrupts. */ /* Place your initialization/startup code here (e.g. MyInst_Start()) */ SW_Tx_UART_1_PutChar('A'); // Debug character for(;;) { /* Place your application code here. */ SW_Tx_UART_1_PutChar('A'); CyDelay(1000); SPI_1_SpiUartWriteTxData(0x55); // send data over SPI // NOTE : THIS FUNCTION IS NOT SENDING DATA PROPERLY OVER SPI . } } |
|
|
|
houjunhao33 发表于 2018-11-23 20:42 KARANTAK2013Y2069006SRIEB: 我没有联系任何奴隶。 那么,你怎么知道它不起作用呢? 当做 以上来自于百度翻译 以下为原文 karantak2013_2068006 schrieb:Then, how do you know that it's not working? Regards |
|
|
|
先生, 以前,我写的驱动程序与Addito Flash IC通信,代码与UDB SPI完美地结合,然后由于我的应用程序缺少UDB块,我不得不切换到SCB SPI模式,这导致数据读取/写入Flash IC失败。 调试后,我发现SBC SPI库不工作。 调试时,我只需发送一个字节0x55到SPI SCB,观察DSO上的波形,就像我在第一个注释中附加的图像一样。 它是我用SCB SPI创建一个项目的请求,并且通过发送一个字节来检查SPI传输,并且请验证它的波形。 让我知道我做的是错误的方式或者别的什么。 早日答复和帮助将是真正有益的我。 感谢和问候 以上来自于百度翻译 以下为原文 Sir , Previously , I wrote the driver to communicate with adesto flash IC , code worked perfectly with UDB SPI , then due to lack of UDB blocks for my application , I had to switch to SCB SPI Mode , which causes failure of data read/write into flash IC. after debug I just found that SBC SPI Library is not working . For debug :I just send a byte 0x55 to SPI SCB and observed the waveforms at DSO , which looks like that I have attached image in my first comment . its my request to just create a project with SCB SPI , and check SPI transmission by sending a byte , and please verify its waveforms . let me know that i'm doing it into wrong way or something else . Early reply and help will be really beneficial for me . Thanks and Regards |
|
|
|
houjunhao33 发表于 2018-11-23 20:58 您能共享用于创建原始范围拍摄的项目吗?(有一个SCB和一个UDB SPI主控器同时启动)。 或者做一个新的范围射击,使用上面的WorkStudioB.CyWrk.Soviv.Zip,显示SCLK、SS和MoSi线(也可能是UART TX线)。如果可能的话,尝试让波形填满整个屏幕,直接从正面做照片并上传更高质量的照片(原来的照片没有提供足够的细节来评估问题)。 确保没有其他连接到您的PCB上的SPI引脚。 以上来自于百度翻译 以下为原文 Can you share the project that you used to create the original scope shot? (The one that has a SCB and a UDB SPI master, started at the same time). Or do a new scope shot, using exactly the WorkspaceSCB.cywrk.Archive.zip from above, showing the SCLK, SS and MOSI lines (and maybe the UART TX line too). If possible, try to have the waveform fill out the complete screen, do the photo directly from the front and upload higher quality photo (the original one does not provide enough detail to assess the problem). Make sure nothing else is connected to the SPI pins on your PCB. |
|
|
|
lxhzx 发表于 2018-11-23 21:09 你的波形似乎都是正确的。你能附加范围的SS线吗?你能发布你的完整项目,让我们都可以看看你的所有设置。为此,使用 创建者-gt;文件& gt;创建工作区束(最小) 并附加生成的文件。 鲍勃 以上来自于百度翻译 以下为原文 Your waveforms both seem to be correct. Can you additionally scope the ss-line? And can you please post your complete project so that we all can have a look at all of your settings. To do so, use Creator->File->Create Workspace Bundle (minimal) and attach the resulting file. Bob |
|
|
|
houjunhao33 发表于 2018-11-23 20:58 KARANTAK2013Y2069006SRIEB: 以前,我写的驱动程序与ADESTO闪存IC,… ……请验证其波形。 …让我知道我做的是错误的方式或者别的什么。 早日答复和帮助将是真正有益的我。 你做错的第一件事是,即使在被要求时,你也不提供必要的信息。 我问你哪个内存设备坏了,你拒绝透露细节。 你要求验证波形——我们应该如何检查你在第一个帖子中提供的波形是错误的原因?没有显示从选择信号-现在,我们应该检查,如果可能有可能是奴隶选择信号正在制造麻烦,而没有一个数据表来检查它?SPI接口处理上升/下降边缘的数据-您提供的初始波形都应该工作,因为数据线在时钟边缘上具有相同的值。所以,也许还有另一件我们目前看不到的事情。 因此,最好的方法是另外提供一个项目来完成项目的前几次内存访问。 你要求早日回复,但你自己在慢慢减慢这个过程。那么,再一次,究竟是哪种存储设备,以及它是如何连接的? 当做 以上来自于百度翻译 以下为原文 karantak2013_2068006 schrieb:The first thing you're doing wrong is that you don't provide necessary information even when asked for. I asked you which memory device is not working, and you refuse to give details. You ask for verifying waveforms - how should we check that the waveforms you provided in the first post are the cause of the error? There's no slave select signal shown - now, how should we check if it's maybe possible that the slave select signal is making trouble without having a datasheet to check against it? SPI interface handles data on rising/falling edges - the initial waveforms you provided should both work, since the data lines have the same value on the clock edge. So, maybe there's another thing which we currently cannot see. So, best way is to additionally provide a project which does the first few memory accesses of your project. You ask for early reply, but you're slowing down the process by yourself. So, once again: which memory device exactly, and how it's connected? Regards |
|
|
|
你好。 我附上了AdStflash闪存集成电路的代码。既有SPI组件,又有UDB和SCB。 还附上ADESTO闪存集成电路的数据表。 请尽管去。 我将非常感谢你的帮助。 感谢和问候 AT56Db321E.PDF 2.3兆字节 FLAS-1001.CYWRK.Soviv.UbbgWork.Zip 2.1兆字节 FLAS-1001.CYWRK.Soviv.ScBu.No.Work.Zip 2.1兆字节 以上来自于百度翻译 以下为原文 Hello . I have attached the code for interfacing of adesto flash IC . with both SPI component i.e UDB and SCB respectfully . also attached the data sheet of adesto flash IC . Please go though it . i will be greatfull for your help . thanks and regards
|
|
|
|
因为这是两个不同的项目-你是如何让他们在同一个范围的照片?现在看来,代码在“4245”上的行为是有意的。所以原因可能在你的板上(是柏木板,还是你自己做的东西?),或者使用范围的方式。 哦,看看SCB项目:这不是你用来创建那个范围照片的那个。 查看代码:在执行SPIX1SPIUARTRADRXDATA之前,需要检查数据传输是否已经完成,否则可能会被垃圾处理。你需要发送虚拟字节(你注释的代码)。 以上来自于百度翻译 以下为原文 Since these are two different projects - how did you get them to be on the same scope photo? AFAIK for now the code behaves as intended on a '4245. So the reason might be in your board (is it a Cypress board, or something you made yourself?), or in the way you are using the scope. Oh, and looking at the SCB project: this is not the one you have used to create that scope photo. Looking at the code: before you do SPI_1_SpiUartReadRxData you need to check that the data transfer has actually finished, otherwise you might get garbage. And you need to send the dummy byte (the code you commented out). |
|
|
|
lxhzx 发表于 2018-11-23 22:01 我使用CY8CITK-042-BLE先锋基板。 我认为有混淆,范围图像是不同的项目白色波作为参考UDB块,黄色波形是SCB。 1次取一个组分。 是的,范围图像是在调试之后拍摄的,它们只用于单字节发送。 在范围图像中,我展示了UDB和SCB的比较。 以上来自于百度翻译 以下为原文 I'am using CY8CKIT-042-BLE PIONEER BASEBOARD . i think there is confusion, scope images are of different projects white wavefrom is taken as reference for UDB block , and yellow waveform are for SCB . One component is taken at 1 time . Yes , the scope images are taken after debugging they are only for single byte send . At scope images , i have shown the comparison for UDB and SCB . |
|
|
|
houjunhao33 发表于 2018-11-23 22:19 问题是,我们不能看到SCLK的SCB版本-这是什么有趣的(连同SS)。你能做一个(伯特质量)范围照片只是为了SCB版本传输0x55? 以上来自于百度翻译 以下为原文 The problem is that we cannot see SCLK for the SCB version - thats what is interesting (together with SS). Can you do a (bertter quality) scope photo just for the SCB version transferring a 0x55? |
|
|
|
houjunhao33 发表于 2018-11-23 22:19 因为我拥有一个CY8CITK-042-BLE先锋板(虽然不是A版本),所以我尝试了你的WorkStudioS.CyWrk.Sovi.Zip(应该把一个0x55转移到SPI上)。这是我在我的范围内得到的: 看起来好像它是故意的。如果你不能让这个工作,你要么在你的板上的问题,在你已经附加到它的东西,或者你的范围设置。 以上来自于百度翻译 以下为原文 Since I do own a CY8CKIT-042-BLE PIONEER board (not the A version, though), so I tried your WorkspaceSCB.cywrk.Archive.zip (the one that should transfer a 0x55 over SPI). This is what I got on my scope: Looks as if it works as intended. If you cannot get that one to work, you have either a problem in your board, in something you have attached to it, or with your scope setup. |
|
|
|
lxhzx 发表于 2018-11-23 22:52 是的,我得到了类似的波形,看看你得到的数据,它看起来像0010个0101,而不是0101个0101。 你说什么?这没什么意思吗?? 以上来自于百度翻译 以下为原文 Yes , i am getting similar waveform , look at the data you got , it looks like 0010 0101 , instead of 0101 0101 . what do u say .?? is it not interesting .?? |
|
|
|
看看你得到的数据,它看起来像0010个0101,而不是0101个0101。 不,他按预定的速度拿到了0x55。甚至他的范围都说它是0x55(看屏幕截图的底部)。 你可以检查:在时钟的第一个上升沿,数据线是零,在下一个上升沿,它是一个,重复四次,等于0x55。 以上来自于百度翻译 以下为原文 look at the data you got , it looks like 0010 0101 , instead of 0101 0101 .Nope, he gets 0x55 as intended. Even his scope says it's 0x55 (look at the bottom of the screenshot). You can check: on the first rising edge of clock, the data line is zero, on the next rising edge it's one, repeating four times, equals to 0x55 |
|
|
|
子璇ALICE 发表于 2018-11-23 23:13 OHK,我同意这一点,但我的代码不与使用相同驱动程序的SCB块一起工作。 我需要清除中断或是什么? 或者我需要改变任何设置吗?? 如果你用UDB块检查0x55数据的相同传输,你会发现完美的波形。 以上来自于百度翻译 以下为原文 ohk , i agree with this but still my code is not working with SCB block with same drivers . Do i need to clear the interrupts or what . or Do i need to change any settings .?? if you check same transmission of 0x55 data with UDB block , you will find perfect waveform . |
|
|
|
真正的问题是你的内存设备在UDB和SCB版本的所有四行(MOSI,MISO,SCLK和/SS)上都得到了什么。那就有可能检查出什么地方出错了。 当做 以上来自于百度翻译 以下为原文 The real question is what your memory device gets on all four lines (MOSI, MISO, SCLK and /SS) for both UDB and SCB version. Then it should be possible to check what's going wrong. Regards |
|
|
|
好的,现在SCB在你的板上的行为是显而易见的。 我已经写了你的代码有什么问题。在UDB版本中,Read Syr()函数也是错误的,因为它根本不读状态寄存器。你可能很幸运,它总是读取1的“准备”标志(可能你从一个空的RX FIFO得到的值是UDB和SCB版本之间的变化,你正在寻找)。 你从来没有检查SPI的完成-写功能只是把数据放入TXFIFO,但不要等待数据发送。在Read IsR()中,不发送所需的哑字节。 以上来自于百度翻译 以下为原文 OK, its obvious now that the SCB is behaving as intended on your board. I already wrote what is wrong with your code. Looking at the UDB version, the read_sr() function is wrong there too since it never reads the status register at all. You might just have been lucky that it always read a 1 for the 'ready' flag (and probably the value you get from an empty RX FIFO is the change between UDB and SCB version you are looking for). You never check the SPI for completion - the write functions just place data into the TX FIFO, but do not wait for the data to be send. In read_sr() you don't send the needed dummy bytes. |
|
|
|
只有小组成员才能发言,加入小组>>
754个成员聚集在这个小组
加入小组2100 浏览 1 评论
1846 浏览 1 评论
3664 浏览 1 评论
请问可以直接使用来自FX2LP固件的端点向主机FIFO写入数据吗?
1782 浏览 6 评论
1532 浏览 1 评论
CY8C4025LQI在程序中调用函数,通过示波器观察SCL引脚波形,无法将pin0.4(SCL)下拉是什么原因导致?
559浏览 2评论
CYUSB3065焊接到USB3.0 TYPE-B口的焊接触点就无法使用是什么原因导致的?
410浏览 2评论
CX3连接Camera修改分辨率之后,播放器无法播出camera的画面怎么解决?
433浏览 2评论
379浏览 2评论
使用stm32+cyw43438 wifi驱动whd,WHD驱动固件加载失败的原因?
905浏览 2评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-12-19 16:07 , Processed in 1.424307 second(s), Total 114, Slave 98 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号