kriswiner / AS7265X

18-channel, 40-nm FWHM spectrometer
19 stars 17 forks source link

Gain not applying to every sensor or something else #7

Open kiromaisus opened 2 months ago

kiromaisus commented 2 months ago

Hi. I'm having trouble with gains of each sensor, it seems it won't apply the same value to all of them. Using an incandescent lamp above a diffuser (that I previously checked that only attenuates a bit and the same amount in every visible frequency) I'm having these values at gain 64x: 340.10, 342.24, 561.54, 274.37, 348.22, 346.36, 275.11, 474.71, 486.46, 318.73, 921.46, 576.71, 1050.02, 1315.69, the 4 last channels aren't important to me as these are infrared. It's ordered as the spectrum goes, from left to right, from blue to red. So it should be in ascending order of values, as an incandescent is 2700 K has a spectrum that is ascending as the wavelength increases, up to a point in the infrared. But it's not what I get. And I checked with a spectrum meter, the Sekonic C-800, the lamp is what the theory says. I'm plotting in this order to get the right order: AS7265X.readCalData(calData); Serial.println(calData[12]); Serial.println(calData[13]); Serial.println(calData[14]); Serial.println(calData[15]); Serial.println(calData[16]); Serial.println(calData[17]); Serial.println(calData[6]); Serial.println(calData[7]); Serial.println(calData[0]); Serial.println(calData[8]); Serial.println(calData[1]); Serial.println(calData[9]); Serial.println(calData[2]); Serial.println(calData[3]); Serial.println(" ");

Anyone has an idea why 2 of my prototypes are showing me this?

Also, if I try to read in mode3 (one shot), after flashing this program, it won't flash anymore, only if I plug the cable as soon as it looks for the upload port. So it seems like it's bugging the FW up to a point it doesn't respond to external commands anymore. It also doesn't work in this mode, keeps resetting the watchdog timer.

kriswiner commented 2 months ago

Are you saying some of your prototypes show this behavior and some do not?

In any case, I would check the firmware version that you loaded. Part way into the sensor development AMS changed the order of the readout (i.e., changed the register map). So it is possible that what you expect is not consistent with what the firmware is doing. I would suggest you contact AMS for the latest firmware and register map and use these and try again...

On Thu, May 23, 2024 at 1:02 PM Ruvian de Césaro @.***> wrote:

Hi. I'm having trouble with gains of each sensor, it seems it won't apply the same value to all of them. Using an incandescent lamp above a diffuser (that I previously checked that only attenuates a bit and the same amount in every visible frequency) I'm having these values at gain 64x: 340.10, 342.24, 561.54, 274.37, 348.22, 346.36, 275.11, 474.71, 486.46, 318.73, 921.46, 576.71, 1050.02, 1315.69, the 4 last channels aren't important to me as these are infrared. It's ordered as the spectrum goes, from left to right, from blue to red. So it should be in ascending order of values, as an incandescent is 2700 K has a spectrum that is ascending as the wavelength increases, up to a point in the infrared. But it's not what I get. And I checked with a spectrum meter, the Sekonic C-800, the lamp is what the theory says. I'm plotting in this order to get the right order: AS7265X.readCalData(calData); Serial.println(calData[12]); Serial.println(calData[13]); Serial.println(calData[14]); Serial.println(calData[15]); Serial.println(calData[16]); Serial.println(calData[17]); Serial.println(calData[6]); Serial.println(calData[7]); Serial.println(calData[0]); Serial.println(calData[8]); Serial.println(calData[1]); Serial.println(calData[9]); Serial.println(calData[2]); Serial.println(calData[3]); Serial.println(" ");

Anyone has an idea why 2 of my prototypes are showing me this?

Also, if I try to read in mode3 (one shot), after flashing this program, it won't flash anymore, only if I plug the cable as soon as it looks for the upload port. So it seems like it's bugging the FW up to a point it doesn't respond to external commands anymore. It also doesn't work in this mode, keeps resetting the watchdog timer.

— Reply to this email directly, view it on GitHub https://github.com/kriswiner/AS7265X/issues/7, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABTDLKTXBUZJK6WPKQRNQGLZDZDNHAVCNFSM6AAAAABIGJYPPKVHI2DSMVQWIX3LMV43ASLTON2WKOZSGMYTGNZSHA2DKMY . You are receiving this because you are subscribed to this thread.Message ID: @.***>

kiromaisus commented 2 months ago

I meant I only have 2 prototypes and all of them show this problem.

For the FW version, here is the output: AS72651 Device Type = 0x40 should be 0x40

AS72651 HW Version = 0x41 should be 0x41

AS72651 FW Major Version = 0xC AS72651 FW Patch Version = 0x0 AS72651 FW Build Version = 0x0

I will try what you said. Thank you for now.