The above for starters.Code:SDA VAR LATB.5 SCL VAR LATB.6
PBP high level commands, like HIGH/LOW, SEROUT, PULSEOUT, I2CWRITE etc does not work with LATx. These commands tries to set the pin direction (TRIS register) automatically based on the fact that there's always the same "distance" in the memory map between the PORT and TRIS registers (a fixed offset). When you specify LAT instead of PORT PBP will twiddle some other bit in some register which may (or may not) make a total mess.
Bookmarks