Re:Hardware and software Configurations ADC_004 App and IO004 APP

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Not applicable
Hi ,i am bit confused with the ADC_004 and IO004 Apps hardware and software connectivity ,
,As per my application i am interfacing current transformer to ADC channel ,Supposed to use 8-bit ADC ,and reference voltage is upper voltage range of controller ,i am using XMC1100 ARDUNIO board ,Based on the value given by ADC i supposed to on Relays,i am Keeping some voltage value as reference eg:2V ,if reference voltage is less than <2V Relay1 should be on,If reference voltage>2V Relay2 should on.please suggest me what are the Required configurations i supposed to do for ADC_004 &IO004
i have read the Help contents little confusion is the is please suggest me.pins as per datasheet i am using P0.4 GPIO for relay1,P0.12 ,GPIOP fo r relay2, P2.6 AA for ADC Channel.please suggest me.




Thanks&Regards
Prathibha
0 Likes
17 Replies
Not applicable
What is your question?
0 Likes
Not applicable
Hi Prathibha,

ADC004 App consumes IO001 App which is used by a top level App (in this case is ADC004) to configure a pin in Analog mode. You can select the ADC channel you required here (refer to ADC004_Example1_XMC11 for the configuration).
IO004 App can be used as a standalone App to consume a digital pin as a GPIO. You can use it to configure the GPIOs to control the relays. There are some examples using IO004 eg. ERU001_ERU002_Example1_XMC11.

BR,
Zain
0 Likes
lock attach
Attachments are accessible only for community members.
Not applicable
Hi
I am working on xmc1200 evolution board,ADC001 app i am using ,Reference voltage of ADC is 5v.12-bit ADC I am using
As i am trying to on/off Relays based on ADC voltage value i am using threshold value 1.26V(1032) if count,if(count<1032) relay1 is to be on,Relay2 to be off ,and count if >1032 Relay2 be to on and relay1 to be off.when i am using the this function in interrupt service routine(ISR) its working well but the same function when i am using in main while() loop its not on/off the relays based on threshold voltage,Defaultly Both the relays are on,ADC clock i have set for 125KHz.please suggest me how i can make to run relays in main while() loop,instead of ISR.please find the attachment,Kindly suggest me how i can on/off relays in main while() loop.
0 Likes
Not applicable
Kindly please help me to solve the issue
0 Likes
Not applicable
Hi,

You may try to avoid Global Result Event Interrupt generation by unchecking the "Enable interrupt at initialization" in "Interrupt Node Configuration" tab (NVIC002 App). At the same time, place the "ADC001_GetResult(&ADC001_Handle0,&Result);" in the main.c as well.

BR,
Zain
0 Likes
Not applicable
Thank you Zain for your response,kindly let me know how i can add 1 or 2 sec delay between 1st condition and 2nd condition i.e is relay1 on and relay2off(1st condition)delay between (2nd condition)i.e is Relay1 off and Relay2 on.how i can provide delay of 1 or 2 sec in between two conditions.


Thanks&Regards
Prathibha
0 Likes
Not applicable
Hi Prathibha,

The simplest way is to use SysTick by calling "SysTick_Config()". It is used in "IO003_Example1" to control the toggling of the port pin.

BR,
Zain
0 Likes
lock attach
Attachments are accessible only for community members.
Not applicable
Hi I am working on xmc1200 evolution board ,As per the requirement of my project,230v universal Motor connected as Load to the current transformer,where current transformer is connected to 1 of ADC channel of controller pin,Based on this adc voltage i kept threshold voltage as 2V,if<2V means no load condition(Motor runs at 100v) ,>2v means load condition(Motor runs at230V)
,now need to provide1sec delay when switching from noload condition to load condition,for this i developed code ,but output is coming as suddenly on /off of relays happening,i am not getting output as expected,kindly suggest me is their anything to add to this code,or change configurations,kindly find the attachment.

code details:I am calling Load event function and Get Result function inside while(1) loop,
Tried different approches:1)ADC APP inside the ISR i moved if-else part it was working fine ,but cannot add delay inside ISR so i went for other approach
2)in this i Declared a global variable ,Result variable to the global varaible if-else part i moved to while(1) Loop,output is coming as ADC voltage varying but Relays are not responding as per the threshold voltage,,for any value of ADC voltage Both relays are on.
Kindly suggest me how can i run the relays based on threshold voltage ,and how can i solve oftenly on/off relays problem.


Thanks&Regards
PC
0 Likes
Funmix
Employee
Employee
5 sign-ins 25 replies posted 10 replies posted
prathibha wrote:
Hi I am working on xmc1200 evolution board ,As per the requirement of my project,230v universal Motor connected as Load to the current transformer,where current transformer is connected to 1 of ADC channel of controller pin,Based on this adc voltage i kept threshold voltage as 2V,if<2V means no load condition(Motor runs at 100v) ,>2v means load condition(Motor runs at230V)
,now need to provide1sec delay when switching from noload condition to load condition,for this i developed code ,but output is coming as suddenly on /off of relays happening,i am not getting output as expected,kindly suggest me is their anything to add to this code,or change configurations,kindly find the attachment.

code details:I am calling Load event function and Get Result function inside while(1) loop,
Tried different approches:1)ADC APP inside the ISR i moved if-else part it was working fine ,but cannot add delay inside ISR so i went for other approach
2)in this i Declared a global variable ,Result variable to the global varaible if-else part i moved to while(1) Loop,output is coming as ADC voltage varying but Relays are not responding as per the threshold voltage,,for any value of ADC voltage Both relays are on.
Kindly suggest me how can i run the relays based on threshold voltage ,and how can i solve oftenly on/off relays problem.


Thanks&Regards
PC


Hi Prathibha,

I am confused with your statement. Could you please specifically explain to me what do you need in the end? Perhaps provide some of the system diagram/ timing diagram/ software flowchart would help us understand more details. To development a project application, I would recommend you go step by step for functional test/verification.
0 Likes
lock attach
Attachments are accessible only for community members.
Not applicable
Thank you Funmix,for your reply ,kindly find the circuit details,and code developed for it,Kindly suggest me


Thanks&Regards
PC
0 Likes
Not applicable
Thank you Funmix for your reply ,kindly find the circuit Details and related code for it ,Kindly suggest me


Thanks&Regards
PC
0 Likes
Funmix
Employee
Employee
5 sign-ins 25 replies posted 10 replies posted
prathibha wrote:
Thank you Funmix for your reply ,kindly find the circuit Details and related code for it ,Kindly suggest me


Thanks&Regards
PC


Hi Prathibha,

Please provide flow chart of your SW. What do you plan to do in your SW flow? It would help us to support straight to the point.
0 Likes
Not applicable
Thank you Funmix,

Hi ,i am trying to run the universal motor with relays,my condition is when we run mixer grinder without load(means without jar) Motor has to run at100v for this i am using Relay1,with load(with jar),making motor to run at230v,for this i am using relay2,now load and no load condition which is decided by output given by current transformer since Motor connected to current transformer,The output of current transformer is given to one of the ADC channel,

Problem:Their is sudden rise in current transformer so motor running at 100V some times ,230 some times,How can i stabilize to work as per requirement
Kindly help me to solve this since long many days i am trying to solve kindly help me
0 Likes
Funmix
Employee
Employee
5 sign-ins 25 replies posted 10 replies posted
prathibha wrote:
Thank you Funmix,

Hi ,i am trying to run the universal motor with relays,my condition is when we run mixer grinder without load(means without jar) Motor has to run at100v for this i am using Relay1,with load(with jar),making motor to run at230v,for this i am using relay2,now load and no load condition which is decided by output given by current transformer since Motor connected to current transformer,The output of current transformer is given to one of the ADC channel,

Problem:Their is sudden rise in current transformer so motor running at 100V some times ,230 some times,How can i stabilize to work as per requirement
Kindly help me to solve this since long many days i am trying to solve kindly help me


1. Can you post the sudden rise of current transformer waveform? Please provide level, rising and failing period info with picture. I assume your relay control has no issue. In short, you just need to have "method" to avoid the sudden rise going into ADC pin.
0 Likes
Not applicable
Thank you Funmix for your kindly reply,Exactly what your telling that is happening,kindly suggest method(coding)to avoid the sudden rise going into ADC pin.Since many days i am trying to do but not able to make it,kindly suggest me how to map my project.its quite critical time for me kindly help me.



Thanks&Regards
PC
0 Likes
Funmix
Employee
Employee
5 sign-ins 25 replies posted 10 replies posted
prathibha wrote:
Thank you Funmix for your kindly reply,Exactly what your telling that is happening,kindly suggest method(coding)to avoid the sudden rise going into ADC pin.Since many days i am trying to do but not able to make it,kindly suggest me how to map my project.its quite critical time for me kindly help me.



Thanks&Regards
PC


Hi Prathibha,

It's difficult for us to analyze your problem without knowing your rising timing. Anyway, if you want to avoid such sudden "surge" during start-up, I suggest you take a look of XMC13 upper limit boundary checking features. By defining condition checking in your software, you should be able to ignore the rise current.

This is the code for setting the upper limit in my project:



/* Set limit global boundary to 0.325V */
VADC_G0->BOUND|= (0x0193 << VADC_GLOBBOUND_BOUNDARY1_Pos);

/* Select upper boundary limit */
VADC_G0->CHCTR[0] |= ((0x01 << VADC_G_CHCTR_BNDSELU_Pos) | (0x02 << VADC_G_CHCTR_CHEVMODE_Pos));

// enable channel interrupt
NVIC_EnableIRQ(VADC0_G0_0_IRQn);

0 Likes
lock attach
Attachments are accessible only for community members.
Not applicable
Thank you Funmix for your reply,

As i am trying with taking average of 50 samples and do comparison but i am strucked with the interrupt enabling and disabling part,Kindly check my code and suggest me.
0 Likes