I2CRead problem


Closed Thread
Results 1 to 10 of 10

Thread: I2CRead problem

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: I2CRead problem

    the mcc generated pin file can very easily slot into pbp
    just cut out the comments and the c bits you don't need load replace all the 0x with $

    Code:
    /**
       Generated Pin Manager File
      
       Company:
         Microchip Technology Inc.
      
       File Name:
         pin_manager.c
      
       Summary:
         This is the Pin Manager file generated using PIC10 / PIC12 / PIC16 / PIC18 MCUs
      
       Description:
         This header file provides implementations for pin APIs for all pins selected in the GUI.
         Generation Information :
             Product Revision  :  PIC10 / PIC12 / PIC16 / PIC18 MCUs - 1.65.2
             Device            :  PIC18F26K42
             Driver Version    :  2.01
         The generated drivers are tested against the following:
             Compiler          :  XC8 1.45
             MPLAB             :  MPLAB X 4.15
      
         Copyright (c) 2013 - 2015 released Microchip Technology Inc.  All rights reserved.
     */
      
     /*
         (c) 2018 Microchip Technology Inc. and its subsidiaries. 
         
         Subject to your compliance with these terms, you may use Microchip software and any 
         derivatives exclusively with Microchip products. It is your responsibility to comply with third party 
         license terms applicable to your use of third party software (including open source software) that 
         may accompany Microchip software.
         
         THIS SOFTWARE IS SUPPLIED BY MICROCHIP "AS IS". NO WARRANTIES, WHETHER 
         EXPRESS, IMPLIED OR STATUTORY, APPLY TO THIS SOFTWARE, INCLUDING ANY 
         IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY, AND FITNESS 
         FOR A PARTICULAR PURPOSE.
         
         IN NO EVENT WILL MICROCHIP BE LIABLE FOR ANY INDIRECT, SPECIAL, PUNITIVE, 
         INCIDENTAL OR CONSEQUENTIAL LOSS, DAMAGE, COST OR EXPENSE OF ANY KIND 
         WHATSOEVER RELATED TO THE SOFTWARE, HOWEVER CAUSED, EVEN IF MICROCHIP 
         HAS BEEN ADVISED OF THE POSSIBILITY OR THE DAMAGES ARE FORESEEABLE. TO 
         THE FULLEST EXTENT ALLOWED BY LAW, MICROCHIP'S TOTAL LIABILITY ON ALL 
         CLAIMS IN ANY WAY RELATED TO THIS SOFTWARE WILL NOT EXCEED THE AMOUNT 
         OF FEES, IF ANY, THAT YOU HAVE PAID DIRECTLY TO MICROCHIP FOR THIS 
         SOFTWARE.
     */
      
     #include <xc.h>
     #include "pin_manager.h"
     #include "stdbool.h"
      
      
      
      
      
     void PIN_MANAGER_Initialize(void)
     {
         /**
         LATx registers
         */
        LATA = 0x00;
        LATB = 0x01;
        LATC = 0x02;
      
         /**
         TRISx registers
         */
         TRISA = 0xFF;
        TRISB = 0xFC;
        TRISC = 0x41;
      
         /**
         ANSELx registers
         */
         ANSELC = 0x01;
        ANSELB = 0xF0;
        ANSELA = 0xFF;
      
         /**
         WPUx registers
         */
         WPUE = 0x00;
        WPUB = 0x00;
        WPUA = 0x00;
        WPUC = 0x00;
      
         /**
         ODx registers
         */
        ODCONA = 0x00;
        ODCONB = 0x00;
        ODCONC = 0x00;
      
      
      
      
      
        
     
    
        SPI1SDIPPSbits.SPI1SDIPPS = 0x16;   //RC6->SPI1:SDI1;    
        RC4PPS = 0x1E;   //RC4->SPI1:SCK1;    
        SPI1SCKPPSbits.SPI1SCKPPS = 0x14;   //RC4->SPI1:SCK1;    
        RC5PPS = 0x1F;   //RC5->SPI1:SDO1;    
     }
       
     void PIN_MANAGER_IOC(void)
     {   
     }
      
     /**
      End of File
     */
    Last edited by richard; - 20th October 2018 at 13:11.
    Warning I'm not a teacher

Similar Threads

  1. Problem with I2Cread command for an 32 bits ADC
    By Pilou81 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 27th October 2011, 15:32
  2. Need help to get I2CRead woriking
    By w7ami in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 29th November 2007, 16:22
  3. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 6th June 2006, 20:03
  4. Problem with I2Cread and I2CWRITE function
    By Tony85 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th June 2006, 18:32
  5. I2CRead / I2CWrite Problem?
    By koossa in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st October 2005, 18:26

Members who have read this thread : 1

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