I'm using a ChipKit Mx7 Pro as a development platform, and have started out just trying to write some basic support routines for the user LEDs and buttons and talking to an LCD module as a warm-up before getting into my actual application code. Once these are vetted I plan to add support for the I2C, SPI and UART ports, essentially putting together a minimal BSP which should be useful in my final application.
I've got the LED routines written and am blissfully talking to the LCD module. I have BTNs 1 & 2 working but am having trouble reading button three. The Mx7 user manual states that since Button 3 is shared with the JTAG controller which is enabled on reset, the JTAG controller has to be disabled before button 3 can be accessed as an input. I assume from this that simply using the PLIB port bit configuration macros, i.e. setting PA-0 as an input, is not sufficient. Since my code for BTN 1 & 2 work and for BTN 3 does not, this seems like a logical assumption. The manual gives the following command to disable the JTAG controller:
DDPCONbits.JTAGEN = 0;
When I use this command I get build errors. I'm using:
xc32 v1.42
MBLABX v3.45
I've linked in the legacy PLIBs and configured the compiler to suppress the PLIB error/warning messages and have used the legacy PLIB to configure LED and button IO ports etc.
Looking on the web, I've found references to the following commands, all of which are claimed to disable the JTAG controller, though it was not always clear if the commands presented applied to the 795F512L device on the Mx7.
DDPCON = DDPCON & 0xFFFFFFF7;
#pragma config JTAGEN = OFF
mJTAGPortEnable (DEBUG_JTAGPORT_OFF);
mJTAGPortEnable (0);
I've tried all of these versions (one at a time) and all produce compile / build errors, with the errors pointing directly at these statements / preprocessor directives. After trying the various commands, I now get warnings / errors that a number of include files cannot be found. If I comment out the JTAG disable command currently in use, the project builds and downloads OK, so the "cannot find include files <filename>" messages must themselves be in error? The files that supposedly cannot be found include <xc.h>, <plib.h> and a number of the compiler libraries, <stdio.h>, <stdint.h>, <string.h>, etc. If these files truly could not be found, the project would not compile and build would it?
Is there a way to "erase" currently displayed error / warning messages in MPBLAX? If they could be erased, it would be interesting to see if they come back after doing a clean & build.
I'm primarily a HW guy, so I may be doing something silly here, but after looking at this for longer than I would like to admit, I can't see anything amiss.
Any comments or suggestions of what I might try would be greatly appreciated.
Question
JimL
Hello,
I'm using a ChipKit Mx7 Pro as a development platform, and have started out just trying to write some basic support routines for the user LEDs and buttons and talking to an LCD module as a warm-up before getting into my actual application code. Once these are vetted I plan to add support for the I2C, SPI and UART ports, essentially putting together a minimal BSP which should be useful in my final application.
I've got the LED routines written and am blissfully talking to the LCD module. I have BTNs 1 & 2 working but am having trouble reading button three. The Mx7 user manual states that since Button 3 is shared with the JTAG controller which is enabled on reset, the JTAG controller has to be disabled before button 3 can be accessed as an input. I assume from this that simply using the PLIB port bit configuration macros, i.e. setting PA-0 as an input, is not sufficient. Since my code for BTN 1 & 2 work and for BTN 3 does not, this seems like a logical assumption. The manual gives the following command to disable the JTAG controller:
DDPCONbits.JTAGEN = 0;
When I use this command I get build errors. I'm using:
xc32 v1.42
MBLABX v3.45
I've linked in the legacy PLIBs and configured the compiler to suppress the PLIB error/warning messages and have used the legacy PLIB to configure LED and button IO ports etc.
Looking on the web, I've found references to the following commands, all of which are claimed to disable the JTAG controller, though it was not always clear if the commands presented applied to the 795F512L device on the Mx7.
DDPCON = DDPCON & 0xFFFFFFF7;
#pragma config JTAGEN = OFF
mJTAGPortEnable (DEBUG_JTAGPORT_OFF);
mJTAGPortEnable (0);
I've tried all of these versions (one at a time) and all produce compile / build errors, with the errors pointing directly at these statements / preprocessor directives. After trying the various commands, I now get warnings / errors that a number of include files cannot be found. If I comment out the JTAG disable command currently in use, the project builds and downloads OK, so the "cannot find include files <filename>" messages must themselves be in error? The files that supposedly cannot be found include <xc.h>, <plib.h> and a number of the compiler libraries, <stdio.h>, <stdint.h>, <string.h>, etc. If these files truly could not be found, the project would not compile and build would it?
Is there a way to "erase" currently displayed error / warning messages in MPBLAX? If they could be erased, it would be interesting to see if they come back after doing a clean & build.
I'm primarily a HW guy, so I may be doing something silly here, but after looking at this for longer than I would like to admit, I can't see anything amiss.
Any comments or suggestions of what I might try would be greatly appreciated.
Thanks much for any help.
Jim L
Link to comment
Share on other sites
7 answers to this question
Recommended Posts
Archived
This topic is now archived and is closed to further replies.