GetPinStatus didn't work

6 posts / 0 new
Last post
herochua617
Offline
Last seen:3 years 11 months ago
加入:2017-01-18 12:46
GetPinStatus didn't work

Hi MT_Dialog,

I want to try to obtain the condition of GPIO_GetPinStatus (GPIO_PORT_1,GPIO_PIN_0)==1, but it seems it did not work eventhough I am using the correct way of implementation according to this linkhttps://support.dialog-semiconductor.com/i-dont-have-problem-building-it.... I have done all the configuration, definition and reservation for the pins and I am altering the main.c file to give me a results through UART. It seems that there is a problem with the GetPinStatus. Please advise. Thanks.

Device:
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi herochua617,

Hi herochua617,

You will have to include the gpio.h file so that the functions and the defines from that file can be visible in your current file.

Thanks MT_dialog

herochua617
Offline
Last seen:3 years 11 months ago
加入:2017-01-18 12:46
Thanks. How about if I want

Thanks. How about if I want to read the adc value through Tera Term? How should I write it? printf_byte_dec (adc_get_ther_sample());? but this won't work.

MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi herochua617,

Hi herochua617,

The printf_byte_dec() is used at the peripheral_examples, if you are using a BLE enabled sw from the ble_examples it would be better if you used the arch_printf() function. If you are trying to read values from the ADC using the batt_lvl example make sure that the ADC is getting back a value, since i am not able to foresee any problem from your description.

Thanks MT_dialog

herochua617
Offline
Last seen:3 years 11 months ago
加入:2017-01-18 12:46
Hi there,

Hi there,

I am now only be able to run the first few line of the printf codes. The tera term only prints out ADC CHANNEL P01 TEST and the leads off also worked intermittently. Since the old coding of adc_get_ther_sample () function does not return any value when I stick the ECG electrodes, I've changed my coding to the one shown in the attach pdf file. If you don't mind, is there any difference in using the single ended than the differential mode?. My sensor has only an output, one leads off + and one leads off - pins. Thanks.

Attachment:
MT_dialog
Offline
Last seen:2 months 1 week ago
Staff
加入:2015-06-08 11:34
Hi herochua617,

Hi herochua617,

The differential measurement is a different way of measuring an analog output, when measuring in differential mode you have only two ports available (since the four available pins are working in pairs P00/P01 and P02/P03) and the ADC is measuring the voltage difference between those two pins instead off measuring the voltage between the one ADC input and ground. The input scale when measuring in differential mode is -1.2V to +1.2V without the attenuator and -3.6V to +3.6V with the attenuator. For more information regarding differential meausurment i would suggest to check on the web for some extra information.

Thanks MT_dialog