Joe it's perfectly usual to set the Serial pin to it's normal state. When you start the PIC and just set the TRIS register, you couldn't know at which level they will be.
Here there's no TRIS setting, but HIGH take care of it. Too bad, it will need LOW instead for Inverted mode.
Do a simple test with that Code, monitor the PORTB.0 level before the SEROUT, and after the SEROUT. There's chance it will be different, thus this may 'fart' the First data you send.
Another thing, this PIC have a nice OSCCON register that allow you to know when the internal OSC is stable. You should wait until it is stable unless you may again screw the baudrate.
Again, it use a internal OSC which are usually pretty poor for any reliable serial communication. At least you should tune it by changing the OSCTUNE register value. Why it worked with a F84... because of the EXTERNAL osc.
If you have only 1 serial output, There's no advantage to use SEROUT, you should try DEBUG.
PBP SLEEP use the WatchdogTimer, and you don't have it enable in your config fuses. So i doubt it may work UNLESS you haven't comment the PBP default in the PBP .INC file. WhyNot using PAUSE instead?
For safety sake, you should wait at little bit after you set the SerialPinIdle level, let's say 50mSec
try this untested one
Code:ASM DEVICE PIC16F818, INTRC_OSC ,MCLR_OFF ,LVP_OFF DEVICE PIC16F818, WDT_ON ,PWRT_ON ,BOD_ON DEVICE PIC16F818, DEBUG_OFF ,CCPMX_OFF DEVICE PIC16F818, CPD_OFF ,WRT_OFF ,PROTECT_OFF ENDASM ' ' Internal OSC config ' ==================== OSCCON=$60 ' Internal OSC=4MHZ WHILE OSCCON.2=0 : WEND ' wait until frequency is stable ' ' I/O config ' ========== TRISB=0 ' PORTB=out TRISA=0 ' PORTA=out ADCON1=6 ' disable ADCs ' ' Softare Serial comm setup ' ========================= DEFINE DEBUG_REG PORTB ' Debug pin port DEFINE DEBUG_BIT 0 ' Debug pin bit DEFINE DEBUG_BAUD 2400 ' Debug baud rate DEFINE DEBUG_MODE 1 ' Debug mode: 0 = True, 1 = Inverted DEFINE DEBUG_PACING 1000 ' Debug character pacing in us ' ' Program Start ' ============= ' ' Hardware init ' ============= PORTA=0 ' clear PORTA PORTB=0 ' clear PORTB pause 50 ' safe statup delay Start: debug "Text or data, or whatever else written in PBP manual" PAUSE 250 GOTO START




Bookmarks