Hi All
Just wondering if anyone has encountered weird behaviour with HSERIN/OUT using a 16F887 at all ?
I was using the 16F887 (hserout) as a receiver for data sent from a 18F4520 (hserin) as a receiver.
When I switch the roles so that the 16F887 is the transmitter and the 184520 is the receiver ... I either get mismatched data or no data at all !
Is it possible I have trhe wrong config settings for the registers on either side at all ?
for the 16F887 I have this
and for the 18F4520 I have thisCode:'Set comparators off CM1CON0 = %00000000 CM2CON0 = %00000000 OSCCON = %01110001 'Int CLK 8MHz ANSEL = %00000000 'All digital OPTION_REG.7 = 0 'Weak pull-ups enabled DEFINE OSC 8 '8MHz 'TRIS statements TRISA = %00000000 TRISB = %11111111 'for 4x4 keypad all input TRISC = %10100000 'PORTC.7 and C.5 are input TRISD = %00000000 TRISE.0 = 0 TRISE.1 = 0 TRISE.2 = 0
Code:OSCCON = $70 'Int CLK 8MHz OSCTUNE.6 = 1 'PLL 4x ADCON1= %00001111 '$0F = disable A/D converter cmcon = 7 INTCON2.7 = 0 'switch pull-ups ON ' DEFINE OSC 32 '4x 8MHz TRISA = %00000000 TRISB = %11111111 'for 4x4 keypad all input TRISC = %10010000 'PORTC.7 and C.4 are input TRISD = %00000000 'all output TRISE.0 = 0 TRISE.1 = 0 TRISE.2 = 0
Any suggestion would be appreciated.
Kind regards
Dennis




Bookmarks