I must be blind... but nowhere i see you have disabled the multiplexed analog modules for your LEDs... didn't go too far in your code though.
And proof that's probably a copy/paste code example prior to check the datasheetSDA=PORTB.1, SCL=PORTB.4. Lucky your are... TRISB=255 at power-up
So.. is there any Register Bit that change between the F877 and the 819... hummm.. let's see
Bookmarks