• AVR Freaks

Hot!EZBL I2C Issues

Author
JoshKeys
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2007/11/29 15:14:29
  • Location: 0
  • Status: offline
2019/10/30 12:11:44 (permalink)
0

EZBL I2C Issues

Good day everyone.
 
I've been successfully using the EZBL 2.11 to bootload my dsPIC33CK128MP505 over UART but am now looking to port this over to I2C instead. I've followed the examples in the directory, and I get an ACK back from everything i send over I2C to the PIC, but when I do a read, there is never anything in the FIFO buffer for flow control.
 
Before getting too far into this with details, is it possible that the architecture of the dsPIC33CK is different enough from any other examples that exist that the EZBL cannot properly setup the I2C communication? It seems similar enough to me. 
 
The I2C format isn't well documented, but I've tried almost every variant for TX and RX. But this is how I suspect it should be done:
 
Start->Slave_Address with write bit->data[0]->data[1]->......->data[n]->Stop
 
for doing a read:
 
Start->Slave_Address with read bit->Bootloader should return FIFO header->FIFO byte 1 -> FIFO byte ->....->Stop
 
 
I am sending the BL2 64 byte header file, I've confirmed the contents multiple times with my logic analyzer. Everything is acknowledged, and all 64 bytes make sense.  (See attached image)
 
I then wait 10ms and then do a read. No matter how many times I try this, I will always get a value of 0 from what should be the FIFO header. (See the other attached image)
 
I'm using ex_boot_i2c main.c as is, but here it is:
/**
 * EZBL Bootloader "main" file for initializing communications hardware,
 * checking app-installed flags, receiving new application firmware, and
 * dispatching execution to the Application's reset/main() routines.
 *
 * Interrupt Service Routines implemented in this project are:
 * - One 16-bit Timer or CCT Interrupt, selected in the hardware initializer
 * file (ISR implementation defined in ezbl_lib.a, see
 * ezbl_lib -> weak_defaults/_TxInterrupt.s (or _CCTxInterrupt.s))
 * - Slave I2C 1 (defined in ezbl_lib.a, see
 * ezbl_lib -> weak_defaults/i2c1_fifo.c; can be a different I2C instance,
 * see I2C_Reset() in hardware initializer)
 */

/*******************************************************************************
  Copyright (C) 2018 Microchip Technology Inc.

  MICROCHIP SOFTWARE NOTICE AND DISCLAIMER: You may use this software, and any
  derivatives created by any person or entity by or on your behalf, exclusively
  with Microchip's products. Microchip and its licensors retain all ownership
  and intellectual property rights in the accompanying software and in all
  derivatives here to.

  This software and any accompanying information is for suggestion only. It
  does not modify Microchip's standard warranty for its products. You agree
  that you are solely responsible for testing the software and determining its
  suitability. Microchip has no obligation to modify, test, certify, or
  support the software.

  THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
  EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED
  WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR
  PURPOSE APPLY TO THIS SOFTWARE, ITS INTERACTION WITH MICROCHIP'S PRODUCTS,
  COMBINATION WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.

  IN NO EVENT, WILL MICROCHIP BE LIABLE, WHETHER IN CONTRACT, WARRANTY, TORT
  (INCLUDING NEGLIGENCE OR BREACH OF STATUTORY DUTY), STRICT LIABILITY,
  INDEMNITY, CONTRIBUTION, OR OTHERWISE, FOR ANY INDIRECT, SPECIAL, PUNITIVE,
  EXEMPLARY, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, FOR COST OR EXPENSE OF
  ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWSOEVER CAUSED, EVEN IF
  MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE.
  TO THE FULLEST EXTENT ALLOWABLE BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL
  CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF
  FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.

  MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
  TERMS.
*******************************************************************************/

#include <xc.h>
#include "ezbl_integration/ezbl.h"


// EZBL ezbl_lib.a link-time options:
//EZBL_SetSYM(EZBL_NO_APP_DOWNGRADE, 1); // Uncomment to disallow upload of App image with a version/build number that is < existing App version (assuming a valid App exists)
EZBL_SetSYM(EZBL_FLOW_THRESHOLD, 120); // Optional water mark to adjust when outbound flow control advertisements are generated. Small values consume more TX bandwidth by generating more messages. See EZBL_Install2Flash() API documentation for additional information.


