完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
电子发烧友论坛|
和谐帮助手册(VL V)有一个很好的,可理解的SPI部分。在开始的部分,它显示的数据线是MISO(主从/退出),MOSI(主输出/从在)和SCLK(串行时钟)。但是哪些信号或PIN号对应于MOSI、MISO和SCLK?我去了PIC32 MZ(EF)启动器套件文档,它显示了J12标题,这三个信号被识别为函数2。函数2是什么意思?-在文件中没有解释。这些信号的函数1定义分别表示用于引脚90, 91和109的Rf4、Rf5、Rd1。这些名称与PICH图一致,PIC32 MZ数据表(DS600 01320D)中的144针设备的PIN名称。现在我使用MHC来配置SPI驱动器,然后转到PIN图或PIN管理器中,我在引脚图上没有看到这些指定。此外,我不知道这些引脚在哪里被和谐地识别为SPI引脚。我检查了所有SPI演示示例,它们有不同的PIN定义(并且没有显示MOSI、MISO或SCLK)。那么,如果没有PIN定义,SPI如何协调工作?
以上来自于百度翻译 以下为原文 The HARMony help manual (Vol V) has a nice, understandable section on SPI. At the beginning of the section, it shows the data lines are MISO (Master In/slave Out), MOSI (Master out/slave in) and SCLK (serial clock). But which signals or pin number correspond to MOSI, MISO and SCLK? I went to the PIC32MZ (EF) Starter Kit documentation and it shows the J12 header with those three signals identified as Function 2. (What does Function 2 mean? — it is not explained in the document). The Function 1 definitions for those signals show RF4, RF5, RD1 for pins 90, 91, and 109, respectively. These names agree with the pin diagram in Harmony and the Pin Names for 144-pin devices in the PIC32MZ datasheet (DS60001320D). Now I use MHC to configure the SPI driver, then go to the pin diagram or pin manager in Harmony, I do not see these designations on the pin diagram. Also, I do not see where these pins are ever identified in Harmony as SPI pins. I checked all of the SPI demo examples and they have different pin definitions (and none of them show MOSI, MISO or SCLK). So how does Harmony work for SPI if there is are no pin definitions? |
|
相关推荐
19个回答
|
|
|
我不是一个和谐专家,当我统计一个新的和谐项目,选择驱动程序,SPI,看看PIN表,我看到许多选项可用于SPI模块(SPIXDX X),我有CHOSENE,它们由蓝色ScaReScript表示,这个设备有PPS,所以SDI/SDO可以映射到它们最的地方。方便。
以上来自于百度翻译 以下为原文 I am not a Harmony expert When I stat a new Harmony Project and select Drivers, SPI and have a look at the Pin Table I see many options available for the SPI Module ( SPI_D_x ) I have chosen They are indicated by the blue squares This device has PPS so the SDI/SDO may be mapped to where they are most convenient. |
|
|
|
|
|
许多PIC32 MCU中的几个SPI模块:SPI1、SPI2……选择在MHC选项中启用哪些SPI模块,并配置它们(它们不必按顺序)。-在MHC2xxx引脚Digar中选择每个SPI用于MHC PIN图/MHC引脚设置(使用MHCV2052为OrthyV20501)的PIN。你可以点击每个引脚的蓝色反应角,并选择它的功能(每个引脚变化),或使用相同的引脚设置下拉。
以上来自于百度翻译 以下为原文 Several SPI modules in many of the PIC32 MCUs: SPI1, SPI2... - Select which SPI modules to enable in MHC Options, and configure them (They don't have to be in order). - Select the pins you want each SPI to use in MHC Pin Diagram/ MHC Pin Settings (Using MHCv2052 for HarmonyV20501) In MHC2xxx Pin Diagram you can click on the blue reactangle of each pin and select its function (varies per pin), or do same using pulldown in Pin Settings. |
|
|
|
|
|
我在PIN管理器中找到了SPIX和SPOX设置。我还猜到SCKX是串行时钟的设置。一旦这些引脚被设置,和谐如何知道它们?我在MHC/SPI中看不到要求PIN号(或名称)的东西。
以上来自于百度翻译 以下为原文 I kinda figured the SPIx and SPOx settings in the pin manager. I also guessed at the SCKx is the setting for the serial clock. Once these pins are set, how does Harmony know about them? I see nothing in MHC/SPI that asks for the pin number (or name). |
|
|
|
|
|
我是否可以大胆地向您介绍“文档”,特别是卷V、MPLAB和谐框架参考、外围库帮助、端口外围库、库接口、外围PIN选择功能、PrimpPosisPyRePaPosivin函数,对于输入ReppAppIn有类似的功能。输出引脚映射。引脚映射是一个非常强大的功能,具有多种功能。
以上来自于百度翻译 以下为原文 Might I be so daring as to refer you to the "documentation" Specifically Volume V, MPLAB Harmony Framework Reference, Peripheral Libraries Help, Ports Peripheral Library, Library Interface, Peripheral Pin Select Functions, PLIB_PORTS_RemapInput function for the Input remapping There is a similar function for Output pin mapping. Pin Mapping is a very powerful feature with a multitude of functions. |
|
|
|
|
|
当你点击“生成代码”按钮时,MHC会接受你的所有设置,生成代码来映射它们以适应和声库,并将需要的生成文件和和声文件添加到你的项目中。对于SPI来说,它对我来说是很好的。对于其他模块,你可能不得不对生成的代码或补丁进行TWAL。虫子,保罗
以上来自于百度翻译 以下为原文 When you hit the "Generate Code" button MHC takes all your settings, generates code to map them to fit the Harmony libraries, and adds the required generated files and harmony files to your project. For SPI it worked fine for me. For other modules you might have to tweek the generated code, or patch bugs. Paul |
|
|
|
|
|
最好你做一些和谐教程,可能是从“Microchip开发者帮助”网站看到的过程。“演示”在和声帮助不是有用的,因为他们跳过大部分的MHC设置步骤。
以上来自于百度翻译 以下为原文 Best you do some harmony tutorials, possibly from "Microchip Developer Help" website, to see the process. The "demonstrations" in Harmony help aren't as useful as they skip most of the MHC setting steps. |
|
|
|
|
|
我花了2天时间在和谐文献的仙境中进行了一次大雁追逐。我搜索了5个和谐卷,开发者网站,和声例子。我现在对PPS和输入映射有了更多的了解,但是我并没有回答我最初的问题。下面是我发现的:MHC/PIN管理器:第三卷给出了一个对PIN管理器的很好的描述,但是它没有提到“函数”列以及它是如何定义的以及它是如何被使用的。我不得不采取尝试和错误的方法来理解正在发生的事情。我打开了SPILSPACKBACK演示项目,并查看了第1卷/驱动程序演示中的示例文档。该图(在第1卷)显示了如何在MZ EF启动器套件扩展板上连接输入和输出信号。我检查了PIN管理器定义的引脚69, 121, 98和25,它们分别被正确地定义为SD1I、SD12、SDO1和SDO2。我改变了SDI1让它“可用”。当我点击ICODE按钮时,MHC生成了StasyCon Fig .h,StasyIn.c等的正常文件。但是,这些文件不包含任何对我的信号的引用。保罗建议在某个地方使用一个输入ReMAP函数,因此经过长时间的搜索,我终于找到了文件L。Oct/Apvics/Microchip / Orthy/V2Y05/Apps/Studio/SPI/LoopBuff/固件/SRC/StulySCOFIG/PIC32 MZYEFSKIGITIN DYN/Frrase/Stuts/SrC/SysPosiStSimult.C,包含了IntReRePoP()调用。这是一个惊喜,因为我认为框架文件没有改变MHC -这意味着每个项目可以有不同的框架源代码?回到第5卷/ SPI驱动程序库,我看到主控器和从机之间应该有一个SCK(串行时钟)连接。SPIXLoCuff-Demo示例(和第1卷文档)没有SCK连接。我检查了SPIX多从演示和开发者网站SPI演示,它们也没有显示SCK连接,所以SPI如何在主控和主从之间没有时钟信号的情况下工作?MPLAB X IDE:我尝试使用MPLAX中的find函数在演示项目中跟踪多个参数。一些关键参数无法被跟踪。我认为这些必须是内联源或库调用还是????我认为,当我用枚举参数跟踪PLIB调用时,它可能是另外一回事。围绕这一点花了很多时间。所以,我还没有找到“SPI”的“魔法”,如文档或开发人员网站中描述的那样。
以上来自于百度翻译 以下为原文 I just spent 2 days on a wild goose chase in the fairyland of Harmony documentation. I searched the 5 Harmony volumes, the developer website, and the Harmony examples. I now know more about PPS and InputRemapping but I am no closer to answering my original questions. Here is what I found so far: MHC/Pin Manager: Vol. III gives a nice description of the Pin Manager, but it fails to mention the “Function” column and how it is defined and how it is used. I had to resort to trial-and-error methods to understand what was happening. I opened the spi_loopback demo project and looked at the documentation for that example in Vol. 1/Driver Demonstrations. The figure (in Vol 1) shows how to wire the input and output signals on the MZ EF Starter Kit expansion board. I checked the Pin Manager definitions for pins 69, 121, 98, and 25 and they were correctly defined as SD1I, SD12, SDO1, and SDO2 respectively. I changed SDI1 to make it “Available”. When I clicked the icode button, MHC generated the normal files for system_config.h, system_init.c, etc. However, these files did not contain any references to my signals. Paul suggested there is an input remap function that is used somewhere, so after a long search, I finally found that the file, located at /Applications/microchip/harmony/v2_05/apps/driver/spi/spi_loopback/firmware/src/system_config/pic32mz_ef_sk_int_dyn/framework/system/ports/src/sys_ports_static.c, contained the InputRemap() calls. This was a surprise to me because I thought the framework files were not changed by MHC — does this means that every project can have different framework source code? Going back to Vol. 5/SPI Driver Library, I saw that there should be an SCK (serial clock) connection between the master and slave. The spi_loopback demo example (and the Vol. 1 documentation) does not have an SCK connection. I checked the spi_multislave demo and the developer website SPI demo and they do not show an SCK connection either, so how does SPI work without a clock signal between the master and slave? MPLAB X IDE: I tried to trace a number of parameters in the demo projects using the Find function in MPLAB X. Some of the key parameters could not be traced. I think these must have been inline source or library calls or ???. I think it occurred when I was tracing PLIB calls with enumerated arguments, but it could be something else. Working around this took a lot of time. So, I still have not found the “magic” that makes SPI work as described in the documentation or on the developer website. |
|
|
|
|
|
你是在建立一个有用的董事会还是为下一个出版物做这个研究?
以上来自于百度翻译 以下为原文 Are you building a board with a use in mind or is this research for your next publication ? |
|
|
|
|
|
是的,也许是。这项研究着眼于如何在董事会层面上沟通2个PIC32设备。SPI文件似乎处理除了我上面记录的松散的末端。还有其他的可能性:I2C和EBI。TCP/IP可以在没有电缆的板级吗?如果我发现一些不在微芯片文档中的东西,我可能会在这个论坛上发布一个更小的“积木”电子书。
以上来自于百度翻译 以下为原文 Yes and maybe. The research is looking at how to communicate between 2 PIC32 devices at the board level. The SPI documentation appeared to deal with that except for the loose ends I documented above. There are other possibilities: I2C and EBI. Is TCP/IP possible at the board level without a cable? If I find something that is not in the Microchip documents, I might publish a smaller "building block" eBook as has been suggested in this forum. |
|
|
|
|
|
我在另一个帖子中创建了附件,但是最后一部分“选项”也在这里应用。= MHCYCRATION项目不需要ObjSPV.V0.PR.TXT SCK。如果回环到同一端口,可能没有回环显示SCK。即SDO2连接到SDI2,因此两者都使用相同的SCK2和SS2引脚。对于SPI到单独的设备,您需要4个引脚:SS1-、SCK1、SDO1、SDI1分配引脚,如上面文件中的PIN图所示,不要混淆它们的自动设置在“PIN设置”,因为这些是SP。特殊功能管脚保罗
以上来自于百度翻译 以下为原文 I created the attached in answer to another post, but the last part "Option" applies here as well. = MHC_CreatingProjectWithoutBSP_v00PR.txt SCK is needed. Possibly SCK isn't shown for Loopback if loopback to same port. i.e. SDO2 is connected back to SDI2, and both in and out therefore use the same SCK2 and SS2 pins. For SPI to a separate device you will need 4pins: SS1-, SCK1, SDO1, SDI1 Assign the pins as shown in above file in Pin Diagram, don't mess with their automatic settings in "Pin Settings" as these are special function pins. Paul Attachment(s) MHC_CreatingProjectWithoutBSP_v00PR.txt (4.10 KB) - downloaded 95 times |
|
|
|
|
|
谢谢保罗。我确信SCK是需要的。问题是它是在哪里定义的,所以SPI驱动程序可以使用它来把时钟发送给从机。BTW——SPI驱动程序库文档说明SPI模块可以使用2, 3根或4根导线。最后,我将测试这些。
以上来自于百度翻译 以下为原文 Thanks Paul. I was sure the SCK is needed. The question is where is it defined so the SPI driver could use it to send the clock to the slave. BTW - the SPI Driver Library documentation says the SPI module can work with 2, 3, or 4 wires. Eventually, I will test these out. |
|
|
|
|
|
嗨,在我看来,原来的问题与其说是一个和谐问题,不如说是关于SPI通信的一般解释、理解和术语。从一个设备输出的SPI信号被输入到其他设备。S输入和输出,避免连接输出到输出的错误,以及输入到输入,一些设计者使用术语:MISO是主输入,从输出,关于主设备的SDI引脚连接到SLO的SDO。MOSI是主输出,从输入,意味着SDO pin师父的连接。在每一个PIC设备本身的文档中,特别是PIC微控制器,它可以被配置为主控或从属,通过改变控制寄存器中的位,术语不工作。SDI管脚总是被输入,不管主控器还是Slave role.SDO pin。PIC文件是主控还是从站输出,因此PIC文件不使用MOSI和MISO进行PIN描述。微芯片在PIC数据表中使用SCKX作为SPI时钟信号。迈西尔
以上来自于百度翻译 以下为原文 Hi, Seem to me the the original question is not so much a Harmony question, and more about general explaining, understanding and terminology about SPI communication. SPI signals that is Output from one device, are Input to the other devices. In order to avoid misunderstanding about what end of a wire is input and output, and avoid mistakes connecting Output to Output, and Input to Input, some designers use the terminology: MISO is Master Input, Slave Output, about the wire connecting SDI pin of Master device to SDO of Slave. MOSI is Master Output, Slave Input, meaning connection of Master SDO pin to SDI of Slave device. In documentation of each PIC device in itself, and especially PIC microcontroller that may be configured to function either as Master or Slave, by changing a bit in a control register, the terminology do not work. SDI pin is always Input regardless of Master or Slave role. SDO pin is always Output whether PIC is working as Master or Slave. Thus PIC documentation do not use MOSI and MISO for pin descriptions. Microchip use SCKx for SPI Clock signal in PIC datasheets. Mysil |
|
|
|
|
|
太糟糕的是,MysIL的简单解释不在微芯片文档中。然而,我仍然无法找到和谐输出SPI时钟信号的地方。其他信号出现在SysStPixStimult.c例程的重映射中,而不是在PIN管理器中定义的SCK1信号。在MHC中一定有一些我找不到的隐藏代码。有人吗?
以上来自于百度翻译 以下为原文 Too bad Mysil's simple explanation is not in the Microchip documentation. However, I still cannot find where Harmony outputs the SPI clock signal. The other signals show up in the remapping in the sys_port_static.c routine, but not the SCK1 signal I defined in the pin manager. There must be some hidden code in MHC that I cannot find. Anyone? |
|
|
|
|
|
SCK线通常是固定的,不能重新映射。
以上来自于百度翻译 以下为原文 The SCK line is usually fixed and can't be remapped |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MZ数据表页码?还是和谐代码片段?
以上来自于百度翻译 以下为原文 MZ datasheet page number? or Harmony code snippet? |
|
|
|
|
|
当您告诉它发送一个字节时,SCK信令由SPI模块自己来处理。SCK PIN有固定的PIN号,并且不能在PIN管理器中改变,但是它应该允许您选择它到* * *固定的PIN号。
以上来自于百度翻译 以下为原文 The SCK signaling is handled by the SPI module itself when you tell it to transmit a byte. the SCK pin has a fixed pin number and can't be changed in the pin manager, however it should allow you to select it to *again* the fixed pin number. |
|
|
|
|
|
具体地说,MZ 144引脚器件上的哪一个引脚?
以上来自于百度翻译 以下为原文 Specifically which pin on an MZ 144-pin device? |
|
|
|
|
只有小组成员才能发言,加入小组>>
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
473 浏览 0 评论
5793 浏览 9 评论
2334 浏览 8 评论
2224 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3530 浏览 3 评论
1124浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
1095浏览 1评论
我是Microchip 的代理商,有PIC16F1829T-I/SS 技术问题可以咨询我,微信:A-chip-Ti
873浏览 1评论
MPLAB X IDE V6.25版本怎么对bootloader和应用程序进行烧录
475浏览 0评论
/9
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2025-12-2 06:01 , Processed in 1.386225 second(s), Total 106, Slave 89 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191

淘帖
435