Still no luck, the data I receive on my PC is garbled from the 4553, I've tried dozens of baud rates and settings. I plugged the com back into a board with a 4550 and the data from it is fine. Both are running external 20 MHz crystals, boards and design is similar. I copied the code and board design from the 4550 and just changed what I needed to for the new design. I tried the suggested settings from here and had the same results. I got an error when I changed the OSC to 48.
Also, my title may be confusing. What I'm doing is upgrading from a 4550 to 4553 on a board design/upgrade, the EUSART comm isn't working correct on the 4553 yet.
Tomorrow I'll take one of the boards, de-solder the 4553 and put the 4550 on it just so I can completely double check for an issue with the board.
As a little backstory the boards take external values and send the information via a cell phone to a remote server. This is working fine on boards with the 4550, but we wanted the 12bit AD for the next phase.
The cell phone needs a baud of 115200.
I'm not sure if something that I have configured might load defaults a little different from the 4550 to 4553?
Below is the current DEFINES and CONFIGS, after this I set some variables and have a 1 second loop the sends HSEROUT ["Hello",13,10], toggles an LED and updates a seconds counter on the LCD. Data received by PC acts like the baud rate its bad, LED blink and LCD updates fine.
Let me know if you think of anything that may help.
Thanks
Code:
Define OSC 20
DEFINE LCD_DREG PORTD 'Port used for LCD Data
DEFINE LCD_DBIT 0 'First Pin connected to LCD DB4
DEFINE LCD_RSREG PORTB 'Port used for LCD RS line
DEFINE LCD_RSBIT 2 'Pin used for LCD RS line
DEFINE LCD_EREG PORTA 'Port used for LCD E Reg
DEFINE LCD_EBIT 4 'Pin used for LCD E line
DEFINE LCD_BITS 4 'Four bit comm mode
DEFINE LCD_LINES 2 '2 Line LCD
DEFINE LCD_COMMANDUS 900 'Delay between sending LCD commands
DEFINE LCD_DATAUS 75 'Delay time between data sent
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h 'External Clock, Enable transmit, BRGH = 1
DEFINE HSER_SPBRG 10 ' 115200 Baud @ 20MHz, -1.36%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
BAUDCON.3 = 0 ' BRG16 = 0
TRISC.7=1
TRISC.6=1
'Re-Configure default values from the PBP 18F4553.inc and MCSP/MPASM .inc
' Ext XTAL setting
'_PLLDIV_5_1L 20Mhz HS / 5 for PLL 4 Mhz
'_CPUDIV_OSC3_PLL4_1L 24Mhz CPU for USB 1 speeds, PLL 96Mhz/4 =24Mhz
'HS oscillator, PLL enabled (HSPLL)
'
'asm
#CONFIG
__CONFIG _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC3_PLL4_1L & _USBDIV_2_1L
__CONFIG _CONFIG1H, _FOSC_HSPLL_HS_1H
#ENDCONFIG
'endasm
INCLUDE "DT_INTS-18.bas" ; Base Interrupt System
INCLUDE "ReEnterPBP-18.bas" ; Include if using PBP interrupts
INCLUDE "Elapsed_INT-18.bas" ; Elapsed Timer Routines
ASM
INT_LIST macro ; IntSource, Label, Type, ResetFlag?
INT_Handler TMR1_INT, _ClockCount, PBP, yes
INT_Handler RX_INT, _Check_Command, PBP, yes
endm
INT_CREATE ; Creates the interrupt processor
ENDASM
@ INT_ENABLE TMR1_INT
@ INT_ENABLE RX_INT
Bookmarks