- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have 8 digital outputs that are on various pins of the 5LP that I want to control as a port using an 8-bit variable in code.
I created a digital output pin then then set number of pins to 8. I named the port "POWER"
Next I selected "Display as Bus" mapping.
Then I went to "pins" tab and set the pin designation.
I am having trouble setting the value of "PORT" in code.
The intellisense in PSOC creator shows "POWER_0, POWER_1 etc but I cannot work out correct syntax to do equivalent of POWER_Write(23) for instance.
Have I set this up wrong or simply not using corect syntax?
Thanks
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello DaHu.
The example by Moto is perfect when you have an entire 8-bit port available.
When you have random GPIO's from several ports, you can use the Control_Reg component. Now you can connect just about any GPIO output pin to the Control Reg output signal.
To write to this component is very simple.
Control_Reg_1_Write(i); /* where i is uint8 */
This is not a bidirectional solution. It is for writing only to the GPIO's.
Good luck with your project.