Posts by Mazen

    Hi Neves,


    For the schematics, please contact our sales team and sign the NDA to release the relevant part to you.


    For the function GPS_ParseNMEA(), it can be used instead of GPS_SendUART2USB().
    Below is an implementation of this function in a different application we have:
    Notes: GPSBuffer is an arrany that holds the received GPS data.
    GPSBufferIndex is the size of the data inside the buffer



    void GPS_ParseNMEA()
    {
    uint8_t CommaCount = 0;
    uint8_t GIndex = 0;
    GPSIsValid = false;
    if(GPSBufferIndex <10)
    {
    //not enough data in Buffer to parse
    return;
    }
    for(LoopVar = 0; LoopVar < GPSBufferIndex - 10; LoopVar++)
    {
    if(GPSBuffer[LoopVar]=='R' && GPSBuffer[LoopVar+1]=='M' && GPSBuffer[LoopVar+2]=='C')
    {
    //start counting commas and recording the GPS information we need
    CommaCount = 1;
    break;
    }
    }
    if(CommaCount ==1)
    {
    SpeedIndex = 0;
    HeadingIndex = 0;
    for( ; LoopVar < GPSBufferIndex ;LoopVar++)
    {


    if(GPSBuffer[LoopVar]==',')
    {
    CommaCount++;
    GIndex = 0;
    continue;
    }
    if(CommaCount>10)
    break;
    switch(CommaCount)
    {
    case 2: if(GIndex<6){GTime[GIndex] = GPSBuffer[LoopVar]; GIndex++;} break;
    case 3: if(GPSBuffer[LoopVar]=='A') GPSIsValid = true; break;
    case 4: Latitude[GIndex] = GPSBuffer[LoopVar]; GIndex++; break;
    case 6: Longitude[GIndex] = GPSBuffer[LoopVar]; GIndex++; break;
    case 8: if(GIndex<3){Speed[GIndex] = GPSBuffer[LoopVar]; GIndex++;SpeedIndex++;} break;
    case 9: if(GIndex<3){Heading[GIndex] = GPSBuffer[LoopVar]; GIndex++;HeadingIndex++;} break;
    case 10: if(GIndex<6){GDate[GIndex] = GPSBuffer[LoopVar]; GIndex++;} break;
    }
    }
    if(SpeedIndex==1)
    {
    Speed[2] = Speed[0];
    Speed[1] = '0';
    Speed[0] = '0';
    }
    if(SpeedIndex==2)
    {
    Speed[2] = Speed[1];
    Speed[1] = Speed[0];
    Speed[0] = '0';
    }
    if(HeadingIndex==1)
    {
    Heading[2] = Heading[0];
    Heading[1] = '0';
    Heading[0] = '0';
    }
    if(HeadingIndex==2)
    {
    Heading[2] = Heading[1];
    Heading[1] = Heading[0];
    Heading[0] = '0';
    }
    }
    //Parse GGA Message to get the satellite number
    CommaCount = 0;
    GIndex = 0;
    for(LoopVar = 0; LoopVar < GPSBufferIndex - 10; LoopVar++)
    {
    if(GPSBuffer[LoopVar]=='G' && GPSBuffer[LoopVar+1]=='G' && GPSBuffer[LoopVar+2]=='A')
    {
    //start counting commas and recording the GPS information we need
    CommaCount = 1;
    break;
    }
    }
    if(CommaCount ==1)
    {
    SatIndex=0;
    for( ; LoopVar < GPSBufferIndex ;LoopVar++)
    {
    if(GPSBuffer[LoopVar]==',')
    {
    CommaCount++;
    GIndex = 0;
    continue;
    }
    if(CommaCount>10)
    break;
    if(CommaCount== 8)
    {
    Sat[GIndex] = GPSBuffer[LoopVar];
    GIndex++;
    SatIndex++;
    }
    }
    if(SatIndex==1)
    {
    Sat[1] = Sat[0];
    Sat[0] = '0';
    }
    if(SatIndex>0)
    GPSBufferIndex = 0;
    }


    if(GPSIsValid==true)
    {


    }
    else
    {


    }
    }

    Hi Neves,


    in app.h file, you will find all hardware related connected pin definitions. If you need the schematics, please contact our sales team to sign an NDA and will share the related sections with you. Here are the pin definitions anyway:

    #define ADC_CS PORTS_ID_0,PORT_CHANNEL_D, PORTS_BIT_POS_9
    #define ADC_Select PORTS_ID_0,PORT_CHANNEL_K, PORTS_BIT_POS_5


    #define nInt_Ethernet PORTS_ID_0,PORT_CHANNEL_F, PORTS_BIT_POS_2
    #define nRST_Ethernet PORTS_ID_0,PORT_CHANNEL_F, PORTS_BIT_POS_8
    #define CAN_STDBY PORTS_ID_0,PORT_CHANNEL_K, PORTS_BIT_POS_7


    #define SQI_PWR PORTS_ID_0,PORT_CHANNEL_J, PORTS_BIT_POS_6
    #define SIM_SELECTTION PORTS_ID_0,PORT_CHANNEL_J, PORTS_BIT_POS_7
    #define BLUE_LED PORTS_ID_0,PORT_CHANNEL_E, PORTS_BIT_POS_3
    #define GREEN_LED PORTS_ID_0,PORT_CHANNEL_E, PORTS_BIT_POS_4
    #define ADC_DR PORTS_ID_0,PORT_CHANNEL_K, PORTS_BIT_POS_6
    #define ACC_INT1 PORTS_ID_0,PORT_CHANNEL_A, PORTS_BIT_POS_4
    #define ACC_INT2 PORTS_ID_0,PORT_CHANNEL_H, PORTS_BIT_POS_11


    #define DI1G PORTS_ID_0,PORT_CHANNEL_B, PORTS_BIT_POS_6
    #define DI1P PORTS_ID_0,PORT_CHANNEL_B, PORTS_BIT_POS_7
    #define DI2G PORTS_ID_0,PORT_CHANNEL_A, PORTS_BIT_POS_9
    #define DI2P PORTS_ID_0,PORT_CHANNEL_A, PORTS_BIT_POS_10
    #define DI3G PORTS_ID_0,PORT_CHANNEL_H, PORTS_BIT_POS_15
    #define DI3P PORTS_ID_0,PORT_CHANNEL_K, PORTS_BIT_POS_1
    #define DI4G PORTS_ID_0,PORT_CHANNEL_K, PORTS_BIT_POS_2
    #define DI4P PORTS_ID_0,PORT_CHANNEL_K, PORTS_BIT_POS_3
    #define DO1 PORTS_ID_0,PORT_CHANNEL_H, PORTS_BIT_POS_7
    #define DO2 PORTS_ID_0,PORT_CHANNEL_D, PORTS_BIT_POS_14
    #define DO3 PORTS_ID_0,PORT_CHANNEL_D, PORTS_BIT_POS_15)
    #define DO4 PORTS_ID_0,PORT_CHANNEL_B, PORTS_BIT_POS_12
    #define GPS_PPS PORTS_ID_0,PORT_CHANNEL_D, PORTS_BIT_POS_13
    #define XE910_DCD PORTS_ID_0,PORT_CHANNEL_G, PORTS_BIT_POS_0
    #define XE910__PWRMON PORTS_ID_0,PORT_CHANNEL_J, PORTS_BIT_POS_4
    #define XE910_Switch PORTS_ID_0,PORT_CHANNEL_J, PORTS_BIT_POS_2
    #define XE910_ON_OFF PORTS_ID_0,PORT_CHANNEL_J, PORTS_BIT_POS_3
    #define XE910_OE PORTS_ID_0,PORT_CHANNEL_G, PORTS_BIT_POS_15
    #define XE910_SPI_MRDY PORTS_ID_0,PORT_CHANNEL_B, PORTS_BIT_POS_8
    #define XE910_SPI_SRDY PORTS_ID_0,PORT_CHANNEL_B, PORTS_BIT_POS_11
    #define XE910_SHTDN PORTS_ID_0,PORT_CHANNEL_G, PORTS_BIT_POS_15
    #define Max_1_WIRE PORTS_ID_0,PORT_CHANNEL_H, PORTS_BIT_POS_2



    #define BLUE_LED_ON() PLIB_PORTS_PinClear(BLUE_LED)
    #define BLUE_LED_OFF() PLIB_PORTS_PinSet(BLUE_LED)
    #define GREEN_LED_ON() PLIB_PORTS_PinClear(GREEN_LED)
    #define GREEN_LED_OFF() PLIB_PORTS_PinSet(GREEN_LED)
    #define XE910_PWRMON() PLIB_PORTS_PinGet(XE910__PWRMON)
    #define XE910_IsConnected() !PLIB_PORTS_PinGet(XE910_DCD)

    Hello Neves,


    The location where you have placed this project is not correct. Each project has a different location to where you should place it. The BSP project should be placed in :


    C:\Microchip\harmony\v1_05\apps\



    I have just noticed that we didn't mention it for that project in the manual. We will do and upload the new revised verison of it.
    Please relocate it and let me know if all works out.