No hay salida SCL o SDA en el tablero de curiosidad PIC16f1619

0

Soy nuevo en I2C y estoy tratando de hacer que funcione en una placa de Curiosidad Microchip con MCU PIC16F1619. Solo estoy probando un ejemplo simple para ver la forma de onda en ambos pines para verificar que funcione, pero no obtengo nada. ¿Estoy haciendo algo mal aquí?

Usando el código generado por MCC para el I2C.

Aquí está mi main.c (basado en esta publicación )

#include "mcc_generated_files/mcc.h"
void main(void)
{
    // initialize the device
    SYSTEM_Initialize();

    // When using interrupts, you need to set the Global and Peripheral Interrupt Enable bits
    // Use the following macros to:

    // Enable the Global Interrupts
    INTERRUPT_GlobalInterruptEnable();

    // Enable the Peripheral Interrupts
    INTERRUPT_PeripheralInterruptEnable();

    I2C_MESSAGE_STATUS status = I2C_MESSAGE_PENDING;
    uint16_t address = 0x70 / 2;
    uint8_t buffer[1] = {0b01010101};

    while (1)
    {
        status = I2C_MESSAGE_PENDING;

        I2C_MasterWrite(buffer, 1, address, &status);

        __delay_ms(250);
    }  
}

En el generador de MCC, he dejado el RC4 & Pines RC6 configurados por el I2C (es decir, NO salida). ¿Me estoy perdiendo algo más? El reloj y las líneas de datos nunca bajan.

    
pregunta Nate Graham

0 respuestas

Lea otras preguntas en las etiquetas