about Xgate - S12XDP512

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

about Xgate - S12XDP512

3,008 Views
vinay
Contributor I
Hi,
 
I am using S12XDP512 with Code warrior 4.5. i am working on a project where i am going to use following tasks using microcontrollers resourses.
1) calculating RPM using Capture methode using ECT.
2) SCI communication through PC for sharing data.
3) one XIRQ interrupt for detecting external pulse (pulses vary from 0.25 to 6.25 msec)
4) one  PIT Timer interrupt  for Time out Period. and one PIT timer (non interrupt)  for some logic    development
5)5 ADC analog channel for sensing  analog value of external pins
6)3 Outputs Through I/O pins 
 
            above mentioned resourses are used by me in this project now i want to know that which
resourses are implement through xgate and which implement by normal CPU by me? i gate little bit confuse. willl you please tell me which is better resourse to implement through xgate?
            OR in general which resourses are normally used when we are going to use xgate functionalty.
 


Message Edited by NLFSJ on 2008-01-14 04:11 PM
Labels (1)
0 Kudos
5 Replies

622 Views
Steve
NXP Employee
NXP Employee
vinay you can use either the CPU or the XGATE for all of those except item 3) because the XIRQ goes directly to the CPU.
The choice of which core to use depends on your software requirements. If the CPU is heavily loaded doing some complex algorithm then you probably want to use XGATE to handle the interrupts so that they don't go to the CPU. You can use the XGATE as:
a/ A DMA moving data from I/O or peripherals to RAM and vice versa
b/ A preprocessor for interrupts that (for example) filters ATD results before the CPU uses them
c/ A programmable machine that can create a "virtual peripheral" where the real one doesn't exist. For example, with your SCI you can write code that makes it look as if the S12X has a buffered SCI that can handle whole messages instead of just one byte at a time.
If you are writing in C you can create all of the interrupts on the CPU as normal and then move one or more onto the XGATE by simply copying the code and changing the interrupt configuration so that XGATE gets the interrupt rather than the CPU.
Ultimately, the structure is up to you. Read AN2615 and AN3144 for the overview and practical steps.
0 Kudos

622 Views
vinay
Contributor I
Thanks Steve...
                                I have one more question. in my program i make three file with there header files including main.c and xgate file. like, a.c,a.h,b.c,b.h,c.c,c.h,main.c and xgate.cxgate. now i facing problem is that i declare two function in b.h and define in b.c.now insted of two, the no one function i am using in c.c file and one in xgate.cxgate file.i am getting linker error like _x_symbol_(function name)  undefined.
now this same funcion i am using in a.c file insted of xgate it compiles and linked also.
                                  so my question is that while accessing a function in xgate file,it should be written  in xgate.cxgate file???? hope u understand my query. 
0 Kudos

622 Views
Steve
NXP Employee
NXP Employee
What kef says is correct, a "call" to an XGATE function from a CPU function is not allowed. Actually it's not a useful thing to do either.
Think about XGATE as a separate CPU which can run at exactly the same time as the CPU and be doing something useful even when the CPU is busy.
To make an XGATE function active you have to send an interrupt to the XGATE. You can send an interrupt from a peripheral or from the CPU by using the XGATE software interrupts. To see examples of both of these look at the application notes I referred to earlier or create a new project in CodeWarrior which shows you how to activate using a software interrupt.
To send data to and from the XGATE use the RAM by declaring a variable and using that in functions on the CPU and on the XGATE. Again this is shown in the app note.
0 Kudos

622 Views
sainath
Contributor I
hai evey1,
 
       i am very new to this sort of discussion forms on technical aspects
I am very interested to work on micro controllers and related stuff. I am planning to start off working independently on microcontrollers...
What are the tools that i need to gather before starting like the things neccessary for coding compiling and flashing and where can i get them from.
Currently I am working in Visteon India it is an electronic products suppliers for automotives
please help me to put my interest into practice...
0 Kudos

622 Views
kef
Specialist I
In CW, *.cxgate files are compiled for XGATE CPU. And *.c files are compiled for S12X CPU. No XGATE routine can be called from S12X, and no S12X routine can be called from XGATE. That's why, probably, XGATE compiler adds __X_ to every XGATE function, to prevent pointless linking between XGATE and S12X functions. You may use XGATE semaphores, variables and software triggers to communicate between two CPUs. Software trigger may be set from either CPU, and another CPU may be programmed to interrupt on specific software trigger...
 
0 Kudos