- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What is the advantage of using Control Register to control a pin High / LOW state instead of simply Pin_Write ? (PSoC 5lp)
Thanks !
Peter
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
Peter,
As-is, using Control register will be faster. On the other side the pin can be written directly in a single clock as well, like
Testpin_DR = 1 << Testpin_SHIFT;
Testpin_DR = 0 << Testpin_SHIFT;
You may check some old posts on that
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Peter,
In simple cases, like having a single pin, there is not much difference. Control Register can help when several non-continuous pins must be written (e.g. from different ports).
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear odissey1,
thanks for your lightning fast reply !
I'm using it for firmware controlled SPIM (SPI Master) Slave Select pin.
Background: I've used both simple Pin_Write () and ControlRegister = 0 / 1 in the past several times -but SPI is more time sensitive..
Is there any , e.g. speed advantage of ControlRegister over Pin_Write () in such a single pin / non bus pins situtation like SPIM SS pin toggling?
Thanks in advance,
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Peter,
As-is, using Control register will be faster. On the other side the pin can be written directly in a single clock as well, like
Testpin_DR = 1 << Testpin_SHIFT;
Testpin_DR = 0 << Testpin_SHIFT;
You may check some old posts on that
/odissey1