PSOC

Thread Starter

Pawel19

Joined Sep 1, 2012
25
Why don't people use these chips more often? They seem pretty amazing. I've seen people complain about the price, but for $3-$10 it doesn't seem bad...
 

Thread Starter

Pawel19

Joined Sep 1, 2012
25
The documentation and lack of information on the PSOC is confusing to me. Is it basically a reprogrammable microcontroller?
 

BMorse

Joined Sep 26, 2009
2,675
from what I have been able to deduce (although I have not looked into it much) it is a programmable embedded system-on-chip integrating configurable analog and digital peripheral functions, memory and a microcontroller on a single chip.

the one I have has the following:
Up to 24 MHz, 4 MIPS
Flash 4 KB to 32 KB
SRAM 256B to 2 KB
Operation 1.7V to 5.25V

1 Delta-Sigma ADC (6 to 14-bit)
131 ksps @ 8-bit
Voltage Precision ±1.53%
Up to 2 DACs (6- to 8-bit)

Active: 2 mA, Sleep: 3 μA
FS USB 2.0, I2C, SPI, UART, LIN
Requires ICE Cube and FlexPods
Up to 64 I/O
 

Shirin Srf

Joined Jun 11, 2015
5
hi i'm using PSoC 1 for my MSc project and i'm not familiar with this at all. i need to use it as a counter to convert pulses(1ms) to frequency. dose anyone have an idea about how can i use it???
 

Shirin Srf

Joined Jun 11, 2015
5
from what I have been able to deduce (although I have not looked into it much) it is a programmable embedded system-on-chip integrating configurable analog and digital peripheral functions, memory and a microcontroller on a single chip.

the one I have has the following:
Up to 24 MHz, 4 MIPS
Flash 4 KB to 32 KB
SRAM 256B to 2 KB
Operation 1.7V to 5.25V

1 Delta-Sigma ADC (6 to 14-bit)
131 ksps @ 8-bit
Voltage Precision ±1.53%
Up to 2 DACs (6- to 8-bit)

Active: 2 mA, Sleep: 3 μA
FS USB 2.0, I2C, SPI, UART, LIN
Requires ICE Cube and FlexPods
Up to 64 I/O
hi i'm using PSoC 1 for my MSc project and i'm not familiar with it at all. i need to use it as a counter to convert pulses(1ms) to frequency.i need guides about how to use it as a counter! plz
 

Papabravo

Joined Feb 24, 2006
21,226
Is 1 ms the width of the pulses or the repetition rate? Can you give us some examples of your input and the corresponding output?
P.S. -- You should have started a new thread rather than hijacking an old one.

Generally speaking you use the available hardware to measure a period and convert it to frequency by taking the reciprocal.
 

Shirin Srf

Joined Jun 11, 2015
5
Is 1 ms the width of the pulses or the repetition rate? Can you give us some examples of your input and the corresponding output?
P.S. -- You should have started a new thread rather than hijacking an old one.

Generally speaking you use the available hardware to measure a period and convert it to frequency by taking the reciprocal.
thanks for your reply , in puts are pulses of avalanche photo diode and at the out i need to calculate frequencies of these pulses, the duration is 1ms . thats y im using PSoC
 

Papabravo

Joined Feb 24, 2006
21,226
So the pulses are 1 ms wide and you need to compute the time between pulses. In the limit you could have a new pulse arrive every millisecond for a frequency of 1 kHz. Any slower arrival rate would result in a frequency between DC and 1 kHz. Look for some hardware in the PSOC referred to as "input capture". What this will do is "capture" the value of a free running timer of a known frequency. An incoming pulse triggers a capture and you save that number. You rearm the capture mechanism and wait for the next trigger pulse and that capture gives you the second number. Now if you subtract the first number you captured from the second number this will be the elapsed time in units of the basic "tick time" of the free running clock. The reciprocal of this number is the frequency of the pulse arrival.
For example:

If the free running clock is 25 kHz., and the first number you capture is 2,537 and the second number you capture is 13,744 you would do the following:
  1. Pulse Arrival Period = 13,744 ticks - 2,537 ticks = 11,207 ticks
  2. Tick Period = 1 / 25 kHz = 40 μsec = 40e-6 seconds
  3. Pulse Arrival Period (seconds) = 11,207 ticks * 40e-6 seconds/tick = 0.448280 seconds
  4. Pulse Frequency = 1 / .448280 ≈ 2.230 Hz.
Do you get the basic idea?
 

Shirin Srf

