REGARDING API.....

Discussion of the PSoC Designer integrated development environment for PSoC1 devices.

Moderators: ericb, dcooper, jonp, dpfunston

REGARDING API.....

Postby sridivya » Sat Apr 21, 2012 3:42 am

Hii...may i know how can we write the period value of 63 in API Instead of setting the value in device editor?? that means..PWM_WritePeriod(63) is correct ???
sridivya
Cheese Wheel
Cheese Wheel
 
Posts: 107
Joined: Mon Dec 12, 2011 7:13 am

Re: REGARDING API.....

Postby bobmarlowe » Sat Apr 21, 2012 7:31 am

The datasheet says
PWM8_WritePeriod:
Writes the Period register with the period value. The period value is transferred from the Period
register to the Counter register immediately, if the PWM8 is stopped or when the counter reaches the
zero count

So what exactly you did not understand / you're not sure of?

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: REGARDING API.....

Postby sridivya » Sat Apr 21, 2012 9:15 pm

my question is that i have to set the period value and pulse width value as 63 and 37 . so instead of setting in device editor, can we set these values in application editor??
sridivya
Cheese Wheel
Cheese Wheel
 
Posts: 107
Joined: Mon Dec 12, 2011 7:13 am

Re: REGARDING API.....

Postby bobmarlowe » Sat Apr 21, 2012 10:20 pm

Yes, we can! :D That is what the APIs are made for.
As long as you are not changing/adapting the values within your program there is no real benefit from that, except that it would make the settings a bit more transparent when looking at your main() program. Nevertheless you should give EVERY parameter of a module a reasonable value in the device-editor.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: REGARDING API.....

Postby sridivya » Sun Apr 22, 2012 7:24 am

so can i give as PWM_WRITEPERIOD(63) For the period value 63??
sridivya
Cheese Wheel
Cheese Wheel
 
Posts: 107
Joined: Mon Dec 12, 2011 7:13 am

Re: REGARDING API.....

Postby bobmarlowe » Sun Apr 22, 2012 7:59 am

Yes you can if you care for the character cases (it's PWM8_WritePeriod). So there must still be something you are not sure of, or you would not ask again.

What are you still unsure of?

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany

Re: REGARDING AN2336

Postby sridivya » Wed May 23, 2012 1:24 am

Hi...as in the fsk detection AN2336,
1) what is tHE MAIN REASON TO PROVIDE THE DELAY???
2)WHY THE CORRELATOR HAS BEEN USED THAN ANY OTHER DEVICE
sridivya
Cheese Wheel
Cheese Wheel
 
Posts: 107
Joined: Mon Dec 12, 2011 7:13 am

Re: REGARDING API.....

Postby bobmarlowe » Wed May 23, 2012 4:20 am

There are differterent approaches to distinguish between two different frequencies, for instance you may measure the time between two low-to-high transitions and then decide if it was low or high frequency. This will use CPU action (you even may need an interrupt-routine to perform that task) but then you do not have a signal yet, you'll have to set an ioport or do something similar under CPU-control.

PSoC is different in this way: since you've got analog(!!!) hardware on the chip that can be configured and routed to do nearly any job, there is no CPU-action required. This solution was selected in AN2236. The correlator is a widely used technique, you delay the input-signal as long as the half frequency endures and then compare the input and the delayed signal (a simple xor would do). When the signals are exactly 90° shifted, the output would be 1 (exept for a few spikes). The more the signals are not exactly 90° off phase, the more time of the resulting signal it will be 0 (zero). A filter (think of a capacitor loaded with this signal via a resistor) would get rid of the spikes and finally present you with a 1 (High frequency) or a 0 (low frequency) as you need it. This filter is done in PSoC as well using some switched capacitor building blocks.

And finally, after initialization, the whole system runs without CPU interaction, saving all the precious MIPS for the UART and (if implemented) the man-machine-communicationn.

Bob
User avatar
bobmarlowe
The Big Cheese
The Big Cheese
 
Posts: 1490
Joined: Thu Oct 06, 2011 2:03 am
Location: Germany


Return to “%s” PSoC Designer (PSoC1 IDE)

Who is online

Users browsing this forum: No registered users and 1 guest