I am currently using the cc2530 baseboard of Wireless Dragon to expand the collection of heart rate sensor information and networking. But we encountered a problem. When collecting data from the ADC, the original code used the voltage range to determine which sensor it was. I don't know the range of the heart rate sensor? And therefore, I don't know how to collect heart rate information. We have been stuck here for a long time. Please give us some guidance. Thank you very much!!!
The original code determines which sensor it is by the voltage range. This ADC port should only be used to identify which module is connected to the baseboard. If you want to add a heart rate module that is not in the official list, you can consider connecting it to another ADC port and compile the algorithm according to the instructions of the heart rate module.
Details
Published on 2018-8-17 14:57
littleshrimp posted on 2018-8-17 09:28 Which two GPIOs do SEL1 and SEL2 correspond to? "Value = ReadSensorAdc(5);//Collect SEL voltage" corresponds to which pin voltage of ccxxxx?
sel1 and sel2 are p0_5 and p0_7 respectively. The acquisition of p0_5 should be like this
#define IO_DIR_PORT_PIN1(port, pin, dir) \ do { \ if (dir == IO_OUT) \ P##port##DIR |= (0x01<<(pin)); \ else \ P##port##DIR &= ~(0x01<<(pin)); \ }while(0) // Where port={0,1,2}, pin={0,..,7} and dir is one of:
I haven't seen the schematic diagram, but I guess different sensors are equipped with different voltage divider resistors, so different identification voltages will be generated. This requires the cooperation of software and sensor module.
The original code determines which sensor it is by the voltage range. This ADC port should only be used to identify which module is connected to the baseboard. If you want to add a heart rate module that is not in the official list, you can consider connecting it to another ADC port and compile the algorithm according to the instructions of the heart rate module.
topwon posted on 2018-8-17 14:57 The original code determines which sensor it is by the voltage value range-------This ADC port should only be used to identify which module is connected to the baseboard? ...