how to generate a square wave of frequency 50 Hz using PSOC3

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

cross mob
Anonymous
Not applicable

 IT SHOULD HAVE AN AMPLITUDE OF MORE THAN 5V.

   

IS IT POSSIBLE PLEASE HELP ME..

0 Likes
16 Replies
Anonymous
Not applicable

Hi Sakki,

   

 

   

A 50Hz square wave can be generated using a PWM of Time period = 20ms and duty cycle of 50%.

   

But the max voltage possible from PSoC is 5V.

   

Hence one way to get higher voltage, say 12V is using external transistor with Vcc of 12V.

   

 

   

Regards,

   

dasg

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi Sakki,

   

 

   

I have attached a project in which PWM component is used to generate 50Hz square wave.

   

It also shows the diagram of external cmponents used (a transistor and resistors, Rb = 15K and Rc = 2.2K) to get a square wave which is inverted.

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi,

   

 

   

The snap-shots taken from oscilloscope are also attached.

   

 

   

Regards,

   

dasg

0 Likes
Anonymous
Not applicable

Thank u very much for your reply..

   

 there is a problem loading the project ..

   

the PWM block is not shown etc.

   

can u tell me steps to do it so that i can do it .

   

plz help

0 Likes
Anonymous
Not applicable

 I have already done some projects using PWM and counter, but im not able to produce a 20 ms time period wave(50Hz)

   

im only getting .2 microseconds..what should I do?

0 Likes
Anonymous
Not applicable

 CY8C38666AXI-040 ES2 production is the device i'm using.

0 Likes
Anonymous
Not applicable

 hi

0 Likes
Anonymous
Not applicable

 hi ,

   

Sakki is my brother as I told him he contacted for this project.

   

I'm deepak doing my B.Tech from Government.Engineering College, Kozhikode, Kerala, India.

   

I'm doing my final year project on PSoC. My group has already purchased the develepor kit from Cypress.

   

We have been working on PSoC 3 for the particular square wave output, but not able to produce 50Hz.

   

The project you have sent is not working in our software version, updation is required.

   

Would you please tell us how u configured the PWM block, and all step if possible.

   

My humble request to you. plz help us. 

0 Likes
Anonymous
Not applicable

 The latest version of PSoC Creator is available here, http://www.cypress.com/?rID=39551. You can download the same and upgrade your software. Also to get started with your Square wave generation, there is an example project that already does it. This should help you with the same, http://www.cypress.com/?rID=38623.

0 Likes
Anonymous
Not applicable

Hi Sakki,

   

 

   

First and foremost you need to upgrade the PSoC Creator to PSoC Creator 1.0 since the project I had attached before was done in this version.

   

Also, since the PSoC you are using is ES2, you need to choose the appropriate device.

   

For this, do the following:

   

1) Right click on the project name in workspace and go to 'Device Selector'.

   

2) In the Select Device tab, select the appropriate device you have on the processor module, and select the right 'Device Revision', which in your case is ES2. This is available at the bottom right corner of the tab.

   

 

   

Regarding the configuration of the PWM:

   

1) The clock used is 1MHz.

   

2) The PWM Period is set to 19,999 as period = (19,999 + 20,000)* 1 micro second = 20 ms (to get 50Hz frequency).

   

3) The Compare Value is set to 10,000 so that the the duty cycle is 50% as 10,000 / 20,000 = 0.5.

   

 

   

Let us know if this works.

   

 

   

Regards,

   

dasg

0 Likes
Anonymous
Not applicable

 Hi dasq,

   

I have obtained the square wave with the help of the project you have send earlier. We actually need complementary square wave of same amplitude to drive inverter circuit; but we are not getting the inverted square wave.

   

Used NOT, LUT etc. Some times we get the output and suddenly it dissappears. We need an amplitude between 2-4V for both the square waves.

   

Plz help..

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hi Deeps,

   

 

   

I have attached the project with NOT gate connected to the output so that we can get 50Hz Signal and also its Inverted signal.

   

The amplitude of the square wave is 3.3V

0 Likes
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

The snap shot attached below shows the two 50Hz signals which are 180 degrees out of phase (inverted).

0 Likes
Anonymous
Not applicable

 hi dasq,

   

Thanks for sending the project, hope this will work. But can u tell wat is our problem in obtaining this simple one.

   

Yesterday, we got it using LUT but it dissappeared, supply were not removed. 

   

May be a problem of CRO, we will try it on DSO.

   

DSO is not familiar to us, but still have a try.

   

But still a huge work to be done on this project. 

   

POWER INVERTER CUM INTE;LLEGENT BATTERY CHARGING SYSTEM 

   

Need to program for intelligence.

   

Your friend U2 sugested some ideas, can u give us some ideas.

0 Likes
Anonymous
Not applicable


 Now ,my  fist  question  is how can i communicate  between   " ADS1278  TO  PSOC CONTROLLER (DVK-3)  through "" SPI  PROTOCOL..""
     
2.Before  i  write my another questions is .i want  say  something that    what exactly i want to do  in my project....In  my  project  i want to send the some data from SIGNAL GENERATOR  TO   ADS1278(SIGMA DELTA ADC )  ...Than the data  which in
" ADC" will given to  the controller  and than this data i'll be displyed on LCD...........thus every  time data new data will send  FROM SIGNAL GENRATOR TO   ADC  AND FROM ADC TO CONTROLLER(EX.89c51,pic controller,avr.ike that.  BUT first   priority  in my project "PSOC CONTROLLER)   And than from controller to  LCD.........so  sir plz have any code for interfacing    than send on my mail id  or any other necessary information which i need

3."Multi-Channel High Resolution Sigma-Delta ADC"...is my  title  of project so  how  can  i start  to   write the SPI  interface   code for ADS1278 TO CONTROLLER"  using  C,C++.VHDL  ,language,and   currentl iam  using PSOC CONTROLLER   although if  you  will send  the any  data for regarding to "SPI INTERFACING code for 'ADS1278  TO  CONTROLLER    
 
          I HOPE YOU  WILL GIVE ME BETTRE RESPONSE   AND AM WAITING FOR REPLY............
                                                                                                                 
                                                                                                                               THANK YOU....
 

0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Welcome in the forum.

   

It is not a good habit to hijack a five year old finished thread dealing with a completely different matter.

   

There is an SPI-Master component in Cypress Creator 3.3 to interface your ADS1278. The datasheet for the component (right click on it) tells a lot about SPI and shows all the APIs ready for you to use.

   

 

   

Bob

0 Likes