16F1847 Usart and I2C


Closed Thread
Results 1 to 7 of 7

Hybrid View

  1. #1
    Join Date
    Sep 2011
    Posts
    20

    Default Re: 16F1847 Usart and I2C

    Thanks for the reply. Just tried it and it does not work. May have to try a short bit of code to see if I can display the heading on a LCD using the I2C routine with out all the other stuff. You helped the last time when I could not get the 16F877a working...

  2. #2
    Join Date
    Sep 2011
    Posts
    20

    Default Re: 16F1847 Usart and I2C

    Had to change to SW TX then it works....well sort of. The I2C reads the compass and the data is stored in the array and tehn transmitted....however the OSD compass heading displays garbage (643, 888, 127 random stuff).
    Changed the chip set up to

    Include "modedefs.bas"
    define OSC 20
    Define I2C_SLOW 1
    APFCON0 = %11100000 'Set RB pins to SCL1 and SDA 1
    APFCON1 = 1 ' TX on RB5
    CM1CON0 = 0 ' COMPARATORS OFF
    CM1CON1 =0
    CM2CON0 = 0 ' COMPARATORS OFF
    CM2CON1 =0
    CPSCON0 = 0 'CAPACTIVE SENSE MODULE OFF
    ANSELA = 0 'turn off analog port A
    ANSELB = 0 'turn off analog port B

    TRISA= %11111111
    TRISB= %11111111

Similar Threads

  1. Interfacing with Arduino I2C LCD
    By norohs in forum Documentation
    Replies: 47
    Last Post: - 30th May 2017, 19:53
  2. Problem with PICto PIC I2C MASTER-SLAVE
    By juanen19 in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 11th June 2013, 03:58
  3. Strange I2C and serial behaviour.......
    By jimbostlawrence in forum General
    Replies: 4
    Last Post: - 30th October 2012, 02:02
  4. USART to PC
    By tonyfelloni in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th October 2008, 01:09
  5. Usart
    By lew247 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 3rd June 2008, 00:41

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts