Author Topic: Wall touch light switch, EEPROM, I2C  (Read 1959 times)

0 Members and 1 Guest are viewing this topic.

Offline ManxTopic starter

  • Contributor
  • Posts: 39
  • Country: pl
Wall touch light switch, EEPROM, I2C
« on: May 01, 2019, 10:00:33 am »
I'm trying to adjust sensitivity of my friend's wall touch light switch.


And I'm dumbfounded.


There is HD6001 touch IC http://www.hab.com.tw/upload/2013879261133084.pdf.
There is our usual Atmel EEPROM. http://ww1.microchip.com/downloads/en/devicedoc/doc0180.pdf.
Also, there is something which has to be a RF receiver, which doesn't interest me.

I thought the EEPROM would keep settings for the device. I dumped it's content (whatever is the meaning of it).
Code: [Select]
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF 00 FF FF FF
22 0D F9 93 FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF 40 FF FF FF
14 FC A9 E2 14 AF 43 90 FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF 84 FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF
FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF FF

But when I read the touch IC datasheet (a Chinese flavor of a datasheet style, but not too bad), it seems that it can communicate over I2C only as a slave. And there is the eeprom. So we have two gearboxes and no engine. And indeed, there is no communication over I2C bus when the switch is powered up or buttons are pressed (I don't have a compatible remote to check if anything changes when I'd program one).

The touch IC supposedly has some registers to control its settings, but I cannot find the IC on the I2C bus to communicate with it. It doesn't help that the I2C address is kept in one of the registers. But anyway, a scanner doesn't find it.

Could anyone help me make heads or tails of it? Why the eeprom? How to talk to the touch IC?
« Last Edit: May 01, 2019, 10:05:38 am by Manx »
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6563
  • Country: nl
Re: Wall touch light switch, EEPROM, I2C
« Reply #1 on: May 01, 2019, 10:08:28 am »
Check the RF board if there is some processor on it ?
I have seen BT remote switches where the BT transceiver micro is the only micro on the board, but if you do not see any I2C communication at startup or use it is a puzzle.

EDIT: the HD6001 is a microcontroller, check if the SDA and SCL lines are connected to the eprom, probably not.
As you said those are for remote host control. So the programmer can use any of the I/O ports to bitbang I2C to the eprom ?
Just see what the SDA and SCL of the eprom are connected to what pins on the micro.
« Last Edit: May 01, 2019, 10:11:40 am by Kjelt »
 

Offline ManxTopic starter

  • Contributor
  • Posts: 39
  • Country: pl
Re: Wall touch light switch, EEPROM, I2C
« Reply #2 on: May 01, 2019, 10:32:43 am »
RF board has some tiny 6 lead IC marked H01 (followed by 6 lying on its back). I couldn't find anywhere any corresponding IC which would make sense. Remote control is supposed to be over 433.92 MHz. I don't know how smart these are. Anyways, the I2C lines don't go to the RF board.

But the I2C lines ARE properly connected between eeprom and HD6001. This was the first thing I checked and so I expected the touch IC to talk to the eeprom, before I read the rest of the datasheet.

EDIT: Also, I2C doesn't seem to go anywhere outside the board. Neither to the HV board connector nor to the unpopulated group of pads I used for connecting power. So it's not like it's supposed to be used by an external programmer or some missing additional chip.

I have no idea what this is about.

EDIT:

Ok, so I was right suspecting the eeprom may have something to do with remote control. It turns out the switch works with my remote. And when I press a button on the remote, whether one paired with the switch or not, raw data goes from the receiver to pin 9 of the touch IC, and some chat ensues over I2C.

So this would mean that: (1) it's not true that HD6001 cannot work as I2C master, (2) the eeprom is used for remote control and (3) I still have no idea how to communicate with HD6001 and modify its registers.
« Last Edit: May 01, 2019, 12:05:16 pm by Manx »
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6563
  • Country: nl
Re: Wall touch light switch, EEPROM, I2C
« Reply #3 on: May 01, 2019, 12:25:26 pm »
Did you read my Edit ?

Probably the microcontroller uses two different GIOports to bitbang I2C with the eprom.
You can program the microcontroller through the original I2C pins as per datasheet specified, they are also probably connected to that header or some other pads where the micro is programmed.
 
