2015-01-23 05:21 AM
Hello All,
I am new user for SPC series MCU and SPC5Studio as well. I am trying to start with few example codes to understand the HAL, PAL implementations. I am trying to go through different posts on this forum to understand the way people are accessing the features. But somehow I am find it very very difficult to locate the resources - be it a sample code or a file reference or even a document reference. E.g A post below mentions about document sections,You can use External INTERRUPT In SIUL
chapter 48
and the convenient EIRQ[X]
chapter 48.4
you should use vector41 , vector42, vector 43 or vector 44
41 0x0290 16 SIU External IRQ_0 SIUL
42 0x02A0 16 SIU External IRQ_1 SIUL
43 0x02B0 16 SIU External IRQ_2 SIUL
44 0x02C0 16 SIU External IRQ_3 SIUL
2) for mapping you should use IO Settings and set your good port/function in the good mode
chap 4
from the convenient table ''function summary''
I tried referring to the reference manual for SPC560 series (RefManual_CD00259063.pdf) to locate these sections but could not find. Is there any other document/manual that mentions all this information? I tried searching SPC5Studio help as well.I beg your pardon for asking such simple questions through different posts but if you can provide the details, it will help me move further. Thanks for all your help.Mike.2015-01-27 01:38 AM
DIGITAL INPUT
2) Define your vector41 handler (cf table123 for SPC56DXX) everytime , you have to read the status bits and clear the read status bits ;)/* with a wire : plug the PA[11] (BUTTON) with PA[3] (IRQ #0) */
#define BUTTON1 vector41
OSAL_IRQ_HANDLER(BUTTON1){
uint32_t sr0;
OSAL_IRQ_PROLOGUE();
/* Reading status bits.*/
sr0 = SIU.ISR.R;
/* Clearing read status bits.*/
SIU.ISR.R = sr0;
palTogglePad(PORT_C,PC_LED7);
//LED is connected to +3,3V
OSAL_IRQ_EPILOGUE();
}
3) in main : 2 events possible Rising or Falling /* Interrupts are enabled and the system is ready.*/
osalIsrEnable();
/* Enable Vector Interruption SIU External IRQ_0 */
/* Cf Table 123 */
osalIsrEnableVector(41,7);
/* Activate Rising Edge Events */
SIU.IREER.B.IREE0=1;
/* Enable EIRQ #0 */
SIU.IRER.B.IRE0=1;
Your application is READY to use EIRQ #0;-) Best regards Erwan
________________
Attachments : SPC560Dxx_OS-Less_EIRQ_Test_Application_for_Discovery.zip : https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006qVT2&d=%2Fa%2F0X0000000bnw%2Fh8UWHTn78RGZHKkbeZcPgL90viNti8bHReTEMhh7CFY&asPdf=false
2015-01-28 06:00 AM
Thanks for the example for ext interrupt. I tried understanding the int handler from few posts on this forum.
It would be great help if you can provide the details for the documents highlightedyellow
in below para. Is it reference manual for SPC560 series (CD00259063.pdf)? This para is from one of the posts - ''Problem with external interrupt''You can use External INTERRUPT In SIUL
chapter 48
and the convenient EIRQ[X]
chapter 48.4
2) for mapping you should use IO Settings and set your good port/function in the good mode
chap 4
from the convenient table ''function summary''
Thanks in advance.Mike.2015-01-30 02:18 AM
Hello Mike ,
The RM for CD00259063.Useful chapter is 17.6Same Vector IRQ Number used (41,42,43)and the chapter 23.6.3 for a full description of External Interrupt ControllerEIRQ0-EIRQ23 Best Regards Erwan