PSoC Creator 3.0 SP1 - Altered Output Pin Component Behaviour with PSoC 4

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MoCh_295286
Level 1
Level 1
        Has anyone else recently upgraded and noticed differences?   
0 Likes
3 Replies
MoCh_295286
Level 1
Level 1
        I've noticed that turning an LED on the PSoC 4 Pioneer Kit now uses a RED_LED_Write(1) to turn on now. Also I've noticed that RED_LED_Write(~RED_LED_Read()) no longer works. This behaviour does not carry across to all pins. It only seems to affect the 3 LED pins P1.6, P0.2 and P0.3.   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Can it be that you used a PSoC4 Prototyping Kit CY8C-049... ? On that board the LED is connected to ground while in Pioneer the LED is connected to VCC.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

The issue is a change in how PSoC Creator is handling a HW pin that is tied to a constant zero.  Previously Creator would automatically convert an output pin that is connected to a constant 0 into a software controlled pin with an initial value of 0. The hardware configuration of the LED on the board is such that driving a 0 will light the LED, so a Write(0) lights the LED.

   

With PSoC Creator 3.0 SP1, this automatic conversion is no longer done.  That is because that automatic conversion causes some other use cases to not work. With 3.0 SP1 the pin remains a hardware pin with a logic 0 routed to the pin and driven out. With that configuration the Write() function (and the hardware handling of the DR register) controls the output enable for the pin (1 to drive and 0 to float).  That means that with your configuration Write(0) causes the pin to float and the LED to go off, Write(1) causes the pin to drive the constant 0 which lights the LED. It has a similar impact to the code that attempts to toggle the pin, Write(~Read()).  If the pin is currently driving it will read as a 0, which when inverted is a 1 which causes it to continue to drive.

   

If you want the previous functionality you should convert the design to use a software pin: Delete the Logic 0 and using the pin customizer uncheck the HW Connection checkbox.  Then it will work exactly as before. That configuration will work in any version of Creator.

0 Likes