NT7S / Si5351

Library for the Si5351 clock generator IC in the avr-gcc environment
GNU General Public License v3.0
34 stars 11 forks source link

registers are write only. #14

Open jllachan opened 3 years ago

jllachan commented 3 years ago

Hi, I do not know if it is because I have an older version of Si5351, but most registers are write only (you cannot read them back). This affect all the functions that set bits using read-update-write.

I have modified my version to include a register cache; modified the si5351_read(), si5351_write() and si5351_write_bulk()

EU1KY commented 3 years ago

I've never seen anything like this before. Are you sure? What is the marking at the Si5351a chip?

EU1KY commented 3 years ago

Please check the pull-up resistors at the I2C bus, looks like one of these is either cracked, or shorted.

jllachan commented 3 years ago

Hi, Chip is: 5351 BJDU 022 I2C bus is OK maybe a defective chip I spent 4 days investigating this. I added traces in the lib. That is how I found the issue. I had to add set_clock_source in my code after every reset_pll or set_freq.

I have another one that behaved the same way. I have a few more I can test.

jllachan commented 3 years ago

I decided to take out the oscilloscope and turn on the I2C decoder. It showed that the registers were actually being read. After further test, I found that turning of the stop option on in requestFrom() solves the problem. For the first time, I am now reading the registers. I am using the si5351 A3 with an ESP32. So maybe there is a different behavior in the ESP32 Wire library.