The following users thanked this post: Manx

Offline ManxTopic starter

  • Contributor
  • Posts: 39
  • Country: pl
Re: Wall touch light switch, EEPROM, I2C
« Reply #4 on: May 01, 2019, 12:46:13 pm »
Ah, ok, bitbang. I'm starting to get what you mean. But anyways, these are the same I2C pins. Eeprom connects to pins 5 and 4 (marked SDA and SCL) of the touch IC. This was elegant on the part of the designer, but this is what confused me. Sice, I guess, it turns out the pins are used as normal GPIOs and their I2C functionality is bit banged.

In such case there would be no (apparent) way to modify touch IC parameters, like sensitivity, which doesn't make me happy :/ I played with programming more buttons, and the eeprom stores only a list of remote keys assigned to each switch button (plus address of last item on the list for each button). So no calibration data in the eeprom :/
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6563
  • Country: nl
Re: Wall touch light switch, EEPROM, I2C
« Reply #5 on: May 01, 2019, 01:59:08 pm »
I have no time to read the datasheet but perhaps there is a special (startup) condition where the uC can be programmed  through I2C ?
Since both ic's have a different I2C address this could be the case ?
 

Offline ManxTopic starter

  • Contributor
  • Posts: 39
  • Country: pl
Re: Wall touch light switch, EEPROM, I2C
« Reply #6 on: May 01, 2019, 02:22:57 pm »
Nothing about this in the datasheet. Nothing about programming at all.
So a typical problem with Chinese (and Taiwanese, in this case) ICs and their datasheets. There is only one, preliminary, version of the datasheet on the whole internet, and no discussion about the chip anywhere.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6563
  • Country: nl
Re: Wall touch light switch, EEPROM, I2C
« Reply #7 on: May 01, 2019, 03:51:03 pm »
Did you try a I2C busscan with a buspirate or the likes ?
It should find the uC on the HD6001 default Slave address: 0110 000.  :-//
 

Offline ManxTopic starter

  • Contributor
  • Posts: 39
  • Country: pl
Re: Wall touch light switch, EEPROM, I2C
« Reply #8 on: May 01, 2019, 04:18:57 pm »
I used Arduino loaded with MultiSpeedI2CScanner (https://github.com/RobTillaart/Arduino/tree/master/sketches/MultiSpeedI2CScanner). It found only the eeprom (8 times even, which was funny to me, btw.. From 0x50 to 0x57). But nothing from HD6001. I also tried to manually talk to 0x30, but no one responded.

I'd guess that when the designer reprogrammed the chip, the content of the datasheet ceased to be valid. The datasheet is probably for some general purpose version of the chip, and mine has a custom firmware which allows it to work in this specific setup, with remote control and eeprom -- and not only as a simple switch or a peripheral to another MCU.
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6563
  • Country: nl
Re: Wall touch light switch, EEPROM, I2C
« Reply #9 on: May 01, 2019, 05:19:37 pm »
 The datasheet is confusing.
On page15 they state you can program rhe I2C slave address in 9 bits while the protocol only supports 7 bits  :-//

BTW it also states:
Quote
HD6001 Device Slave address. Default is 0x60
You could try that one and check your pulses, stay below 75kHz and the required setup times of 5us.
 

Offline ManxTopic starter

  • Contributor
  • Posts: 39
  • Country: pl
Re: Wall touch light switch, EEPROM, I2C
« Reply #10 on: May 01, 2019, 06:51:14 pm »
50 kHz, 10 us between SDA going low and first SCL going low. Nothing on the scanner. Nothing while trying to read from 0x30 or 0x60 manually.

I'm hereby ready to give up ;) Thanks Kjelt for your interest and your help. I learned some new things today, but I don't think it's worth spending more time on this. At least not this way.

The problem with the switch was that one button sometimes was getting tripped by itself. Sometimes every couple of days, sometimes every couple of minutes.

So maybe there are some hardware methods to adjust this. There are 1k resistors between chip pins and sensing electrodes. I guess changing them should affect sensitivity.

I'll decrease the resistance a bit and I'll hope it will fix the problem.
« Last Edit: May 01, 2019, 06:54:43 pm by Manx »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf