Primark
Newbie level 6
- Joined
- Mar 1, 2010
- Messages
- 11
- Helped
- 0
- Reputation
- 0
- Reaction score
- 0
- Trophy points
- 1,281
- Location
- Philippines
- Activity points
- 1,470
I have the following config for my pic18f4550 running on a 8MHz oscillator
#pragma config FOSC = HSPLL_HS //type of oscillator
#pragma config PLLDIV = 2
#pragma config WDT = OFF //disable watch dog timer
#pragma config LVP = OFF //disable low voltage programming
what I'm wondering is what my FOSC is, supposively this will give me a 48MHz, but when I try to send a data at a baud rate of 57600 using this setting
OpenUSART(USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &//fosc 48000000, baud is 57600
USART_BRGH_HIGH, 51); //baud rate is equal to SPGRGH SETTING found at page 251 of datasheet
it fails. the recipient of the data is already fixed at a baud rate of 57600 so there should really be no problem. The only thing I'm not certain about is my FOSC so can anyone help me out with this?
#pragma config FOSC = HSPLL_HS //type of oscillator
#pragma config PLLDIV = 2
#pragma config WDT = OFF //disable watch dog timer
#pragma config LVP = OFF //disable low voltage programming
what I'm wondering is what my FOSC is, supposively this will give me a 48MHz, but when I try to send a data at a baud rate of 57600 using this setting
OpenUSART(USART_TX_INT_OFF &
USART_RX_INT_OFF &
USART_ASYNCH_MODE &
USART_EIGHT_BIT &
USART_CONT_RX &//fosc 48000000, baud is 57600
USART_BRGH_HIGH, 51); //baud rate is equal to SPGRGH SETTING found at page 251 of datasheet
it fails. the recipient of the data is already fixed at a baud rate of 57600 so there should really be no problem. The only thing I'm not certain about is my FOSC so can anyone help me out with this?