- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I have an issue that has never appeared before. I am running PSOC creator 4.2 and Device is 5LP.
I have a switch to ground on pin 12.7
In the main loop the code reads the switch and stores into volatile uint8 "myID".
ie: myID = SW1_Read();
If I run with debugger the value changes between 0 and 1 shenw I change switch position.
When I program the code into the target, it reads the correct value on start but if I change the switch while it is running it does not update to new value.
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
I constructed a new board with only the PSU, micro and Hex switch and it works fine after programming and removal and reapplying power.
The original boards were potted with silicon compound, I suspect the compound has leached up into the switches and and pushed the contacts apart.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please confirm if your target has an pull-up resistor at the pin 12.7 or the pin component is configured as "Resistive pull up" drive mode.
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, I have pull up resistor enabled on input and initial state = "1"
It works perfect when running on debugger but when I program the part it does not.
I have never had this issue with reading IO pins to date.
The micro restarts ok. I can get it to flash some leds on boot to make sure it is running. But does not read correct state of input pin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please add some delay prior to get the MyID like
CyDelay(1000);
myID = SW1_Read();
This solution is effective if the settling time of the input port is too long
Regards,
Noriaki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I cannot put a long delay before read because another device polls this one on power up (around 200ms after power up). It works on all previous versions of the project ok.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I constructed a new board with only the PSU, micro and Hex switch and it works fine after programming and removal and reapplying power.
The original boards were potted with silicon compound, I suspect the compound has leached up into the switches and and pushed the contacts apart.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
DaHu,
Try another pin for testing purpose. It may happen that pin is blown already if it accidentally was set to "strong drive" or "open drain drive high" mode.
/odissey1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The problem seems to occur after power up of hardware.
If the hardware is already powered and I re-program it, the input works ok.
If I switch power off and back on and then program the hardware, it does NOT work. The switch gets read on power up and sets ID but I cannot change the ID by changing switch position.
If I run in debug mode then I can change channel ok, system reads switch fine.
This occurs even if I add 1000 ms delay before switch read.