you don't need those
DEFINE CHAR_PACING 1000
DEFINE OSC 4
OPTION_REG.7 = 0 ' gpio 0 - 2 digital
WPU = 255 ' week pull ups on all pins
AND you must set the OSCCAL to get accuracy with SEROUT. I hope your OSCCAL is not erase as now...
at the end your code will look like this.
Code:
@ __config _INTRC_OSC_NOCLKOUT & _WDT_ON & _PWRTE_ON & _MCLRE_OFF & _BODEN_ON
' Internal Oscillator
' Enable watch dog timer
' Enable power up timer
' Disable MCLR pin
' Enable brown out detect
DEFINE OSCCAL_1K 1
INCLUDE "modedefs.bas"
TRISIO.0 = 0 ' set GPIO.0 as output
CMCON = 7 ' turn off analog comparator
Pause 200 ' Allow pic to Stabilize
loop:
SerOut GPIO.0,N2400,["Hello World"]
Pause 1000
SerOut GPIO.0,N2400,["abc",13,10]
Pause 4000
GoTo loop
and this one is working @2400 baud
The most important thing here is to set the OSCCAL at the begining.
hope this help you
Bookmarks