Hi Theo,
I think you already knew this, simple moving of INT from INT0 to INT4 is not enough, there is some more fundamental issue. Latency of 0.18 mSec seems excessive as another indication of driver issue.
The output from serial term is repeatedly showing " "
EXT hal test started...
EXT hal test started...
EXT hal test started...
Indicating that main is repeatedly restarting?
George
[PATCH] AVR EXT Topic is solved
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: [PATCH] AVR EXT
MGeo wrote:
I did notice the warnings below when compiling main.c:
About the Warning, I will modify the demo to remove them. To do that, put the configuration of the External interruption that you whant to use. In your case:
Code: Select all
/**
* @brief EXT Driver configurations.
*/
static const EXTConfig extcfg = {
{
{EXT_CH_MODE_RISING_EDGE , extcb}, /* INT0 Config. */
}
};
MGeo wrote:
Indicating that main is repeatedly restarting?
Yes, this is because you did not select the rigth EXT interrupt channel in mcuconf.h file locate in the demo directory.
instead of:
Code: Select all
/*
* EXT drivers system settings.
*/
#define AVR_EXT_USE_INT0 FALSE
#define AVR_EXT_USE_INT1 FALSE
#define AVR_EXT_USE_INT2 FALSE
#define AVR_EXT_USE_INT3 FALSE
#define AVR_EXT_USE_INT4 TRUE
#define AVR_EXT_USE_INT5 FALSE
it should be
Code: Select all
/*
* EXT drivers system settings.
*/
#define AVR_EXT_USE_INT0 TRUE
#define AVR_EXT_USE_INT1 FALSE
#define AVR_EXT_USE_INT2 FALSE
#define AVR_EXT_USE_INT3 FALSE
#define AVR_EXT_USE_INT4 FALSE
#define AVR_EXT_USE_INT5 FALSE
regards,
Theo.
Theo.
Re: [PATCH] AVR EXT
Hi Theo,
Ah yes, I failed to select the right EXT interrupt channel in mcuconf.h file. Once I did per above latency has dropped to 4.25 uS.
https://ibb.co/eqf9ek
George
PS: I can not find a way to post images (ie logic analyzer screen caps) to this forum. I've tried img tags and url, but it always shows a broken link. If anyone knows how please advise. I think it would add value to the thread. Thanks - George
Ah yes, I failed to select the right EXT interrupt channel in mcuconf.h file. Once I did per above latency has dropped to 4.25 uS.
https://ibb.co/eqf9ek
George
PS: I can not find a way to post images (ie logic analyzer screen caps) to this forum. I've tried img tags and url, but it always shows a broken link. If anyone knows how please advise. I think it would add value to the thread. Thanks - George
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: [PATCH] AVR EXT
Hi MGeo,
If you want to add an image, when you write a post, see bellow, there is two onglets (Options and Attachments).
Select the attachments and then use the add button to add your image.
I did it with you image Cap2.png
If you want to add an image, when you write a post, see bellow, there is two onglets (Options and Attachments).
Select the attachments and then use the add button to add your image.
I did it with you image Cap2.png
regards,
Theo.
Theo.
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: [PATCH] AVR EXT
MGeo,
We try to keep topics focus on one problem at time. So please for next time, you may open other posts when you have questions that are not related to the concerned post.
Thanks.
We try to keep topics focus on one problem at time. So please for next time, you may open other posts when you have questions that are not related to the concerned post.
Thanks.
regards,
Theo.
Theo.
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: [PATCH] AVR EXT
Hi MGeo,
I finally fix all the conflicts in the trunk.
I have try to debug and find the solution of bug but it though me more time than expected. So I just down grade the actual code by removing the support of the PCINT. I will re-implement this part by using patch submit by Marco.
Thanks for finding the bug.
It is now fixed in the trunk.
I finally fix all the conflicts in the trunk.
I have try to debug and find the solution of bug but it though me more time than expected. So I just down grade the actual code by removing the support of the PCINT. I will re-implement this part by using patch submit by Marco.
Thanks for finding the bug.
It is now fixed in the trunk.
regards,
Theo.
Theo.
Re: [PATCH] AVR EXT
Hi Theo,
I've stated debug in Atmel Studio using simulator. I'm seeing that INT0 initializes EIMSK and EICRA correctly, and INT4 does not (per screen caps).
I'm still trying to grasp the code, but I believe their might be an (not directly related?) issue that the following will not work as intended for non-zero based INT's. If only INT4 is defined, we would still end up with declare_extint_isr(0), which not generate a compile error but would define the incorrect INT0 ISR vector.
from hal_ext_lld.c
and from hal_ext_lld.h
.
I've stated debug in Atmel Studio using simulator. I'm seeing that INT0 initializes EIMSK and EICRA correctly, and INT4 does not (per screen caps).
I'm still trying to grasp the code, but I believe their might be an (not directly related?) issue that the following will not work as intended for non-zero based INT's. If only INT4 is defined, we would still end up with declare_extint_isr(0), which not generate a compile error but would define the incorrect INT0 ISR vector.
from hal_ext_lld.c
Code: Select all
/*
* Interrupt handlers for INT-type interrupts.
*/
#if 0 < EXT_INT_NUM_CHANNELS
declare_extint_isr(0);
#endif
#if 1 < EXT_INT_NUM_CHANNELS
declare_extint_isr(1);
#endif
#if 2 < EXT_INT_NUM_CHANNELS
declare_extint_isr(2);
#endif
#if 3 < EXT_INT_NUM_CHANNELS
declare_extint_isr(3);
#endif
#if 4 < EXT_INT_NUM_CHANNELS
declare_extint_isr(4);
#endif
#if 5 < EXT_INT_NUM_CHANNELS
declare_extint_isr(5);
#endif
and from hal_ext_lld.h
Code: Select all
#define EXT_INT_NUM_CHANNELS \
(EXT_INT0_PRESENT + EXT_INT1_PRESENT + EXT_INT2_PRESENT + \
EXT_INT3_PRESENT + EXT_INT4_PRESENT + EXT_INT5_PRESENT)
.
- tfAteba
- Posts: 547
- Joined: Fri Oct 16, 2015 11:03 pm
- Location: Strasbourg, France
- Has thanked: 91 times
- Been thanked: 48 times
Re: [PATCH] AVR EXT
Hi MGeo,
What version of ChibiOS do you use?
I have update the trunk yesterday, so that EXT work as expected. I have remove the code that was generated the conflict.
You can use any of the EXT (INT0...INT5) to make your test.
But for that you need to used the lasted source code!!!
You can find it here: https://sourceforge.net/p/chibios/svn/HEAD/tree/trunk/
You just need to click on the button " Download Snapshot"
The testhal/AVR/EXT/ will work out of the box now.
Please let me know how you tests will run. Do not hesitate to give a feedback.
Thanks
What version of ChibiOS do you use?
I have update the trunk yesterday, so that EXT work as expected. I have remove the code that was generated the conflict.
You can use any of the EXT (INT0...INT5) to make your test.
But for that you need to used the lasted source code!!!
You can find it here: https://sourceforge.net/p/chibios/svn/HEAD/tree/trunk/
You just need to click on the button " Download Snapshot"
The testhal/AVR/EXT/ will work out of the box now.
Please let me know how you tests will run. Do not hesitate to give a feedback.
Thanks
regards,
Theo.
Theo.
Re: [PATCH] AVR EXT
Hi Theo,
I've been using Chibios stable release 17.6.0 from here https://sourceforge.net/projects/chibio ... %2017.6.0/
I downloaded lastest trunk from your link above. I see that hal_ext_lld.c has major changes, much easier to follow. It looks like PCINTx support is removed from EXT for now?
A quick check with simulator looks much better. It even looks to be handling multiple INTs correctly! I'll continue testing and report back.
Thanks for your help.
George
I've been using Chibios stable release 17.6.0 from here https://sourceforge.net/projects/chibio ... %2017.6.0/
I downloaded lastest trunk from your link above. I see that hal_ext_lld.c has major changes, much easier to follow. It looks like PCINTx support is removed from EXT for now?
A quick check with simulator looks much better. It even looks to be handling multiple INTs correctly! I'll continue testing and report back.
Thanks for your help.
George
Last edited by MGeo on Wed Aug 02, 2017 10:51 am, edited 2 times in total.
Who is online
Users browsing this forum: No registered users and 4 guests