I'm working for a small project. It uses Pic32mx150F128d, compiler is MB pic32 3.3.3.
GLCD function works fine, but it will stop to work when I add I2C2 init.
Below is simple test code:
Code: Select all
program Glcd_Test
' Glcd module connections
dim GLCD_D7 as sbit at LATB5_bit
GLCD_D6 as sbit at LATB6_bit
GLCD_D5 as sbit at LATB7_bit
GLCD_D4 as sbit at LATB8_bit
GLCD_D3 as sbit at LATB9_bit
GLCD_D2 as sbit at LATB10_bit
GLCD_D1 as sbit at LATB11_bit
GLCD_D0 as sbit at LATB12_bit
GLCD_D7_Direction as sbit at TRISB5_bit
GLCD_D6_Direction as sbit at TRISB6_bit
GLCD_D5_Direction as sbit at TRISB7_bit
GLCD_D4_Direction as sbit at TRISB8_bit
GLCD_D3_Direction as sbit at TRISB9_bit
GLCD_D2_Direction as sbit at TRISB10_bit
GLCD_D1_Direction as sbit at TRISB11_bit
GLCD_D0_Direction as sbit at TRISB12_bit
dim GLCD_CS1 as sbit at LATC1_bit
GLCD_CS2 as sbit at LATC2_bit
GLCD_RS as sbit at LATA9_bit
GLCD_RW as sbit at LATB14_bit
GLCD_EN as sbit at LATC3_bit
GLCD_RST as sbit at LATC5_bit
dim GLCD_CS1_Direction as sbit at TRISC1_bit
GLCD_CS2_Direction as sbit at TRISC2_bit
GLCD_RS_Direction as sbit at TRISA9_bit
GLCD_RW_Direction as sbit at TRISB14_bit
GLCD_EN_Direction as sbit at TRISC3_bit
GLCD_RST_Direction as sbit at TRISC5_bit
' End Glcd module connections
main:
Glcd_Init() ' Initialize Glcd
'I2C2_Init(100000)
while true
Glcd_Fill(0x00)
delay_ms(1000)
Glcd_Fill(0xff)
delay_ms(1000)
wend
end.
Could you help me to solve this problem? Thank you.
Best regards,