Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

TSL2561 Writing to Registers

Status
Not open for further replies.

rizzy_dascal

Member level 2
Joined
Apr 9, 2012
Messages
47
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,613
Hi,

I am new to micros really and I have chosen this Light Sensor to try and learn, the first thing I need to do though is get the device powered up and I need to find out how to write to the pic registers, I bought an online course but it never mentioned the registers, I need to send a 03h to the 0h control register, if anyone could suggest any info on writing to registers i would be grateful...

control_register.png

Thanks Rizzy
 

What do you mean by writing to PIC registers? You have to write to TSL2561 register using your PIC.

It is a I2C device and you need to have pullup resistors on I2C lines.

If Address pin is connected to GND then Slave Address will be 0b0101001 = 0x29


Page no. 10 shows how to write to device.

After I2C start, slave address is written and slave acks then master sends data byte and again slave acks and then stops I2C.


Page no. 12 shows the I2C and SMBus combined write operations in detail.

In SMBus the byte count packet is sent but not in I2C.

The device has 17 registers

I2C write operation

Start I2C

Write Slave Address + wr bit

slave acks

write Command code

slave acks

write data byte 1

slave acks

write data byte N

slave acks

Stop I2C


I2C Read Operation

Master Starts I2C

Writes Slave Address + wr bit

Slave acks

write Command code

slave acks

write Slave address + read bit

slave acks

send N data bytes

slave acks for each byte

Stop I2C
 
Last edited:

Hi Jayanth,

Thank you for your explanation, I understand now...

cheers
Rizzy
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top