confusion about FOSC of PIC18F4550 set up

Discussion in 'Embedded Systems and Microcontrollers' started by tuanvoi, Mar 20, 2009.

  1. tuanvoi

    Thread Starter Active Member

    Oct 31, 2008
    56
    0
    Hi all,
    I'm using USART of PIC18F4550 to transmit data via bluetooth eb301 from www.a7eng.com. My bluetooth factory default is 9600 baud rate, no parity and no flow control. My problem is I don't know to how to set up the PIC18F4550 properly so that the PIC18F4550 and bluetooth can be synchronized. So, i can send and receive the data correctly from bluetooth eb301 devices. Could you please help me on this, thank you!
     
  2. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
  3. mik3

    Senior Member

    Feb 4, 2008
    4,846
    63
    To synchronize to devices you need to drive them with the same clock, otherwise you need to use other techniques to transfer data between them like interrupts or port polling.
     
  4. tuanvoi

    Thread Starter Active Member

    Oct 31, 2008
    56
    0
    thanks thatoneguy and mik3
    Could you please give me more details about "interrupts or port polling"? Thanks
    For the register RCREG, how many bytes it can store? If I'm not wrong, the coming data will be read 1 byte at a time when the flag bit RCIF is set right? And also for the transmiting Tx, the register TXREG will only accept 1 byte at a time? Could you please make it clear? Thank you!
     
  5. n9352527

    AAC Fanatic!

    Oct 14, 2005
    1,198
    4
    I don't think you need to synchronise the clock on serial communication using UART. You need to set the PIC to have the same baud rate, number of bits and parity settings. The datasheet will outline all of these clearly.
     
  6. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    As stated, the datasheet covers this, but if you didn't understand it.

    The interrupt will trigger when the receive buffer is full, the size of the buffer depends on how you set up the port.

    The TXREG cannot accept more than one packet at a time, as there is no FIFO buffer.
     
Loading...