Skip to content

Port to XC8 #514

@RozeDoyanawa

Description

@RozeDoyanawa

Hi,
I'm trying to implement this on my PIC18 microcontroller. I know this is somewhat out of topic and attempts have been made in the past. However, I'm still trying.

However, a bit of an issue I've ran into while writing a Device Descriptor,
The new K42 architecture of a PIC pushes nearly all I2C communication to hardware.
The programmer simply waits for the bus to be free, then writes the byte count and slave address to two separate registers. This is followed by a loop of writing byte by byte to a 2-byte output buffer. Hardware automatically handles ACK/NACK and Start/Stop conditions. Stop condition is automatically sent on the 9th edge of a byte when Count is 0 and "restart" is not set. There is NO way to force a stop bit afaik.

The issue here is that the whole library assumes user have control over the Start/Stop conditions. Ie. u8g_i2c_start/u8g_i2c_stop/u8g_i2c_send_byte. Whereas the new K42 would only take a single u8g_i2c_send_bytes(slave, data, length) to handle everything.

The number of bytes is not currently passed to u8g_i2c_start, which complicates matters.

Any suggestions?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions