This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Part Number: LAUNCHXL-CC2640R2
Are there any examples out there of how to access and use the comparators on the LAUNCHXL-CC2640R2? I have read the technical documents and looked at the CC2640R2-LAUNCHXL.c file in driver examples and cannot make sense of how to access the comparators. I was only able to find data on COMPB, there is a way to access COMPA?
Apologize for the delay! I have asked my colleague to look into this. Give us couple of days time to get back as Monday is a holiday.
We are glad that we were able to resolve this issue, and will now proceed to close this thread.
If you have further questions related to this thread, you may click "Ask a related question" below. The newly created question will be automatically linked to this question.
In reply to Sai Reddy:
Here is a low-level driver for Comp-A (interrupt driven). You can find the documentation for APIs and register fields here:
// // Clear the interrupt HWREG(AUX_EVCTL_BASE + EVTOMCUFLAGSCLR) |= AUX_COMPA; // // Set an interrupt flag to indicate an interrupt has occurred. // g_bGPIOIntFlag = true;}
// // Turn on clock for AUX_ADI and SOC_AUXCTRL // // Enable clock for required AUX modules
AUXWUCClockEnable(AUX_WUC_MODCLKEN0_AUX_ADI4_M); // this will not allow latching HWREG(AUX_WUC_BASE + AUX_WUC_O_AUXIOLATCH) = AUX_WUC_AUXIOLATCH_EN_TRANSP; // Enable COMPA // HWREG(AUX_ADI4_BASE + ADI_4_AUX_O_COMP) = ADI_4_AUX_COMP_COMPA_EN; // // Connect external reference and input to COMPA // HapiSelectCompARef(COMPA_IN_AUXIO2); //reference - DIO28 HapiSelectCompAInput(COMPA_IN_AUXIO1); //input - DIO29
IntEnable(INT_AUX_COMPA); // enable interrupt
In reply to FI:
Thank you for the driver. I'm having trouble figuring out what drivers to add. Whenever I find drivers to add, I get sucked down a black hole of additional drivers to add.
In reply to David Wood1:
I think it would be best to add and build the entire driverlib to the project.
Are you using an example from SDK and adding CompA to it?
I forgot to mention. Have you tried using Sensor Controller Stuido to configure and use CompA?
Please see the link here: http://www.ti.com/tool/SENSOR-CONTROLLER-STUDIO
You will find code examples inside the Code Language Reference.
All content and materials on this site are provided "as is". TI and its respective suppliers and providers of content make no representations about the suitability of these materials for any purpose and disclaim all warranties and conditions with regard to these materials, including but not limited to all implied warranties and conditions of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, either express or implied, by estoppel or otherwise, is granted by TI. Use of the information on this site may require a license from a third party, or a license from TI.
TI is a global semiconductor design and manufacturing company. Innovate with 100,000+ analog ICs andembedded processors, along with software, tools and the industry’s largest sales/support staff.