Re: Pic18 and RN42 bluetooth communication problem using UART
How should I enter ints 16 bit signed values? like following?
to send 10
in little_endian format
Hserout [10,0]
or big_endian format
Hserout [0,10]
not sure how arduinos go about it they could be big or little endian
if your values can be negative then you need to pay close attention to your calcs pbp uses unsigned math
there is no config there
pbp default config for pic18f24j50 is
Code:
#CONFIG
CONFIG WDTEN = ON
CONFIG PLLDIV = 5
CONFIG STVREN = ON
CONFIG XINST = OFF
CONFIG DEBUG = OFF
CONFIG CPUDIV = OSC1
CONFIG CP0 = OFF
CONFIG OSC = HSPLL
CONFIG T1DIG = ON
CONFIG LPT1OSC = OFF
CONFIG FCMEN = OFF
CONFIG IESO = OFF
CONFIG WDTPS = 512
CONFIG DSWDTOSC = INTOSCREF
CONFIG RTCOSC = T1OSCREF
CONFIG DSBOREN = ON
CONFIG DSWDTEN = ON
CONFIG DSWDTPS = G2
CONFIG IOL1WAY = ON
CONFIG MSSP7B_EN = MSK7
CONFIG WPFP = PAGE_0
CONFIG WPEND = PAGE_WPFP
CONFIG WPCFG = OFF
CONFIG WPDIS = OFF
#ENDCONFIG
which expects an external xtal
DEFINE OSC 16
is just a compiler directive used for compile time timing calculations , it does nothing else
to use the internal osc the config words need to be set appropriately
such as
CONFIG OSC = INTOSC
or
CONFIG OSC = INTOSCPLL
and
CONFIG PLLDIV needs to match
along with
CONFIG CPUDIV which need to match
read the osc section of the data sheet
Warning I'm not a teacher
Bookmarks