Jump to content


Popular Content

Showing content with the highest reputation since 01/17/2021 in all areas

  1. 1 point
    I just downloaded the latest MPLAB (V5.50) and MCC (V5.03, Classic), setup a project with the 18LF46K22 and added the MSSP peripheral. This driver has callbacks for all the major states. When a device is not present there will be a NAK in the address phase. The callback you will need is configured with void I2C1_SetAddressNackCallback(i2c1_callback_t cb, void *ptr); So you can create a callback for the NAK as follows: typedef struct { i2c1_address_t address; bool present; } address_present_t; i2c1_operations_t callbackAddrNak(void *funPtr) { address_present_t *Present = funPtr; Present.present = false; return I2C1_STOP; } // this code comes from the i2c1_master_example provided by MCC uint8_t I2C1_Read1ByteRegister(i2c1_address_t address, uint8_t reg) { uint8_t returnValue = 0x00; address_present_t present; present.address = address; while(!I2C1_Open(address)); // sit here until we get the bus.. I2C1_SetAddressNackCallback(callbackAddrNak,&present; // setup the address NACK callback with the address data I2C1_SetDataCompleteCallback(rd1RegCompleteHandler,&returnValue); I2C1_SetBuffer(&reg,1); I2C1_MasterWrite(); while(I2C1_BUSY == I2C1_Close()); // sit here until finished. if(present.present == FALSE) { // do something appropriate. // some memories fail to respond (generate a NAK) when they are busy. // a missing device will also result in a NAK. } return returnValue; } Note: A NAK can be the "normal" operation of some devices such as a memory. Often an EEPROM will refuse to ACK their address when they are busy writing. You use a process called NAK polling. If you do the device scan during a time when you can expect all devices to be active and ready, then you should be able to generate a map of the available addresses. Good Luck
  2. 1 point
    I just want to say thank you. I learned a lot from this post.
  3. 1 point
    PICKitPlus Many of you will have used or may be using Microchip’s PICkit2 and PICkit3 in-Circuit Debugger/Programmers. Our PICkitPlus software is a total replacement for the original PICkit 2 and PICkit 3 software. It has many new capabilities designed to facilitate programming of 8-bit PIC microcontrollers using a genuine or clone programmer.. Our software provides support for the newer 8-bit microcontrollers, and, we maintain support for old chips and new chips. The PICkit2 programmer was released back in 2005, and allowed the user to program and debug most of the 8 and 16 bit PIC microcontrollers and dsPIC controllers as well. Its successor, the PICkit3 programmer, was released some years later. In 2009 and 2012, Microchip stopped providing support for the PICkit 2 and PICkit3 software , respectively. They released the source code for the Windows GUI software, making it possible for users to update and maintain it themselves. This resulted in the launch of the PICkitPlus software in 2018 by the PICkitPlus team. We are now in 2021 a Microchip Development Partner - which is good recognition of our work. We provide PICkitPlus software for Windows, Linux and PIs. For all operating systems we have command line utility, and for Windows we have PICKitPlus GUI for the PICkit 2 and PICkit 3, PKEasy, PKAutowatch and PICkitPlus Gang Programmer. Supporting nearly 1000 PIC MCUs, includes PIC10F, PIC12F, PIC16F, PIC18F, PIC24, PIC32, dsPIC30 and dsPIC33 family Manages Microchip HEF and SAF memory Retains support for programming CAN I/O Expander & KEELOQ series: MCP2502X/5X & HCSxx Retains read and write operation for serial EEPROM 11LCxx, 24LCxx, 25LCxx and 93LCxx Supported operating systems (32bit/64bit): Windows XP ,Windows Vista, Windows 7, Windows 8, Windows 10, Linux and Pi New programming protocols support for new classes of 8-bit Microchip PIC microcontrollers Updated and managed database for Microchip PIC microcontrollers Improved user interface, help, guidance and direct access to the 8-bit Microchip PIC microcontroller database. Supports TURBO mode to decrease time to program and verify ---- If you have the original Microchip software you can use our improved database - this will give you new legacy parts and you can get the corrections for the existing legacy parts. If you new support for the newer Microchip PICs - you will need PICKitPlus. We have new capabilities that just do not exist in the old Microchip software. ---- To see all our software and hardware. See www.pickitplus.co.uk. If you are interested - ping me a message I we can provide a microforum discount for a few months! Cheers, Evan
  4. 1 point
    You have mis-interpreted the table, each row is meant to be independent. I thought the same thing, until I realized that the columns were not to be taken as a whole, but just defining low, medium, or high for each independent category column.
  5. 1 point
    Was any solution found? I note the CONFIG bits have not been shown. The chip will not run if the oscillator has not been set up correctly, and it will be rapidly resetting if the WDT has not been disabled.

  • Newsletter

    Want to keep up to date with all our latest news and information?
    Sign Up
  • Create New...