Jump to content
  • 0

PIC32 Pro MX7 w/ Pmodnic100


krbvroc1

Question

I just bought this board. I am using Microchip's MPLAB X IDE + Harmony stuff. (I received Rev A of the board, but the website and documentation show Rev C is the latest). Where is the changelog?

Ultimately I want to get dual ethernet working. I got the internal Ethernet working (can ping it) and have now shifted to just getting the Pmodnic100 working. The harmony libraries support

the ENCX24J600 device as well as SPI. However I cannot get this to work.

I installed the Pmod into port JF which would appear to be wired to the SPI4 channel.

I am confused about several things.

1) Properly configuring SPI

2) Properly configuring ENCX24J600

Anyone have settings/config to help with this?

Some things that confuse me -

I am really confused about configuring the pin settings.  Since I selected SPI4 channel, it appears that is taken care of for SCK4, SDI4, SDO4. However what about chip select and the interrupts? Using the MPLAB Harmony Configurator and selecting the ENCX24J600, it ask for the SPI Slave Select Port info 'the GPIO pin hooked up to the CS/SS pin of the ENCX24J600'. I selected Port F, Bit Pos 12. That would seem to be RF12 which should be connected JF-01 of the Pmod. Right? And on the Pin Settings - I selected RF12 direction as OUT and Low (it that correct?) I would assume the driver manipulates this which is why it asked me to select the GPIO pin.

The INT/SPISEL pin would appear to be on JF-07 (RE9) so I left that pin as Input. The pmod datasheet says if that is floating or high, the SPI mode is enabled (versus a parallel mode).I let it as an input since I assume the driver might want interrupts. However I don't see where in either the ENCX24J600 or SPI options the driver would be told which pin the interrupt is on. How does it know?

For the SPI settings, there is a Clock to Use - it defaults to Peripheral bus 2- how many peripheral buses are there? Neither 2 or 1 worked. What should my SPI clock rate be?

Also, I set my peripheral bus to 10MHz, was that required? The MX7 datasheet showed that as a config value.

And under TCP/IP I selected the ENCX24J600 as the Interface but it doesn't work.

On my console (with Use TCP/IP Commands) and debug enabled, with the internal ethernet I has messages of:

TCP/IP Stack: Initialization Started

TCP/IP Stack: Initialization Ended - success

When trying this external device, I only get the Started.

So you can see I am obviously confused. Not sure how to debug this or if I am missing something.

Link to comment
Share on other sites

4 answers to this question

Recommended Posts

Hi krbvroc1,

Unfortunately I am not personally familiar with MPLAB X and Harmony, so I'll end up asking some of our applications engineers about this, but I do know that the reference manual for the PmodNIC100 is slightly incorrect. It says you can leave the INT/SPISEL floating or drive it high to tell the ENC424J600 to operate in serial SPI mode, but looking at the datasheet part, you instead need to have a pull-up resistor or pull-down resistor on that pin to correctly choose which mode the Microchip part is to operate in; otherwise you run the risk of driving the pin high when the part then pulls the line low to signal an interrupt, causing damage to the chip. I will definitely update the documentation to reflect this now.

The two PIC32 pins you listed for JF-01 and JF-07 are correct, and the 10 MHz rate for the SPI clock should be fine since the datasheet for the Microchip part lists a maximum SPI clock of 14 MHz.

I am not sure why it does not ask where the interrupt pin is; this may be because the interrupt can be disabled (although it appears to be enabled by default so the host controller (and thus the user) would have to implement it themselves. I know it would not be part of the SPI protocol, but I don't know why Microchip's Harmony would not account for it...

I'll ask some of our applications engineers to take a look at your other questions.

Thanks,
JColvin

Link to comment
Share on other sites

Thanks for your response and I look forward to what your application engineers have to say too.

For the INT/SPISEL issue, are you saying I need to modify the board myself to add a resistor? Since this is a Pmod board with limited pins there is no way to run it in any mode other than SPI so shouldn't the board have been designed that way out of the box? I bought one of these modules to try with this PIC32 and also with the Zybo Lynq board so I guess it is not going to work with either unless modified? I notice on the Pmodnic100 schematic there is a 200ohm resister between the pmod connector pin and the INT/SPISEL. Is this going to interfere with me trying to put a 100kohm pull up between JF-07 and JF-06 (or JF-12) Vdd. And what if my chip has been damaged due to following the instructions? How would I know or how would I get a replacement?

When I used the debugger yesterday it did appear that during the SPI communications it hangs during the detection of the device. The drivers send the 0x1234 to the device and then attempts to read it back which never completes. So it would seem the problem relates to SPI communication.

EDIT:  I soldered a 100kohm between pin JF-07 and JF-12 of the pmod connector. No difference. The harmony encx24j600 driver writes 0x1234 to the EUDAST register and never advances the state machine because it is not getting data back. I tried setting the driver to use polled mode rather than interrupt to make things as simple as possible, but no success.

Link to comment
Share on other sites

Hi krbvroc1,

To be honest, I do not know why the board was not designed to already have such a resistor since I agree that it seems fairly bizzare not to have one there. I have contacted our applications engineers again about this, although I know that Digilent does not write any of the software for Harmony, so I do not know for sure what could be done if there is a problem there. But naturally, we'll have to do some debugging on our end before we can claim anything, but this may take some time.

Thank you for your patience,
JColvin

Link to comment
Share on other sites

Hi krbvroc1,

Here is a link for the PmodNIC100. 

https://reference.digilentinc.com/pmod/pmod/nic100/example_code

Click on the link under MPIDE for Microchip's Terms of Use and accept terms. Once the libraries are downloaded and unzipped click on the PmodNIC100. Read the Readme.txt and follow the instructions. The MX7ck was rebranded to the Chipkit pro mx7. This will allow you to check and verify in MPIDE that the PmodNIC100 is working.  

thank you,

Jon

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...