The complete code is pretty long.... but here are the settings I am using. The code I posted prior is first few lines I have to run in the code. After that is is just decoding the data so I can send it to a display. The 3 8-bits of data that I read from PortJ are characters that used to be sent to a 16segment display, which I am working to replace with a modern dot-matrix dispaly.
Code:' Genenal Register Settings, Port Settings and System Definitions CMCON = 7 ' Disables the Comparitor Pins ADCON1 = 15 ' Disables the A/D Converter Pins TRISA = $FF ' Define Port A(0-7) as Input ' (Host TTL inputs, RA7 unused) TRISB = $E0 ' Define Port B(0-4) as Output ' (RB0-4 Character Output; RB5-7 are programming port) TRISC = $00 ' Define Port C(0-2) as Outputs ' (Left=C0; Middle=C1; Right=C2 displays) TRISD = $00 ' Define Port D(0-7) as Output ' (Character Data Outputs) TRISE = $FF ' Define Port E(0-7) as Inputs ' (Ext. Keyboard Inputs) TRISF = $F0 ' Define Port F(0-3) as LED Outputs, F(4-5) as ' Test SW inputs and F(6-7) as Display Int and Kbd Int I/O TRISG = $F0 ' Define Port G0 as I/O for Reset, G1-3 as Rd/Wr/Fl Outputs TRISH = $FF ' Define Port H(0-7) as Inputs TRISJ = $FF ' Define Port J(0-7) as Inputs (Host TTL inputs) Define OSC 20 ' Sets Oscillator Speed at 20Mhz Define BUTTON_PAUSE 100 ' Sets Button Debounce time to 100 ms Define I2C_SLOW 1 ' Sets I2C Speed to 100KHz




Bookmarks