TiagoRibeiro
Full Member level 2
- Joined
- Oct 29, 2013
- Messages
- 130
- Helped
- 18
- Reputation
- 36
- Reaction score
- 17
- Trophy points
- 28
- Location
- São Paulo/Brazil
- Activity points
- 765
hello everyone, I'm posting this really doubt it
*do not get an answer anywhere on the internet.
I am using a development kit that includes
one pic18f26j50 / SIM900 module / GPS.
played a lot with him through the AT command, using
the COM port of the PC. But now I need to do it
function using the pic. But then that's my problem, I
I do not know much of the language C and I'm using a
program called MPLABX, very good for working
however I do not know how to set the oscillator 12MHZ
*What's in the kit.
I've been looking at the datasheet PIC18F26J50 and found
this formula:
{Example
For a device with Fosc of 16 MHz Desired baud rate of 9600, Asynchronous mode, and
8-bit BRG:
Desired Baud Rate = Fosc / (64 ([SPBRGHx: SPBRGx] + 1))
Solving for SPBRGHx: SPBRGx:
X = ((Fosc / Desired Baud Rate) / 64) - 1
= ((16000000/9600) / 64) - 1
= [25,042] = 25
Calculated Baud Rate = 16000000 / (64 (25 + 1))
= 9615
Error = (Calculated Baud Rate - Desired Baud Rate) / Desired Baud Rate
= (9615 - 9600) / 9600 = 0,16%
}
I used this formula when I arrived at the value 18 and used like this:
Open1USART (USART_TX_INT_OFF
****************& USART_RX_INT_OFF
****************& USART_ASYNCH_MODE
****************& USART_EIGHT_BIT
****************& USART_CONT_RX
****************& USART_BRGH_HIGH, 18) ;/ / GSM 9600 Baudrate
But when using LOGIC(SALEAE) to see communication between the PIC and
the gsm module only saw frame error;
I made a program using MikroC and it worked, but he does it all, no need to manually configure the pic.
I would like to learn how to configure the baud rate and the pic MPLABX
Could someone explain to me how to do this?
*do not get an answer anywhere on the internet.
I am using a development kit that includes
one pic18f26j50 / SIM900 module / GPS.
played a lot with him through the AT command, using
the COM port of the PC. But now I need to do it
function using the pic. But then that's my problem, I
I do not know much of the language C and I'm using a
program called MPLABX, very good for working
however I do not know how to set the oscillator 12MHZ
*What's in the kit.
I've been looking at the datasheet PIC18F26J50 and found
this formula:
{Example
For a device with Fosc of 16 MHz Desired baud rate of 9600, Asynchronous mode, and
8-bit BRG:
Desired Baud Rate = Fosc / (64 ([SPBRGHx: SPBRGx] + 1))
Solving for SPBRGHx: SPBRGx:
X = ((Fosc / Desired Baud Rate) / 64) - 1
= ((16000000/9600) / 64) - 1
= [25,042] = 25
Calculated Baud Rate = 16000000 / (64 (25 + 1))
= 9615
Error = (Calculated Baud Rate - Desired Baud Rate) / Desired Baud Rate
= (9615 - 9600) / 9600 = 0,16%
}
I used this formula when I arrived at the value 18 and used like this:
Open1USART (USART_TX_INT_OFF
****************& USART_RX_INT_OFF
****************& USART_ASYNCH_MODE
****************& USART_EIGHT_BIT
****************& USART_CONT_RX
****************& USART_BRGH_HIGH, 18) ;/ / GSM 9600 Baudrate
But when using LOGIC(SALEAE) to see communication between the PIC and
the gsm module only saw frame error;
I made a program using MikroC and it worked, but he does it all, no need to manually configure the pic.
I would like to learn how to configure the baud rate and the pic MPLABX
Could someone explain to me how to do this?