// General Bootloader timeout governing reset idle time to initial Application
// launch and bootload termination when communications are broken.
#define BOOTLOADER_TIMEOUT (NOW_sec * 1u)


// Uncomment for better performance when using I2C 1. Buffer default size is 120
// bytes in ezbl_lib, which conserves static RAM, but reduces sustained
// throughput. Any size >= 64 bytes can support bootloading.
//unsigned char I2C1_RxFifoBuffer[960] __attribute__((noload, section(".bss.I2C1_RxFifoBuffer")));


// Bootloader global variables and flags
NOW_TASK EZBL_bootTask __attribute__((persistent)); // Task callback pointers/timers to background execute the EZBL_BootloaderTask() function
EZBL_INSTALL_CTX EZBL_bootCtx __attribute__((persistent)); // State tracking structure, including timeout detection for active bootload operations
int (*EZBL_AppPreInstall)(EZBL_FIFO *rxFromRemote, EZBL_FIFO *txToRemote, unsigned long fileSize, EZBL_APPID_VER *appIDVer) = 0; // Application's EZBL_PreInstall() callback function pointer to permit current App rejection of offered firmware or clean App shutdown


int main(void)
{
    unsigned long appLaunchTimer; // Timestamp tracking when we last saw COM/Bootloader activity
    unsigned long ledTimer; // Timestamp tracking when we last toggled an LED
    unsigned long now; // Cached return value from NOW_32()


    // Initialize Bootloader global variables and flags. Explicit zeroing is
    // necessary if this Bootloader project is built with "--no-data-init"
    // xc16-ld Linker option used (i.e. "Initialize data sections" unchecked to
    // save code space). For default (initialization enabled) state, this code
    // could be removed.
    EZBL_appIsRunning = 0;
    EZBL_NVMKey = 0x0000;
    EZBL_COM_RX = 0;
    EZBL_AppPreInstall = 0;
    EZBL_ForwardAllIntToBoot();


    // Set processor clock, configure LED/Button I/O pin states, PPS
    // assignment, initialize NOW timer peripheral, UART/I2C communications, etc.
    InitializeBoard();

    // Launch Bootloader communications listener and command processor periodic
    // task (background calls EZBL_BootloaderTask() from IPL0/main() context
    // every ~32ms). EZBL_Install2Flash() API start requirements require that we
    // first initialize EZBL_bootCtx state.
    EZBL_bootCtx.state = SM_SYNC_INIT;
    EZBL_bootCtx.timeout = BOOTLOADER_TIMEOUT;
    NOW_CreateRepeatingTask(&EZBL_bootTask, EZBL_BootloaderTask, 32u*NOW_ms);


    now = NOW_32();
    appLaunchTimer = now;
    ledTimer = now;

    // Main Bootloader LED blink and App dispatch timeout loop
    while(1)
    {
        ClrWdt();

        // Every 62.5ms toggle a heartbeat LED (8 Hz blink rate) indicating this Bootloader is executing
        now = NOW_32();
        if(now - ledTimer > NOW_sec/16u)
        {
            ledTimer += NOW_sec/16u;
            LEDToggle(0x01); // Toggles an LED pin according to EZBL_DefineLEDMap() in hardware initializer
        }

        // Check if it is time to jump into the application (default is 1 second
        // of nothing being received, as defined by BOOTLOADER_TIMEOUT.
        if(EZBL_COMBootIF->activity.any)
        { // Activity happened, so reset launch timer to full interval remaining
            EZBL_COMBootIF->activity.any = 0x0000;
            appLaunchTimer = now;
        }
        if(now - appLaunchTimer > EZBL_bootCtx.timeout)
        {
            if(EZBL_IsAppPresent())
            {
                LEDOff(0xFF);
               
                // Optionally turn off all Bootloader ISRs and forward the
                // interrupts to the Application so we become a passive classic
                // bootloader.
                // NOTE: You are giving up useful timing and communications APIs
                // if you do this. Also, the automatic bootloader wakeup upon
                // .bl2 file presentation won't work. To minimize flash, the
                // App can just reuse the bootloader APIs as is, keeping the
                // NOW Timer interrupt and communications ISRs active in the
                // background (which have minimal run-time execution cost).
                //EZBL_RAMSet((void*)&IEC0, 0x00, (unsigned int)&IPC0 - (unsigned int)&IEC0); // Clear every bit in all IECx Interrupt Enable registers
                //EZBL_ForwardAllIntToApp(); // Forward all Interrupts to the Application
                //NOW_EndAllTasks(); // Terminates the EZBL_BootloaderTask() from executing via background NOW ISR and when a NOW_32() or NOW_64() call is made which indirectly needs the timer ISR to execute and perform a carry propagation.

                EZBL_StartAppIfPresent(); // Sets EZBL_appIsRunning = 0xFFFF and temporarily disables IPL6 and lower interrupts before launching Application
            }
        }

        // Not much going on in this loop. Let's save power. The NOW Timer ISR
        // will wake us up, as will COM RX events.
        Idle();
    }
}


/**
 * Periodically called EZBL bootloader task callback function. This function
 * executes at IPL 0 (main() context), essentially acting like a virtual
 * software ISR created by the NOW_CreateRepeatingTask() call.
 *
 * NOTE: Unless you disable the NOW interrupt and forward it to the Application,
 * this function will continue to execute in the background even while the
 * Application is running. This allows the Bootloader to wake up and process an
 * offered .bl2 image file at any time. This task can be manually ended by
 * calling EZBL_EndTask(&EZBL_bootCtx) from this Bootloader or the Application
 * project.
 *
 * @return 0 - value not used.
 */
int EZBL_BootloaderTask(void)
{
    // Do bootloader processing when the communications RX ISR has detected the
    // BOOTLOADER_WAKE_KEY sequence ("MCUPHCME"). Reception of this string sets
    // the EZBL_COM_RX/EZBL_COM_TX global pointers to the FIFOs that we will
    // bootload with.
    if(!EZBL_COM_RX)
        return 0;

    // Run the EZBL state machine that reads from the communications port via
    // EZBL_COM_RX, responds via EZBL_COM_TX, handles flow control, erases flash
    // (only when valid firmware offering presented and EZBL_PreInstall()
    // callback returns 1), programs flash, validates with CRC and read-back,
    // then programs a App-valid flag to allow new Application execution. For
    // the first call, the EZBL_INSTALL_CTX.state, and timeout fields must be
    // pre-configured (done during main() initialization):
    // EZBL_bootCtx.state = SM_SYNC_INIT;
    // EZBL_bootCtx.timeout = BOOTLOADER_TIMEOUT;
    EZBL_Install2Flash(&EZBL_bootCtx);

    // Optionally display "Bootloader rejected firmware as incompatible" error
    // on host if a .bl2 file with BOOTID_HASH value is sent to us which doesn't
    // match our own BOOTID_HASH. I.e. firmware is intended for some other
    // bootloader.
    //if(EZBL_bootCtx.bootCode == EZBL_ERROR_BOOTID_HASH_MISMATCH)
    //{
    // EZBL_FIFOWrite32(EZBL_COM_TX, (((unsigned long)EZBL_bootCtx.bootCode)<<16) | 0x0000u);
    // EZBL_bootCtx.bootCode = 0; // Prevent retransmission
    //}

    // When Bootloader is communicating, increase task frequency for lower
    // communications latency and better throughput. EZBL_Install2Flash()
    // sets EZBL_COM_RX back to null when a rejection, timeout, error or
    // successful bootload completion occurs.
    NOW_SetNextTaskTime(&EZBL_bootTask, NOW_ms/2u);

    return 0;
}


/**
 * Callback function executed by EZBL_Install2Flash() just before the existing
 * Application (if any) is erased, permitting last minute rejection of a
 * firmware update or an opportunity to cleanly shut down any running operations
 * (especially if they might interfere with successful Bootloading). See
 * callback documentation for EZBL_PreInstall() in ezbl.h for more information.
 */
int EZBL_PreInstall(EZBL_FIFO *rxFromRemote, EZBL_FIFO *txToRemote, unsigned long fileSize, EZBL_APPID_VER *appIDVer)
{
    if(EZBL_AppPreInstall)
        return (*EZBL_AppPreInstall)(rxFromRemote, txToRemote, fileSize, appIDVer);

    return 1; // Accepts update offering if no App installed or running right now
}