Joined Jun 11, 2015
5
So the pulses are 1 ms wide and you need to compute the time between pulses. In the limit you could have a new pulse arrive every millisecond for a frequency of 1 kHz. Any slower arrival rate would result in a frequency between DC and 1 kHz. Look for some hardware in the PSOC referred to as "input capture". What this will do is "capture" the value of a free running timer of a known frequency. An incoming pulse triggers a capture and you save that number. You rearm the capture mechanism and wait for the next trigger pulse and that capture gives you the second number. Now if you subtract the first number you captured from the second number this will be the elapsed time in units of the basic "tick time" of the free running clock. The reciprocal of this number is the frequency of the pulse arrival.
For example:

If the free running clock is 25 kHz., and the first number you capture is 2,537 and the second number you capture is 13,744 you would do the following:
  1. Pulse Arrival Period = 13,744 ticks - 2,537 ticks = 11,207 ticks
  2. Tick Period = 1 / 25 kHz = 40 μsec = 40e-6 seconds
  3. Pulse Arrival Period (seconds) = 11,207 ticks * 40e-6 seconds/tick = 0.448280 seconds
  4. Pulse Frequency = 1 / .448280 ≈ 2.230 Hz.
Do you get the basic idea?
yes i got it thanks , no i just have pulses and need to convert them to frequency so i was wondering how can i use counter(the pulses have different duration ex:1ms,2ms..) ? there is no example in this hardware which has used a counter.
 

Papabravo

Joined Feb 24, 2006
21,226
So if the pulses have different lengths then what you need is only slightly more complex. Let's say the pulses are positive, i.e. the voltage goes up on the leading edge and goes down on the trailing edge. Now you arm the capture mechanism and trigger on the first rising edge. Now you disable looking for rising edges and look for a falling edge. Once you see the falling edge you look for the next rising edge, which would be your third capture. Now you use the 1st and 3rd captures to compute the frequency, and you use the 1st and 2nd to compute the pulse width.

Revised example:
If the free running clock is 25 kHz., and the first number you capture is 2,537, the second number you capture is 2,575, and the third number you capture is 13,744 you would do the following:
  1. Pulse Arrival Period = 13,744 ticks - 2,537 ticks = 11,207 ticks
  2. Tick Period = 1 / 25 kHz = 40 μsec = 40e-6 seconds
  3. Pulse Arrival Period (seconds) = 11,207 ticks * 40e-6 seconds/tick = 0.448280 seconds
  4. Pulse Frequency = 1 / .448280 ≈ 2.230 Hz.
  5. Pulse Width = 2,575 ticks - 2537 ticks = 38 ticks
  6. Pulse Width = 38 ticks * 40e-6 seconds/tick = 1.52e-3 seconds = 1.53 milliseconds
Now as you continue to collect numbers you can build a histogram table of pulse width and pulse frequency.

If you just want to count the pulses you can still use the capture mechanism to record the times and increment a counter each time you do a capture.
 

Shirin Srf

Joined Jun 11, 2015
5
So if the pulses have different lengths then what you need is only slightly more complex. Let's say the pulses are positive, i.e. the voltage goes up on the leading edge and goes down on the trailing edge. Now you arm the capture mechanism and trigger on the first rising edge. Now you disable looking for rising edges and look for a falling edge. Once you see the falling edge you look for the next rising edge, which would be your third capture. Now you use the 1st and 3rd captures to compute the frequency, and you use the 1st and 2nd to compute the pulse width.

Revised example:
If the free running clock is 25 kHz., and the first number you capture is 2,537, the second number you capture is 2,575, and the third number you capture is 13,744 you would do the following:
  1. Pulse Arrival Period = 13,744 ticks - 2,537 ticks = 11,207 ticks
  2. Tick Period = 1 / 25 kHz = 40 μsec = 40e-6 seconds
  3. Pulse Arrival Period (seconds) = 11,207 ticks * 40e-6 seconds/tick = 0.448280 seconds
  4. Pulse Frequency = 1 / .448280 ≈ 2.230 Hz.
  5. Pulse Width = 2,575 ticks - 2537 ticks = 38 ticks
  6. Pulse Width = 38 ticks * 40e-6 seconds/tick = 1.52e-3 seconds = 1.53 milliseconds
Now as you continue to collect numbers you can build a histogram table of pulse width and pulse frequency.

If you just want to count the pulses you can still use the capture mechanism to record the times and increment a counter each time you do a capture.
i got it thanks alot.
 
Top