I have been using JN-AN-1220 as a template for my end devices to read sensors on I2C (DIO16/17) and SPI(DO0, DO1, DIO18, DIO0, DIO1). All that works fine. I am using DIO19 to enable battery monitoring. Below is the code I am using to turn the output off at initialize.
#define DIO_READ_BATTERY 19 // DIO19 is for enabling battery monitoring
#define DIO_READ_BATTERY_MASK (1 << DIO_READ_BATTERY)
I also try setting it off during the main loop but still not able to see the output turn off. It stays high all the time.
I read up on JN-UG-3087 that it would need to call to u32AHI_Init() to initialize the API functions and before calling to any integrated peripherals API functions. When I search for this function inside JN-AN-1220 LightSensor, it is only called on JN517x chip but I am using JN5169. I am not sure where to go from here. Below is the circuit. Any help is appreciated.
Well, I had figure it out after I turn off SPI and DIO19 is working fine as digital output.
I read more on the SPI and seems that DIO19 is SPISEL0 also. When using SPI, SPISEL0 is always used and can't be reassigned unlike SPISEL1/2 that can be assigned to different pins. So what I end up doing was to move the digital output to a different pin. Hope this will help other people in their designs.