Jump to content
  • 0

Change CS Pin from WIFI Shield


Lukas

Question

Hi,

i´m using the UNO32 with Mpide. I connected the UNO32 with a external sd card and the MRF24WG0MA wifi modul from Microchip. Together they work exactly like the Wifi shield (e.g. the CKEasyWifiConfig ConfigFromSD example works/worked).

But now my Pin 10 is broken and i want to use a other chip select pin for the Wifi module.

  • Can someone please tell me where i can change the chip select pin for the wifi shield?

In addition i use another SPI device and also I2C. I have problems using the SPI/DSPI librarys together with the SD library.

  • Are the following librarys compatible with DSPI.h and Wire.h?

#include <WiFiShieldOrPmodWiFi_G.h>
#include <DNETcK.h>
#include <DWIFIcK.h>

Thank you and sorry for my english.

Link to comment
Share on other sites

7 answers to this question

Recommended Posts

Hi Lukas,

I know that (unfortunately) you will not be able to use an alternate chip select pin for the WiFi Shield. The reason for this is because there is a trace connecting pin 10 to the chip select pin on the WiFi module on the shield. Although, you may want to make sure that the JP4 jumper is set so that the jumper block is connecting pin 10 to RG9 to ensure that that WiFiShieldOrPmodWiFi_G.h works correctly. 

As for the compatibility of the libraries, I think that they should be compatible in principle presuming that you declare an appropriate alternate pin that you can easily access that is not otherwise used by the WiFi Shield or the SD card, but I do not know this for certain. The support team will get back to you here on the forum with a more accurate answer.

Thanks,
JColvin

Link to comment
Share on other sites

Hi Kaitlyn and JColvin,

i did not try it but can i do the following and are there side effects? I would change in: libraries/WiFiShieldOrPmodWiFi_G/Uno32-MRF24WG.x

#define WF_CS_TRIS         (TRISGbits.TRISG9)
#define WF_CS_IO         (LATGbits.LATG9)

with:

#define WF_CS_TRIS         (TRISDbits.TRISD3)
#define WF_CS_IO         (LATDbits.LATD3)

I'm flexible with my pins, my board looks like this: https://www.dropbox.com/s/jgr1n8rbn0y2g4j/my_uno32.jpg?dl=0

I´m able to send images from SD over wifi to my Android App. I'm able to get pictures and save them on SD with some difficulties. But if I merge my code together nothing works :(

--------------------------------------------------------------------------------------------------

Now i attached example code for you to show the incompatibility of the libraries. It is a modified version of the "ConfigFromSD" example. You only need your Wifi-Shield and a additional SPI device and connect his SlaveSelect to Pin 9 (with pullup-resistor). Furthermore please change the address and value in the loop() for your requirements. Try first with #define SPI_ONLY to see if your device is working (it should..) and then comment "#define SPI_ONLY" out and try again. 

It makes no difference wheter you use DSPI.h or SPI.h.

Thanks,

Lukas

ConfigFromSD_SPI.pde

Link to comment
Share on other sites

Lukas,

Do you mean pin 10 is broken on the UNO32 or the WifiShield?  If the pin is bad on the WifiShield then there isn't much that can be done.  If the pin is bad on the UNO32 then it can be remapped but doing some risky things like cutting traces and resoldering connections.  Unless you are really confident, I suggest buying a new board.

Have you seen the deWebServer that is in the 20150626-test build of MPIDE?  It has a lot of good details in there.

Best of luck,

Marshall

Link to comment
Share on other sites

Do you mean pin 10 is broken on the UNO32 or the WifiShield?

It is broken on the UNO32. I do not realy use the WifiShield, please see my uploaded picture.

That is why i asked about the #defines. I still wait for the answer.

Have you seen the deWebServer that is in the 20150626-test build of MPIDE?

I tried to download it (document number DSD-0000485) but the page where not found:

http://www.digilentinc.com/Data/Products/CHIPKIT-WIFIRE/deIPcK.zip

 Still did not get an reply on my uploaded example code, maybe they know a simple solution to the problem. I could also use other libraries but do not know which. Switching to a plattform other than ChipKIT could also solve the problem but i want to bring cameras alive in this community.

Link to comment
Share on other sites

Lukas,

It is broken on the UNO32. I do not realy use the WifiShield, please see my uploaded picture.

That is why i asked about the #defines. I still wait for the answer.

I couldn't see the picture last night.  Then yes, remapping the pin as you suggested will work.  

You can find the latest test builds of MPIDE here.  I have used the 20150626-test build with the wifi library built in.

http://chipkit.s3.amazonaws.com/index.html

Best of luck,

Marshall

Link to comment
Share on other sites

Lukas, 

The latest version of MPIDE has the network stacks included in it. 

I would HIGHLY recommend using that version. There are a few bugs that have been worked out. 

 

The other issue is that the processor on the Uno32 will most likely not be able to run both the network stack AND cameras. This is one of the reasons why we recommend the UC32 instead. The newest version of the HTTP Server, 

 

  • chipKITEthernet ---> This is the original drop of MPIDE that is a direct port from the Arduino Network stack, it's extremely top heavy and not optimized in any way (hard to combine other libraries with it). 
  • DNETck/DWIFIck--> This was the first version of the Network Stack that was created for the WiFi Shield. It uses Microchip's MLA for the software (not fully Open Source) Since then it's been updated and optimized to 
  • DEIPcK/ DEWFcK--> This should be included in the latest version of MPIDE, it is completely open source and supports both the Pic32MX (which is on the Uno, UC, Cmod CK, DP32 and WF32) and the Pic32 MZ (Wifire) . This libary uses a memory abstraction layer to make it compatible with the WiFire... this abstraction layer may require more resources than that is available on the uC32. 

 

As for redefining pins. 

For you to be able to do that you will need to dig fairly deeply. 

The first is that all pin definitions are loaded in chipKIT's Board Def file. Here's a good tutorial for that: http://www.instructables.com/id/Finding-MPIDE-Board-Defs/

Once you have switched a pin around, then you will need to double check that each of the libraries used for the network libraries didn't use that pin. 

If you are using the Uno32, then you may have better luck using the older version of the library (DNETcK/ DWIFick), this library doesn't use the abstraction layer and may be simpler to peel back the code all the way to the pin.


DNETck vs DEIPck

Hope this helps. 

PS. regards to a broken link, you should be able to get your documentation here: https://reference.digilentinc.com/doku.php Since the latest Network stacks are inside of the newest MPIDE deployment, (I didn't link directly to the page). 

 

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...