Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

SquareWave in C language

underscore

Newbie level 2
Joined
Apr 16, 2020
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
24
Hi,

I want to write a c code for square wave converter for some calculation purposes, Actually have to do some process [ converting an analogue signal to a square wave ]. I don't have any idea about this logic in c language .
Pls anyone suggest me the logic or code for square wave converter in C . [currently working with FPGA]

Thanks.
 

andre_teprom

Super Moderator
Staff member
Joined
Nov 7, 2006
Messages
9,161
Helped
1,140
Reputation
2,298
Reaction score
1,113
Trophy points
1,403
Location
Brazil
Activity points
53,168
I want to write a c code for square wave converter
Correct me if I got it wrong, but what you want is not merely to generate a toggle and redirect to an output? Is the frequency fixed or variable? By the way, not mentioning what compiler, or what hardware platform you are using, the question is somewhat vague.
 

underscore

Newbie level 2
Joined
Apr 16, 2020
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
24
Hi,
Thanks for the replaying
Actually, I have already an analog sine wave signal and for calculation purposes just wanted to that sine wave signal into a square wave in C code.
I'm using the kintex series 7 FPGA board.
And right now for c code, I'm doing on an online compiler.
..
Could you please suggest to me..even if simple logic in C language for a square wave. Actually, I'm my field is electrical engineering that's why I'm facing a problem with this.
 

KlausST

Super Moderator
Staff member
Joined
Apr 17, 2014
Messages
17,435
Helped
3,938
Reputation
7,874
Reaction score
3,811
Trophy points
113
Activity points
115,599
Hi,

Confusing. please clarify:

1) you have an analog sine wave signal....how do you connect it to the FPGA?

2) and you say you have an FPGA ... and you want C code. Usually for an FPGA one uses HDL wihile a microcontroller uses "C"


Klaus
 

Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top