Home PSoC 1 KB Articles
PSoC1 Knowledge Base Articles

Pull Up on SCL and SDA

E-mail Print PDF
( 5 Votes )
Question: I have the PSoC operating as an I2C Slave (or Master) with a VDD of 3.3V.  It is connected to an external I2C Master (or Slave) operating at 5V.  Which voltage should the Pull Up resistors on the SCL and SDA lines be connected?

Answer: Preferably, the pull up resistors should be connected to 3.3V.  This will ensure that the PSoC's GPIOs operate at the same voltage as that of VDD.

The pull up resistors can also be connected to the 5V.  Under this condition, the internal clamping diodes (refer GPIO cell diagram below) in the GPIO of the PSoC will limit the voltage on the SDA and SCL lines to (3.3V + Diode Voltage).  The pull up resistors will also act as current limits which will limit the current through the clamping diodes.  Design the Pull up resistors in such a way that the current through the internal clamping diodes is less than 5mA.  This is applicable only when the SDA and SCL lines of the other I2C device are also configured as Open Drain mode.


 

Warning - UART should not be used in the CY8C24x94 devices without connection to the USB bus

E-mail Print PDF
( 0 Votes )
Question: When using UART on CY8C24x94, following DRC warning is generated:

“UART should not be used in the CY8C24x94 devices without connection to the USB bus”.

Why is this error generated? What should I do if I do not need to connect to the USB bus?

Answer: For a UART to work, the error on the clock should be <4%. Both the receiver and transmitter contribute to this error and hence, the clock on the PSoC should not exceed 2% tolerance.  Generally, PSoC devices have an IMO with a tolerance of 2.5%.  But for the CY8C24x94 device, the tolerance is 4%.  So, if the UART clock on the other end of PSoC also has some error, there will be communication errors.  When the USB is used, the IMO is synced with the USB bus clock and becomes very accurate and will prevent any UART errors.  The warning is generated to inform this condition.  There are a few options to follow under this situation.

1. Use an accurate External clock with a tolerance of <2% on P1.4 for the SysClk

2. If the device at the other end of the UART is driven by a crystal osciallator and does not contribute to the error budget, PSoC can use the 4% error budget and you may not have any problem in the communication. But this is still not a recommended solution.

3. Send only 4 bits at a time on the UART.  As the clock tolerance affects only the bits farthest from the start bit, transmitting only 4 bits at a time will prevent bit errors.  The first 4 bits of a UART frame should be the data bits and the next 4 bits should 1's.  So, to send 0x59, you would send 0xF5 first and 0xF9 next.

4. If you are not planning to use the USB, then consider using other family of PSoC devices that have 2.5% tolerance on the IMO.  You could try the CY8C27x43 or the CY8C29x66 families/

All things said, the PSoC IMO is trimmed using a trim register in the boot.asm file.  This will increase the accuracy of the clock to atleast <2%.
  So, if the PSoC is operating under very normal temperature conditions, you may not get any error at all.  But this approach is definitely risky.

 

Analog Power Parameter in PSoC1 Global Resources

E-mail Print PDF
( 2 Votes )
Question: What is the significance of the Analog Power parameter in the Global Resources?  What are the guidelines to select the correct setting?

Answer: The Analog Power parameter sets the power at which the internal reference generator operates and also sets the power to the SC blocks of the device.  Below is the excerpt from the Technical Reference Manual from the Analog reference section.

The reference array supplies voltage to all blocks and current to the Switched Capacitor blocks. At higher block clock rates, there is increased reference current demand; the reference power should be set equal to the highest power level of the analog blocks used.

So, for example, if you have a PGA operating at Medium power and another Comparator operating at High Power, the Reference power should be set to Ref High.  Also, if you have any analog resource that occupies an SC Block (like ADC, DAC, Filters etc), the Reference power should be set to "SC On / Ref xxx".  If the reference is set to "SC Off / Ref xxx", the analog resources placed in the SC Blocks will not work.
Tags: PSoC1 Analog
 

Placing a Constant Variable or Function in an Absolute Flash Address

E-mail Print PDF
( 0 Votes )
Questions:
1. I would like to place a constant variable in an absolute address in Flash.  I will place information like version and serial number in this absolute address. How do I do this?
2. I would like to place a function in an absolute address in Flash.  How do I do this?

Answer:  You can place either a constant variable or a function in absolute address in flash using the #pragma abs_address directive.

For example, to place constant variables in absolute address 0x3FC0:
#pragma abs_address 0x3FC0
const BYTE Version = 0x01;  // This byte is placed in address 0x3FC0
const char SerialNumber[] = "1234567890";  // This string is placed from address 0x3FC1
#pragma end_abs_address

To place a function "MyFunction" at address 0x1000, the same approach may be used.
#pragma abs_address 0x1000
void MyFunction(void)
{
    // Function code here
}
#pragma end_abs_address
 

Placing RAM Variable in an Absolute Address

E-mail Print PDF
( 1 Vote )
Question: How do I place a RAM variable in an absolute RAM address?

Answer: A RAM variable may be placed in an absolute RAM address using three methods.

Option-A: Using the #pragma directive

Let us say, we need to allocate a variable ‘myByte’ at an address 0x78 in RAM and another variable ‘myByte1’ at address 0x104 , then the process would be:
Read more...
 
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  3 
  •  4 
  •  5 
  •  6 
  •  7 
  •  8 
  •  9 
  •  Next 
  •  End 
  • »


Page 1 of 9