• AVR Freaks

Hot!PIC18F45K40 MCC SPI Code - Problem with I2C1_Write2ByteRegister

Author
lumen5g
New Member
  • Total Posts : 7
  • Reward points : 0
  • Joined: 2018/02/01 04:37:38
  • Location: 0
  • Status: offline
2020/12/24 03:17:13 (permalink)
0

PIC18F45K40 MCC SPI Code - Problem with I2C1_Write2ByteRegister

Hi,
 
I've got a PIC18F45K40  connected to a proximity sensor VCNL4040. The sensor has 16 bit registers that can be r/w :
http://www.farnell.com/datasheets/2245070.pdf?
 
I'm able to successfully read all of the registers  using the MCC code generated:
However when I attempt to use the supplied function I2C1_Write2ByteRegister() to send a 16 bit int it only writes the upper two bytes.
 
For example :
 
 
Reads back as "0x1200"
 
 
#1

1 Reply Related Threads

    lumen5g
    New Member
    • Total Posts : 7
    • Reward points : 0
    • Joined: 2018/02/01 04:37:38
    • Location: 0
    • Status: offline
    Re: PIC18F45K40 MCC SPI Code - Problem with I2C1_Write2ByteRegister 2020/12/24 03:19:32 (permalink)
    +1 (1)
    Mods please delete, I'm trying to compose a post but getting the 
     

    Access Denied

    You don't have permission to access "http://www.microchip.com/forums/post.aspx?" on this server.
    #2
    Jump to:
    © 2021 APG vNext Commercial Version 4.5