chipKIT® Development Platform

Inspired by Arduino™

Move PmodOLED from JB to JA Header - 32MX4

Created Wed, 25 Jul 2012 22:47:13 +0000 by guvvy


guvvy

Wed, 25 Jul 2012 22:47:13 +0000

Hi,

I am new to programming for microcontrollers and my first task is to accept WiFi connections using the PmodWiFi add-on. I read that the default pin/port for the WiFi chip is the JB header on the 32MX4. The problem is that I currently have the PmodOLED add-on installed in the JB header, so I want to move it to the JA header. In PmodOLED.h (which I have imported into my library), I changed the following lines to correspond to the ports in the JA header instead of the JB header:

#define prtSelect     IOPORT_G 
#define prtDataCmd    IOPORT_B 
#define prtReset      IOPORT_D 
#define prtVbatCtrl   IOPORT_D 
#define prtVddCtrl    IOPORT_B 

#define bitSelect      BIT_9 
#define bitDataCmd     BIT_15 
#define bitReset       BIT_5 
#define bitVbatCtrl    BIT_4 
#define bitVddCtrl     BIT_14

However, when I run the code with the PModOLED attachment inserted into the JA header, it does not respond and the screen is blank. I would greatly appreciate it if you could tell me how to modify my code so that the PmodOLED add-on can be installed in the JA header.

Thanks in advance for your help, Guvvy


JordanR

Thu, 26 Jul 2012 19:18:56 +0000

Hello guvvy,

The PmodOLED uses SPI for ocmmunication. Therefore, you cannot just change the pin definitions to those on JA. In order to do this, you will have to use two 1x6-pin cables (or one 2x6-pin cable) and connect the PmodOLED to header J1. Then, in the library, you would have to change the SPI initialization to initialize SPI port 1 instead of SPI port 2.

Best Regards,

Jordan R Digilent