May 9, 2018
I am spending my time waiting for the next pcb revision to come back from the fab trying to make the best use of the one board I assembled. Although flawed, I am using it to learn about this sensor suite. I also heard back from ASM; they are very busy but promise an answer to my questions next week. This is progress, since if I can keep their attention I might get answers to the multitude of questions my initial efforts at building this spectrometer have generated.
I cannot get the I2C devices to acknowledge on my device and I don't know if this is normal and to be expected, or is a consequence of the circuit error(s) on the current design. I developed an AS7265X class and tried a simple read of the hardware version and device type registers and got nothing. I also made an attempt to use the same sketch on the Demo Board. At least in this case, I can see the two devices AS72652/AS72653 on the master I2C bus but when I connect to the AS72651 slave bus that is supposed to talk to the MCU I again see no I2C devices. Well, the DemoBoard is by default set in the UART mode so I would have to remove a resistor and add a resistor to place the board into I2C mode. I will just wait for my next revision rather than start Bubba-ing the Demo board.
I did get somewhere using the UART interface and the AT command set using my board. I connected RX/TX to SDA/SCL and then pulled I2CEN LOW to enter UART mode. I wrote a little program to use the AT command set to query hardware and software versions, set the integration time and gain of the sensors, and to query the number of devices present (sadly, there are only two, the AS72652 doesn't seem to be connected properly or is malfunctioning, see last log entry). Here is the output:
When I power on and the MCU runs the program I curiously get info that I didn't ask for. The first command is supposed to be AT which should return an OK. It does so if I press reset and open the serial monitor, but when I power off and then power on I get this curious notice that there is a 4 MB SPI flash (correct) and the AS7265 device is indicated along with the software version 1.2.7. Maybe this is the default message on power on.... Then the hardware version is 403Cx, the software version again 1.2.7 and the number of devices somehow gets lost (it is 2, meaning AS72651 and AS72653). Thereafter the device responds normally, showing the default gain and integration times as well as my successful changes of the same except for those of the AS72652 which responds to no commands. The integration time is set in units of 2.8 ms, so that 36 (max 255) corresponds to ~100 ms. Lastly, I ask for the temperatures of the three ICs in Centigrade. Presumably 100 is due to the AS72652 being out of reach but 44 C is pretty warm for the AS72651.
Well, in any case, I succeeded in getting some useful information from my device via the UART interface and I will post this sketch as the first installment of my AS7265X github repository.