Interrupt handling is done quite easy in the PSoC world:
Drop an isr-component and connect it to the interrupt signal. Ude declarations as
CY_ISR_PROTO(MyHandler); // Prototype declaration
// Clear source of interrupt (Check UART state, read off character)
I prefer not to make changes in the generated files although there are clearly marked places where I might do so. But a switch to a different device might spoil my changes.
Your quest for constantly monitoring a signal and reacting on a initial marker is not as easy. You may watch your line with some additional logic (Timer / Counter) and ignore all UART-Rx inputs until initial marker found.
I was trying to play with code in the created "c" and "h" files and then realised it is easy to set up a isr handler in main.c and simply declare the vector to it and away we go. This technology is real "cool" compared the the bits and bytes and poking around I have been doing with PIC micros. It is great that much of what I want to do is handled by API and I don't have to dig down into registeres.
I do have one other question for you. I was looking for a one-wire component for reading DS1820 Temperature sensors and managed to get a copy of a project from Victor which has a component in a catalog (not the main catalog) of his project.
How can I get the catalog containing the 1-Wire component into the "Cypress" catalog (his is named "default" and appears as another Tab". I want to be able to create a new project and use that component.
Because with every new version of Creator the cataög gets updated I would suggest to do as following:
Create a folder that contains all your own or foreign created components.
When a project needs one of those, import it.
To maintain the folder the component gets inserted in, have a look into your "Component Author guide" that came with the Creator- installation
By the way, there is a saying "Thinking PSoC" which tries to explain that there is a huge difference between designing with PSoCs and other embedded micros (PICs for instance)
Thanks again for the help Bob, I appreciate you taking the time to consider my questions and answer them.
I did as you said and managed to import Victor's 1-wire component and realize it will need some "porting" to 5LP as it references <devices.h> (which does not seem to be used by 5LP?) and the syntax for setting and clearing digital pins is different. I played arounbd and found how to edit the component but there are quite a few changes needed.
Last night I had a play and started getting simple things like interrupt driven timer and buttons, Leds and LCD etc running ok.
I still have a bit of black area when it comes to the UART as you can attach an ISR to it but it also has an RX interrupt feature. I am not sure if I need to attach the isr component each time and write a handler in code for isr or whether I can access the RX interrupt directly. I attempted putting code in the the rxint.c that was created but kept having issues with scope of variables.
Next, I will watch the videos dealing with the catalog and learn how to write my own component.
I see that if you try to alter the files created after a compile they will be written over next time you compile (which is an excellent feature as it keeps your components safe and resuable) .
In the meantime (before i have learned how to write my own components), can I simply write a "c" and "h" file and "#include" it to my project in "main.c" and it will be complied ok like a traditional compiler process?
I agree with your comment regarding PSOC thinking. I must stop thinking in terms of traditional microcontroller and registers and think in terms of re-routable resources , API's and resuable components. It is hard to "let go" and trust the creator to implement the underlying processes, but I LOVE it! I don't know why I have not been exposed to this technology previously?
The process of creating your own component can turn out to be something time-consuming at the first try. There can be a lot to learn since a PSoC's capabilities do not end at the wiring of some 100 pre-defined components. A PSoC5 contains 24 "Universal Building Blocks" (UDBs) which you can program using a "Hardware Description Language" (HDL). Every UDB contains an "Arethmetic and Logical Unit" (ALU) that can be programmed to perform some operations, two "First-In-First-Out" (FIFOs) and a bunch of logic. I can assure you that it is not done just by learning the abbreviations.
When I first got in contact with PSoCs I started learning to use all the components by reading (and understanding, which sometimes is not as easy) the datasheets and by getting them to work.
So take your time.