hallo !
Servus!
i want to change the GPIO state , namly pin direction and the pin values afterwards in a External Iinterrupt program .
but i found it's strange,
1. if i debug the program step by step , it works perfectly.
2. but when i let it run. the values that i catch in Expessions are wrong.
did anyone know why? how could i solve it?
interrupt void xint2_isr(void) { // enter the communication program accroding to the FPGA_CLK //////////////// state 0///////////////////////// if(state_flag == 0) // state 1 default { GpioDataRegs.GPBTOGGLE.bit.GPIO34 = 1; io_dir = 0; // GPIO as Output Gpio_Select(); GpioDataRegs.GPACLEAR.bit.GPIO3 = 1; state_flag =1; } //////////////// state 1///////////////////////// if(state_flag == 1 ) // state 1 default { Get_DATA(); // this is the function that i used to get the DATA GpioDataRegs.GPASET.bit.GPIO3 = 1; state_flag =2; } .......... PieCtrlRegs.PIEACK.all = PIEACK_GROUP1; //clear the irq-flag } void Get_DATA(void) { GpioDataRegs.GPADAT.bit.GPIO31 = 1; GpioDataRegs.GPADAT.bit.GPIO29 = 0; GpioDataRegs.GPADAT.bit.GPIO23 = 1; GpioDataRegs.GPADAT.bit.GPIO21 = 0; GpioDataRegs.GPADAT.bit.GPIO19 = 1; GpioDataRegs.GPADAT.bit.GPIO17 = 0; GpioDataRegs.GPADAT.bit.GPIO27 = 1; GpioDataRegs.GPADAT.bit.GPIO25 = 0; GpioDataRegs.GPCDAT.bit.GPIO85 = 1; GpioDataRegs.GPBDAT.bit.GPIO49 = 0; GpioDataRegs.GPADAT.bit.GPIO11 = 1; GpioDataRegs.GPADAT.bit.GPIO9 = 0; GpioDataRegs.GPADAT.bit.GPIO7 = 1; }
thanks a lot! guys!