Still new to PicBasic - i2c questions


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    cometboy's Avatar
    cometboy Guest


    Did you find this post helpful? Yes | No

    Default Still no i2c action

    I'm still getting no joy from the i2c command. I'm using a PIC16F819 chip with the following program.

    Using a scope on PortA,0 and 1, I see no modulation on either line. The two lines stay high from the 10Kohm pullup resistors on the slave device.

    poke $8F,%01100000 'set oscillator to 4MHz - OSCCON
    poke $03,%00110000 'set to Bank 1 - STATUS
    poke $85,%00000000 'set PortA all outputs - TRISA
    symbol addr = %00101010
    symbol blah = $80
    main:
    i2cout addr,blah,($00,%0000100,255,0,0,%10000000,$FF,$00, %10101010)
    pause 100
    goto main

    Any clues? Thanks for the previous comments.

    Alan

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    first observation, you forgot to disable the analog stuff on those Pins.

    POKE $9F,7

    And i think PBC handle the bank switch for you... i think.
    Last edited by mister_e; - 13th November 2006 at 19:30.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. I2C Master/Slave 16F88/16F767 working code
    By DanPBP in forum Code Examples
    Replies: 2
    Last Post: - 23rd October 2012, 23:31
  2. HARDWARE I2C SAMPLE CODE question
    By Michael Wakileh in forum Code Examples
    Replies: 2
    Last Post: - 16th June 2009, 22:07
  3. I2C Master Slave issues.
    By cpayne in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 29th March 2008, 20:33
  4. i2c PBP questions
    By TimV in forum General
    Replies: 14
    Last Post: - 5th February 2007, 18:58
  5. Please help with i2cslave i2c slave
    By cycle_girl in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 1st December 2005, 14:55

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