// These trap handlers are not necessary, but if you ever find your Bootloader
// going out to lunch (and probably crashing a debug session with
// PICkit/ICD/REAL ICE), then be sure to enable these. When absent from the
// bootloader project, EZBL remaps all of the trap vectors to the Application's
// Interrupt Goto Table, which will not help you debug Bootloader problems (and
// confuses the debuggers because there is usually nothing in App flash space at
// the time, resulting in NOPR execution until the end of flash is hit -- which
// triggers another unreachable trap.)
#if defined(__DEBUG)
//EZBL_KeepSYM(EZBL_TrapHandler);
void __attribute__((interrupt, auto_psv)) _AddressError(void) // Consider EZBL_KeepSYM(EZBL_TrapHandler) or EZBL_KeepSYM(_AddressError); for a more powerful trap handler
{
    EZBL_printf("\n\nAddress Error Trap!");
    EZBL_FIFOFlush(EZBL_STDOUT, NOW_sec);
    __builtin_software_breakpoint();

    INTCON1 &= 0x8700;
}
void __attribute__((interrupt, auto_psv)) _StackError(void) // Consider EZBL_KeepSYM(EZBL_TrapHandler) or EZBL_KeepSYM(_StackError); for a more powerful trap handler
{
    EZBL_printf("\n\nStack Error Trap!");
    EZBL_FIFOFlush(EZBL_STDOUT, NOW_sec);
    __builtin_software_breakpoint();

    INTCON1 &= 0x8700;
}
void __attribute__((interrupt, auto_psv)) _MathError(void) // Consider EZBL_KeepSYM(EZBL_TrapHandler) or EZBL_KeepSYM(_MathError); for a more powerful trap handler
{
    EZBL_printf("\n\nMath Error Trap!");
    EZBL_FIFOFlush(EZBL_STDOUT, NOW_sec);
    __builtin_software_breakpoint();

    INTCON1 &= 0x8700;
}
#endif

 
And here is my custom hardware config file. It worked just great for my UART, but obviously not for I2C:
 
/*
 * File: dspic33ck128mp505.c
 *


// DOM-IGNORE-BEGIN
/*******************************************************************************
  Copyright (C) 2017 Microchip Technology Inc.

  MICROCHIP SOFTWARE NOTICE AND DISCLAIMER: You may use this software, and any
  derivatives created by any person or entity by or on your behalf, exclusively
  with Microchip's products. Microchip and its licensors retain all ownership
  and intellectual property rights in the accompanying software and in all
  derivatives here to.

  This software and any accompanying information is for suggestion only. It
  does not modify Microchip's standard warranty for its products. You agree
  that you are solely responsible for testing the software and determining its
  suitability. Microchip has no obligation to modify, test, certify, or
  support the software.

  THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER
  EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED
  WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS FOR A PARTICULAR
  PURPOSE APPLY TO THIS SOFTWARE, ITS INTERACTION WITH MICROCHIP'S PRODUCTS,
  COMBINATION WITH ANY OTHER PRODUCTS, OR USE IN ANY APPLICATION.

  IN NO EVENT, WILL MICROCHIP BE LIABLE, WHETHER IN CONTRACT, WARRANTY, TORT
  (INCLUDING NEGLIGENCE OR BREACH OF STATUTORY DUTY), STRICT LIABILITY,
  INDEMNITY, CONTRIBUTION, OR OTHERWISE, FOR ANY INDIRECT, SPECIAL, PUNITIVE,
  EXEMPLARY, INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, FOR COST OR EXPENSE OF
  ANY KIND WHATSOEVER RELATED TO THE SOFTWARE, HOWSOEVER CAUSED, EVEN IF
  MICROCHIP HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE.
  TO THE FULLEST EXTENT ALLOWABLE BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL
  CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT OF
  FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS SOFTWARE.

  MICROCHIP PROVIDES THIS SOFTWARE CONDITIONALLY UPON YOUR ACCEPTANCE OF THESE
  TERMS.
*******************************************************************************/
// DOM-IGNORE-END

#if defined(__dsPIC33CK128MP505__)
#include <xc.h>
#include "../ezbl_integration/ezbl.h"

