Another problem I have is that I cannot place a hardware breakpoint on the interrupt file.
I am using the USB debugger on the PSoC 4 Pioneer but I have also tried my miniprog3. Both just won't place a hardware breakpoint on the ISR. It offers to replace them with software ones but they don't break..
This is with no other breakpoints on the project
I do nto see where you issued a -
Thanks for the reply
You are right I missed that off, but I have since added it and now I can put breakpoints on the ISR.
However the ISR is still not firing or changing the flag. :(
You misunderstood how the interrupts work. Fot the UA<Rt the interrupt is a pure signal to which you connect an interrupt handler as you did. This module has to be initializes preferrably with isr_StartEX(YourHandler).
Declare and define the handler with
// Check UART Status
// Remove cause of interrupt (Reading received Bytes until FIFO empty
Bob, why can't he use the place holder ISR function tool generates ? Where
he set the flag......
I am not sure how to do what Bob has suggested
But I have now added the volatile keyword on both the main.c and on the interrupt "extern uint8 volatile flag"
I've attched the updated code again but it is only this keyword which has changed.
The code inside the "if(flag == 1)" loop never gets called.
The new bundle you posted just has timer based projects in it,
not UART we were working on ?
He CAN use it when using it correctly. He had an ist component dropped onto the schematic which he did not use and an interrupt handler within the component he did not use neither because the interrupt was not explicitely enabled.
So I pointed out the usual working approach that always leads to success by using the isr_StartEx() and CY_INT().
Lookup "CY_ISR" keyword in the "System Reference Guide" (from Help-Menu) and check the APIs in the isr-datasheet.
On the schematic he dropped ISR component named UART_RX_FULL, and in the
UART_RX_FULL.c file generated by tool is a placeholder where he added the flag = 1; statement -
/* Place your Interrupt code here. */
/* `#START UART_RX_FULL_Interrupt` */
flag = 1;
/* `#END` */
And then enabled it in main (globals enabled as well).
So what is wrong with this ? What am I missing ?
He had enabled it in main() after I indicated he should do so.
I did not have the latest workspace bundle. So latest update's interrupt should work
in the interrupt routine the cause of interrupt is not removed, ie the character is not red off.
in main() any characters are continously red, so interrupts may not happen.
I would suggest to
read the UART Rx-status within the interrupt routine to clear sticky status-bits
read the character within the interrupt routine to a global char when status indicated fifo not full
Sorry about the delay, Thanks for all the help by the way
I have tried to read the status as you suggested but I am not sure I am using the right command, anyway the code still never gets into the flag bit so the flag isn't being set.
I have attached the up to date workspace bundle, I don't know what happened with the last one.