Hello everyone, and thank to all for helping me
this case is solved!
1st
the GM65 scanner Tx/Rx line are at 3.3v not at standard 5V TTL logic, so I add a BSS138 between the Tx and the Rx (HSerin) of the PIC
2nd
I like to thank also BrianS (HSERIN issue with a 18F452 and IF THEN statements or Case statements)
while reading about his case I took part of the HSerin setup and added to my program, first try work just fine on HSerin/HSerin2.
Code:'------------------------------------------------------------------------- ' Name : Hserin Test (18F25K22) '------------------------------------------------------------------------- Include "modedefs.bas" ' Include serial modes ;----[18F25K22 Hardware Configuration]------------------------------------------ #CONFIG CONFIG FOSC = INTIO67 CONFIG PLLCFG = ON CONFIG WDTEN = Off CONFIG MCLRE = INTMCLR CONFIG LVP = Off #ENDCONFIG '------------------------- DEFINE HSER_CLROERR 1 DEFINE HSER_BAUD 9600 RCSTA = $90 TXSTA = $20 DEFINE HSER2_CLROERR 1 DEFINE HSER2_BAUD 9600 RCSTA2 = $90 TXSTA2 = $20 '------------------------- ANSELA = 0 ; All Digital ANSELB = 0 ANSELC = 0 DEFINE OSC 64 TRISA = 111101 '1:IN, 0:OUT TRISB = 000001 TRISC = 111101 OSCCON = $70 OSCTUNE = $40 AArray VAR BYTE[12] ' code to scan sample : 0 59749 96859 1 MAIN: HSERIN 50,MAIN,[STR AARRAY\12] 'HSERIN2 50,MAIN,[STR AARRAY\12] ' -------------------------------------------- serOut2 PORTB.1,84, [str aarray\12,13,10] ' -------------------------------------------- GoTo MAIN




Bookmarks