#define FCY 40000000ul // Choose CPU speed: 90 MIPS clock (180 MHz) for CPU execution. Change this and PLL initialization will compute needed scalars to achieive this output clock.


// Device Configuration Words
// Config words can be defined in a Bootloader project, Application project,
// or mixed between each other so long as any given flash/config write-word-
// size location has exectly one definition. On devices with flash Config
// words and a flash double word minimum programming size (0x4 program
// addresses), this means two adjacent Config words may not be mixed between
// projects and instead both Config words must be defined in the same project.
//
// These defaults place all (or almost all) in the Bootloader project as this
// is the safest from a bootloader-bricking standpoint.
#if defined(EZBL_BOOT_PROJECT) // Compiling for a Bootloader Project
 
    EZBL_SET_CONF(_FSEC, 0xFFFF);
    EZBL_SET_CONF(_FOSCSEL, FNOSC_FRC & IESO_OFF);
    EZBL_SET_CONF(_FOSC, POSCMD_HS & XTCFG_G3 & OSCIOFNC_OFF & FCKSM_CSECMD);
    EZBL_SET_CONF(_FWDT, FWDTEN_ON_SW);
    EZBL_SET_CONF(_FICD, ICS_PGD2 & JTAGEN_OFF); // PGEC1/PGED1 is RB9/RB8, PGEC2/PGED2 is RB4/RB3, PGEC3/PGED3 is RB6/RB5
    EZBL_SET_CONF(_FDMT, DMTDIS_OFF); // DMTDIS_OFF = Deadman Timer is disabled and can be enabled by software; DMTDIS_ON = Deadman Timer is enabled and cannot be disabled by software
    EZBL_SET_CONF(_FDEVOPT1, ALTI2C1_OFF & ALTI2C2_ON );
    EZBL_SET_CONF(_FALTREG, CTXT1_OFF & CTXT2_OFF & CTXT3_OFF & CTXT4_OFF);
   
#else // Compiling for an Application Project (EZBL_BOOT_PROJECT is not defined)
#endif // Goes to: #if defined(EZBL_BOOT_PROJECT)



//const unsigned int EZBL_i2cSlaveAddr = 0x60; // Define I2C Slave Address that this Bootloader will listen/respond to, applicable only if I2C_Reset() is called
EZBL_FIFO *EZBL_COMBootIF __attribute__((persistent)); // Pointer to RX FIFO to check activity on for bootloading
const long EZBL_COMBaud = -230400; // Communications baud rate: <= 0 means auto-baud with default value (for TX) set by the 2's complemented value; otherwise baud in bits/sec (ex: 460800)



/**
 * Initializes system level hardware, such as the system clock source (PLL),
 * I/O pins for LED status indication, a timer for the NOW_*() timekeeping and
 * scheduling APIs and one or more communications peripherals for EZBL
 * bootloading.
 *
 * Although not required or used for bootloading, this function also initializes
 * I/O pins for push buttons, LCD interfacing and some extra items commonly on
 * Microchip development boards. When porting to other hardware, the extra
 * initialization code can be deleted.
 *
 * @return unsigned long system execution clock, in instructions/second (FCY).
 *
 * One 16-bit timer peripheral will be enabled, along with it's ISR at a
 * a period of 65536 system clocks. The timer/CCP used for this is
 * selected within this code using the NOW_Reset() macro.
 *
 * At least one communications is also selected and initialized, along
 * with 1 or 2 ISRs for it (UART RX + TX ISRs or Slave I2C (no Master
 * I2C).
 */
