I make a new code to test hserin and hserout , I noted that Hserout working weill but HSERIN not getting any data, I sure that the connection is true but I think that there thing error in code , I don't know
here is my code:
' Pic Configuration
' =================
asm
__CONFIG _CONFIG1L, _USBDIV_2_1L & _CPUDIV_OSC1_PLL2_1L & _PLLDIV_5_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H & _FCMEN_ON_1H & _IESO_OFF_1H
__CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L & _BORV_2_2L & _VREGEN_ON_2L
__CONFIG _CONFIG2H, _WDT_OFF_2H
__CONFIG _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_ON_3H
__CONFIG _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _XINST_OFF_4L & _DEBUG_OFF_4L
__CONFIG _CONFIG5L, _CP0_ON_5L & _CP1_ON_5L & _CP2_ON_5L
__CONFIG _CONFIG5H, _CPB_ON_5H
endasm
DEFINE OSC 48
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 20h
DEFINE HSER_BAUD 9600
DEFINE HSER_CLROERR 1
' USB module
' ----------
UCFG var byte EXT ' include UCFG register... Yeah Melabs didn't(
ucfg = %00010100 ' enable internal USB pull-up, Full speed USB
' ANALOG I/O CONFIG
' -----------------
ADCON1 = 15 ' Set all I/Os to Digital
CMCON = 7 ' Disable Comparator
Buffer VAR BYTE[8]
Cnt VAR BYTE
B0 VAR BYTE
output portb.0
high portb.0
pause 1000
low portb.0
' Main Program Loop
MainLoop:
HSERIN 1000,goo,[B0]
high portb.0
goo:
HSEROUT ["send"]
GOTO Mainloop
end


(


Bookmarks