• Content Count

  • Joined

  • Last visited

About Tawachi

  • Rank

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi Bobby, Thanks for your help. Unplugging the two jumpers on J17 and plugging into VU and 5V0 pins solved the problem. I could get 5V. However I could no longer program the board from MPIDE. The uploading process timed out. But when I reverted to 3.3V setting, I was able to program the board with no problems. Thanks.
  2. Hi, I am powering the board from my laptop using USB cable connected to UART port. Regards,
  3. Hi, When I set the jumper on JP9 to 5V0, I get around 3.8V between pins pin 5 and ground instead of 5V. Is this normal or there is something wrong with my board. Regards,
  4. Hi JColvin, Thank you for your response. I looked at the delay functions suggested on microchip forums. However, when I use the code, my ide is unable to resolve most functions such as readcoretimer. I also looked at the Harmony time system service, which requires the include header files sys.h and sys_tmr.h, but when I include these files, the ide parse utility says it cannot find these include files. I don't know whether its related to my version. I am using MPLAB X IDE version 3 and Harmony version 1.03. I will try to use free RTOS delay function or using Flow cloud library core functions. Regards, Tawachi
  5. Hi, When I try to use the delay function (__delay_ms() in a simple code for turning LEDs on and off, the project does not build. I have defined _XTAL_FREQ as indicated in MPLABX help. When I include 'delays.h' as indicated in the help, I get a parse error. When I try to build without including delays.h I get the error below. Are the delay functions not available foe PIC32MZ devices? I am using Flow Cloud Skeleton App, and the device is PIC32MZ2048ECG100 ChipKit WiFire. Below is the error and the code. ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Error: c:/microchip/harmony/current/apps/flow/flow_skeletonapp/src/main.c:35: undefined reference to `__delay_us' ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Code: #include <stddef.h> // Defines NULL #include <stdbool.h> // Defines true #include <stdlib.h> // Defines EXIT_FAILURE #include <system/debug/sys_debug.h> #include <tcpip/src/system/system_debug.h> #include <app_core.h> #include "app.h" #include "command_handlers.h" #define _XTAL_FREQ=200000000; //App information given to libappbase. static APP_info info = { .appName = "Flow PIC32MZ WiFire Skeleton App", .appVersion = "1.0.0", .appVersionDate = "23 Mar 2015", .AppTask = SYS_AppTask, .CommandSet = CommandSet, .CommandShow = CommandShow, .AppCLI_ResetHandler = CommandHandlers_ResetHandler }; //char message [200]; int main ( void ) { //libappbase inits and then runs our task. TRISE=0; //set all pins as outputs ANSELE=0; //set all 8 pins as digital while(1){ PORTE=0x00ff; //set all 8 pins to HIGH __delay_ms(100); PORTE=0x0000; //set all pins to LOW __delay_ms(100); } return APPCORE_init(&info); }
  6. Hi Mskreen, Thank you for confirming that the code works fine. I am developing using Imaginations Flowcloud. I tried again the same code but this time using the Flowcloud Skeleton App and it worked fine. Previously I was using the Flowcloud starter app and it could not work. I guess it is something to do with the Flowcloud Starter app code which I have to figure out. Thanks you so much. Regards, Tawachi.
  7. Hi, I went through the MPLAB X IDE tutorial. I then changed the product properties to suit my device (PIC32MZ2048ECG100) and debugger (Chipkit PGM). I also changed the port to PortB where user-LED 3 is connected (RB11). When I debug using Simulator, the variables change as they should. However when I program the device, LED3 does not light up as it should. So I also added ANSELB =0 statement to make it a digital port. But still nothing happens. I have exhausted all possible causes I could think of. I would appreciate any ideas. Below is the code, Thanks. #include <xc.h> #pragma config FWDTEN = OFF, JTAGEN = OFF void delay(void); unsigned int ctr = 0; unsigned int delayVal = 2048; int main(void) { LATB= 0; //LED 3 is connected to RB11 TRISB = 0x0000; //set the lower sixteen bits of a port as output ports by //setting the lower eight bits to zero ANSELB=0; //set port B as digital while(1) //infinite loop { LATB = 0b0000000000000000; // assigns 0 to the lower 11th bit of LATB register delay(); LATB = 0b0000100000000000; // assigns to the lower 11th bit of LATB register delay(); ctr++; } } void delay(void) //controls the amount of time that the values appear { unsigned int i,j; for (i = 0; i < delayVal; i++) { for (j = 0; j < 20; j++); } } /********************************************************************** * © 2013 Microchip Technology Inc. * SOFTWARE LICENSE AGREEMENT: * Microchip Technology Inc. (Microchip) licenses this software to you * solely for use with Microchip dsPIC digital signal controller * products. The software is owned by Microchip and is protected under * applicable copyright laws. All rights reserved. * * SOFTWARE IS PROVIDED AS IS. MICROCHIP EXPRESSLY DISCLAIMS ANY * WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED, INCLUDING BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE, OR NON-INFRINGEMENT. IN NO EVENT SHALL MICROCHIP * BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR CONSEQUENTIAL * DAMAGES, LOST PROFITS OR LOST DATA, HARM TO YOUR EQUIPMENT, COST OF * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE THEREOF), * ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER SIMILAR COSTS. **********************************************************************/
  8. Hi NAEastland, Thank you so much. I have found the 'Set Configuration bit' tool very useful indeed. I however have another issue. I have set LATA to 0xAAAA in a programme, but when debugging I get LATA = 0x000082AA in the Watches window. Similarly when I set LATA to 0xFFFF, I get a different value. I have no clue where this discrepancy is originating from. I am using a PIC32MZ2048ECG100. Regards
  9. Hi, I am Tawachi. I am developing using Digilent ChipKit WiFireand thought I would benefit from this forum, Thanks.
  10. Hi, I adapted an MPLAB X program from Dogan Ibrahim's book based on PIC18 microcontroller for my PIC32 WiFire ChipKit. However the following two configuration statements generated errors during building (the syntax is unknown to the compiler) and I therefore commented them out. //Configuration: Ext reset, Watchdog OFF, HS oscillator //#pragma config MCLRE = ON, WDT = OFF, OSC = HS //MEMCONbits.EBDIS = 1; //Enable input / output functions The program was able to build, however it could not do as programmed (the LED 4 did not switch on when button 1 was pressed). I think this is related to the statements I commented out, Kindly assist to troubleshoot and for the correct syntax. Below is the full program. #include <stdio.h> #include <stdlib.h> #include <xc.h> //Configuration: Ext reset, Watchdog OFF, HS oscillator //#pragma config MCLRE = ON, WDT = OFF, OSC = HS // //Define switch and LED connections #define BTN1 PORTAbits.RA5 #define LED4 PORTGbits.RG15 // //Define clock frequency #define _XTAL_FREQ 10000000 // //Start of main program int main(int argc, char** argv) { TRISAbits.TRISA5 = 1; //Configure RA05 as input TRISGbits.TRISG15 = 0; //Configure RG15 as output //MEMCONbits.EBDIS = 1; //Enable input / output functions for (;;) { //do forever if (BTN1 == 0) //If BTN1 is pressed LED4 =1; // LED 4 is turned ON else LED4 =0; } }