// @return: FCY clock speed we just configured the processor for
unsigned long InitializeBoard(void)
{
 
    // /* Disable Watch Dog Timer */
// //_SWDTEN = 0;
    WDTCONLbits.ON = 0;
//
// // Fvco = PrimaryOscillator / PLLprescalar * PLLFBDIV
// // Fvco = 32MHz / 1 * 25 = 800MHz
// // Configure PLL prescaler, both PLL postscalers, and PLL feedback divider
    CLKDIVbits.PLLPRE = 1; // N1=1
    PLLFBDbits.PLLFBDIV = 25; // M = 25
    PLLDIVbits.POST1DIV = 5; // N2=5
    PLLDIVbits.POST2DIV = 1; // N3=1
//
// // Initiate Clock Switch to Primary Oscillator with PLL (NOSC=0b011)
    __builtin_write_OSCCONH(0x03);
    __builtin_write_OSCCONL(OSCCON | 0x01);
//
// // Wait for Clock switch to occur
    while (OSCCONbits.OSWEN!= 0);
//
// // Wait for PLL to lock
   while (OSCCONbits.LOCK!= 1);
   

    // Initialize/select 16-bit hardware timer for NOW time keeping/scheduling
    // APIs. This call selects the hardware timer resource (can be TMR1-TMR6 or
    // CCP1-CCP8, if available) and the _Tx/_CCTxInterrupt gets automatically
    // implemented by code in ezbl_lib.a.
    NOW_Reset(CCP4, FCY);


    // Set LED pins as GPIO outputs
    //
    // Function dsPIC33CH128MP508 Device Pins
    // LED PIC#, name
    // D3 (LSb) 2, RE0
    // D4 4, RE1
    // D5 17, RE2
    // D6 19, RE3
    // D7 22, RE4
    // D8 24, RE5
    // D9 37, RE6
    // D10 (MSb) 39, RE7 <-- shared with S5 push button
    EZBL_DefineLEDMap(RA4); // Generates the EZBL_LEDMap[] array in flash that will be referenced by LEDToggle()/LEDSet()/LEDOn()/LEDOff() or EZBL_Map*() APIs
    ((volatile unsigned char*)&LATA)[0] = 0x00; // Write '0' values to all of the LED Map's LATx bits without affecting other bits
    ((volatile unsigned char*)&TRISA)[0] = 0x00; // Write '0' values to all of the LED Map's TRISx bits without affecting other bits



#if defined(XPRJ_i2c) // Defined by MPLAB X on command line when compiling "i2c" Build Configuration
    // Configure I2C1 pins for MCP2221A
    // Function Explorer 16 PIM Header dsPIC33CH128MP508 Device Pins
    // I2C 1 PIM#, PICtail#, name PIC#, name
    // SDA1 (in/out) 56, 8, RG3/SDA1 61, PGC1/AN11/RP41/SDA1/RB9
    // SCL1 (in/out) 57, 6, RG2/SCL1 60, PGD1/AN10/RP40/SCL1/RB8
    _CNPUB8 = 1; // Enable Weak pull up on SCL1 line so pins float to idle state if not connected or externally pulled up
    _CNPUB9 = 1; // Enable Weak pull up on SDA1 line so pins float to idle state if not connected or externally pulled up
    _ANSELB8 = 0;
    _ANSELB9 = 0;
    _RP40R = 0; // Null output function - disable any PPS assignment on this pin since SCL1 function comes after RP40 (I2C is lower priority)
    _RP41R = 0; // Null output function - disable any PPS assignment on this pin since SDA1 function comes after RP41 (I2C is lower priority)
    EZBL_COMBootIF = I2C_Reset(1, FCY, 0, EZBL_i2cSlaveAddr, 0);
#endif

   
    // Report 40 MIPS on dsPIC33CK
    return FCY;
}


#endif // #if defined(__dsPIC33CK128MP505__) |

 
Hopefully, that is more than enough information to get started. Any suggestions would be VERY much appreciated.
 
Thanks,
Josh

Attached Image(s)

#1

3 Replies Related Threads

    JoshKeys
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2007/11/29 15:14:29
    • Location: 0
    • Status: offline
    Re: EZBL I2C Issues 2019/11/22 06:08:44 (permalink)
    0
    Hoping to catch the eye of someone at Microchip here. I would really appreciate some help with this. Thanks!
    #2
    Jim Nickerson
    User 452
    • Total Posts : 6371
    • Reward points : 0
    • Joined: 2003/11/07 12:35:10
    • Location: San Diego, CA
    • Status: offline
    Re: EZBL I2C Issues 2019/11/22 07:40:30 (permalink)
    0
    maybe you could ask Microchip directly
    https://support.microchip.com
    #3
    JoshKeys
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2007/11/29 15:14:29
    • Location: 0
    • Status: offline
    Re: EZBL I2C Issues 2019/12/09 12:32:00 (permalink)
    0
    I didn't realize that was an option. Thanks for the tip, will do that now.
     
    Thanks,
    Josh
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5