我假设您已经阅读了和声示例文档,并且您看到了LeD2被点亮,表示失败。嗯,我在文档中没有明确指出的事情是,为了进行回环测试,您必须将SDO1与SDI1连接到外部。也许他们认为很明显,一个回环项目需要你把东西循环回去。我认为它应该是三步序列中的第0步(因此它是一个四步序列)。这个问题的底线是:当我连接SDO1(RD0)到SDI1(RC4)时,LeD3被点亮,表示成功。删除外部连接,单击MPLABX工具栏图标“保持复位”,然后“从复位释放”,并点亮LED 2。重新连接外部跳线,重置和释放,并且LeD3被点亮。现在,如果你不使用起动器工具包I/O扩展板(或者你的UKII插入的其他东西),我不知道你将如何做出外部连接,但是如果你是,你可以查找连接。在USK2示意图和扩展板示意图上看到J10和/或J11上的引脚对应于RD0和RC4。我使用PICTHE原型板插入到扩展板中,对于这些信号,标记的名称用于此。(注意:对于一些信号和一些初学者工具包模块,标记在PICTHOST PROTION板上的名称已经被稍微加扰,所以总是检查图表。)我不是一个和谐的家伙。我说这并不意味着贬低和谐,但我的意思是我根本没有足够的经验去帮助别人。有一个和谐的子开云(中国)官方。也许你可以在那里问一些和谐的问题。如果你只想测试SPI,你可以写一个裸露的金属(非和谐)项目来初始化SPI模块并锻炼它。最后,一个或两个意见(参见脚注):(/开始意见)我讨厌USSKII板没有重置按钮。在开发过程中,即使最终产品没有重置功能,也总是需要重置按钮。我(几乎)总是布置PCB来容纳一个复位开关,或者至少有一个垫板,我可以将电线连接到一个外部复位按钮。我(几乎)总是把这样的测试放在一个循环中,这样我就可以连接和断开外部跳线,看到LED图案的变化。可以观察一个范围内的位模式,看看到底发生了什么。[ DaveFootnote ]:这里表达的意见不一定是我自己的。这是我脑子里的声音。
以上来自于百度翻译
以下为原文
I am assuming you have read the Harmony Examples documentation and you see that LED2 is lit, indicating failure.
Well, the thing that I don't remember seeing explicitly stated in the documentation is that in order to do the loopback test you have to connect SDO1 to SDI1
externally. Maybe they thought it was obvious that a loopback project requires
you to loop something back. I think it should have been Step 0 in the three-step sequence (thus making it a four-step sequence).
Bottom line for this part of your question: When I connect SDO1 (RD0) to SDI1 (RC4), LED3 is lit, indicating success. Remove the external connection, click the MPLABX toolbar icon for "Hold in Reset" then "Release from Reset" and LED2 is lit. Reconnect the external jumper, Reset and Release, and LED3 is lit.
Now, if you aren't working with a Starter Kit I/O Expansion Board (or something else that your USKII is plugged into), I don't know how the heck you would make the external connection, but if you are, you can look up the connections on the USK2 schematic and the Expansion Board schematic to see what pins on J10 and/or J11 correspond to RD0 and RC4.
I use a PICTail prototype board plugged into the Expansion Board and, for these signals, the marked names work for this. (Beware: For some few Signals and some few Starter Kit modules, the names marked on the PICtail protype board have been scrambled slightly, so always check the schematics.)
I'm not a Harmony guy. I say this not meaning to disparage Harmony, but I mean that I simply don't have enough experience to try to help others. There is a Harmony subforum. Maybe you can ask Harmony-specific questions there.
If you just want to test SPI, you can write a bare-metal (non-Harmony) project that initializes a SPI module and exercises it.
Finally, an opinion or two (see Footnote):
[/Begin Opinion]
- I hate it that the USKII board doesn't have a reset button. I always need a reset button during development, even if the final product doesn't have a reset function. I (almost) always lay out the PCB to accommodate a Reset switch, or at least with pads to which I can connect wires to an external reset button.
- I hate one-and-done tests like this. I (almost) always put tests like this in a loop so that I can connect and disconnect the external jumper and see the LED pattern change. Can observe bit patterns on a 'scope to see what the heck is going on.
[/End Opinion]
Regards,
Dave
Footnote:
The opinions expressed here are not necessarily my own.
It's these dang voices in my head.