ptvoinfo / zigbee-configurable-firmware

PTVO firmware for CC2530, CC2531, and CC2652 Zigbee chips
https://ptvo.info/zigbee-configurable-firmware-features/
MIT License
205 stars 22 forks source link

Something wrong with ADC in PSM mode #216

Closed axelhorn closed 11 months ago

axelhorn commented 1 year ago

Hi, Something is wrong with the configuration of the ADCs in the PSM mode (I did not check in other modes) in the firmware version 1.9.0.3. When I configure the input as ADC (max. 3.3V), after restarting the CC2652P for the first cycle until the device goes to sleep, the measurement is correct. Then, when the device goes to sleep, as if the ADC pin was set low or some pull-down, and it stays like that. With subsequent awakenings of the device, the CC2652P constantly forces the pin to be around 0V. After restart, one measurement is correct again and the next pin wake-ups are forced to 0V. After downgrading to firmware 1.8.0.9 with the same firmware configuration everything works perfectly.

ptvoinfo commented 1 year ago

@axelhorn, I cannot repeat this problem with my chip. Could you please show screenshots with your full configuration?

axelhorn commented 1 year ago

Of course. Zrzut ekranu 2023-08-01 210521

Zrzut ekranu 2023-08-01 210820

Zrzut ekranu 2023-08-01 210858

ptvoinfo commented 1 year ago

I've tried your list of outputs and pins and I cannot repeat the problem again. Could you please try on your side to disable features one by one and find a reason for this behavior?

deaxx commented 1 year ago

Hi, Something is wrong with the configuration of the ADCs in the PSM mode (I did not check in other modes) in the firmware version 1.9.0.3. When I configure the input as ADC (max. 3.3V), after restarting the CC2652P for the first cycle until the device goes to sleep, the measurement is correct. Then, when the device goes to sleep, as if the ADC pin was set low or some pull-down, and it stays like that. With subsequent awakenings of the device, the CC2652P constantly forces the pin to be around 0V. After restart, one measurement is correct again and the next pin wake-ups are forced to 0V. After downgrading to firmware 1.8.0.9 with the same firmware configuration everything works perfectly.

Check this config 2233

axelhorn commented 1 year ago

Thanx. I'll try it when I found some piece of free time :) and write results.

axelhorn commented 1 year ago

@ptvoinfo Finally I checked the configuration you provided with version 1.9.0.3 and latest 1.9.0.6. And it's a little different.

With these settings (External sensor power control first, then ADC) even without RF control and without Internal temperature - high state on the sensor power supply appears every time and the sensors are powered, but again - data from the sensors are read only in first cycle after module reset. With subsequent wake-up cycles, the firmware reports zero adjusted for Scale factor and Shift on the first ADC, and 0V on the second ADC. Let me remind you that in version 1.8.0.9 everything worked in the original configuration without any problems - External power worked with every wake-up cycle and each time the ADC value was read.

2023-08-14 23:26:53MQTT publish: topic 'z2m/GSMM4', payload '{"action":null,"battery":100,"bind_command_l1":null,"device":{"applicationVersion":1,"dateCode":"2023-08-14","friendlyName":"GSMM4","hardwareVersion":1,"ieeeAddr":"0x00124b0022ab7939","manufacturerID":0,"manufacturerName":"ARTi","model":"ptvo.GSMM-E72","networkAddress":9790,"powerSource":"Battery","softwareBuildID":"2023-08-14","stackVersion":3,"type":"EndDevice","zclVersion":1},"l2":0.413,"l3":0.047,"l6":4.025,"l7":2.206,"l8":11,"last_seen":"2023-08-14T23:26:51+02:00","link_to_output_l1":null,"linkquality":142,"switch_actions_l1":null,"switch_type_l1":null,"temperature_l8":11,"update":{"installed_version":539166504,"latest_version":539166740,"state":"available"},"update_available":null,"voltage":3200,"voltage_l2":0.4,"voltage_l3":0,"voltage_l6":4,"voltage_l7":2.2}''

athtest800 commented 1 year ago

I have the same problem. First reading OK. After sleep, the readings are 0V.

ptvoinfo commented 1 year ago

@athtest800 Could you please attach a screenshot with your firmware configuration?

athtest800 commented 1 year ago

I did also some debugging on versions. The problem started at version "1.9.0.4" and later. Please, check what changed between the problematic "1.9.0.4" and the working "1.9.0.2". Here my settings: adc

axelhorn commented 1 year ago

@athtest800 Can you provide me with version 1.9.0.2 for testing? Because I don't have it. The previous one I have 1.8.

axelhorn commented 4 months ago

The problem with the controller forcing the ADC input (any used one) to 0V immediately after the first work-sleep cycle remains unsolved until the current firmware version. It occurs on both the CC2652P and CC2652RB, which I am currently creating a new device on.