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.
Hello Dorene,
Can you be more precise in terms of which TM4C device, which reference source for the comparator, type of interrupt?
Regards
Amit
Amit Ashara said:Can you be more precise ...
Of course - "PC Always" rules - but conferring any, "precision" to opening/requesting post is a major, "reach."
Hello Dorene,
Indeed we can help you and to ensure that you learn, I will keep the parameters for the functions mentioned below open, so that you can also research and learn along side
I went through the code and here is what I have the changes that need to be done
1. The Comparator Pins have not been configured to allow the external input to get connected to the Comparator Module. For doing that you need to cal the GPIO API's before you configure the comparator module.
GPIOPinConfigure(GPIO Comparator Pin Configuration as done in pin_map.h);
GPIOPinTypeComparator(GPIO Base Address, GPIO Pin Number)
2. The Interrupt for the Compartor needs to be enabled in the NVIC module before the call for Kentec320x240x16_SSD2119Init function
IntEnable(The Interrupt define as given in hw_ints.h);
IntMasterEnable();
3. Do not use IntDefaulthandler as it may create issue when multiple interrupt handlers are needed later. Instead give it a name other than IntDefaultHandler and then put the same name in the startup_ccs.c file at the correct interrupt position in the Interrupt Table
4. Which function is the Interrupt Handler for the Analog Compartor?
Regards
Amit
Hello Dorene,
Do you mean, that you want to count the edge rise on a signal :may be connected to a switch that the user presses or some signal coming from external device? Please clarify
Did you make the changes to your code as I had suggested?
Regards
Amit
hi Kel,
thx~Actually i not quite understand the link that you share....
Could you kindly explain?
Dorene
Hello Dorene
So you would take the output of the comparator? The post title was more related to the interrupt which is confusing.
Do make things clearer with the new information
1. You have a signal which is the input to the comparator
2. The output of the comparator is taken out of the TM4C device to be used elsewhere?
Regards
Amit
Hi Amit,
cant...
1.yes, a input signal to PC7.
2.no, i need to show the counting the edge rise on the LCD.
Regards,
Dorene
Hello Dorene
Thanks for the clarification. I again went through the new code and you have missed enabling the module
SysCtlPeripheralEnable(SYSCTL_PERIPH_COMP0);
It should have given a bus fault.
Regards
Amit
Hello Dorene
Got some time out to make a simple Analog Comparator Code that you can run on a TM4C123 LaunchPad. Every time you connect the PC6 pin to 3.3V the Blue LED will blink,
http://e2e.ti.com/cfs-file.ashx/__key/communityserver-discussions-components-files/908/2577.TM4C123_5F00_ACMP.7z
Regards
Amit