- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I am using PSOC5. I have to configure I/O during runtime as plain I/O or SPI interface depending on a message send to PSOC by USB.
How can I reconfigure I/O during runtime ?
I have to configure some I/O s as SPI (in one case) or as in- or output in the other case.
Solved! Go to Solution.
- Labels:
-
PSoC 5 Device Programming
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RuGl,
Yes. It is possible.
See my previous post to you about the IO drive mode configuring. How to configure direction of I/O during runtime
This post will discuss flipping between directIO and SPI functions.
This is best achieved with making a TopDesign schematic at design-time.
I don't know your full design intent so here is an example to start you off:
This is a modification of the circuit I listed in your other posting about drive mode for IOs.
If this is your design intent, then you can set the IO drive mode and SPI MOSI and MISO routing with ONE bit in CR_OE_ctrl.
If this is not your intent, can you be more specific of the relationship of the SPI comm and the drive mode switchable IO?
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RuGl,
Yes. It is possible.
See my previous post to you about the IO drive mode configuring. How to configure direction of I/O during runtime
This post will discuss flipping between directIO and SPI functions.
This is best achieved with making a TopDesign schematic at design-time.
I don't know your full design intent so here is an example to start you off:
This is a modification of the circuit I listed in your other posting about drive mode for IOs.
If this is your design intent, then you can set the IO drive mode and SPI MOSI and MISO routing with ONE bit in CR_OE_ctrl.
If this is not your intent, can you be more specific of the relationship of the SPI comm and the drive mode switchable IO?
Len
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
RuGl,
Before I forget, I have a Caveat section for my previous post.
If you are in the middle of a SPI communication session and you switch IO assignments, you WILL corrupt the outgoing and incoming SPI data. To avoid this, make sure the the SPI comm status is SPI_TX_DONE before you switch IO.
Len
"Engineering is an Art. The Art of Compromise."