serial communication between PC and altera FPGA in C or c++

S

sarah

hI,

I have a project. I need to realise serial communication between PC
and Altera FPGA in c or c++. The function of FPGA is working well. it
can send data to uart.

Does anybody know how to realise it in c or c++?

Thanks

sarah
 
I

Irrwahn Grausewitz

(e-mail address removed) (sarah) wrote in
hI,

I have a project. I need to realise serial communication between PC
and Altera FPGA in c or c++. The function of FPGA is working well. it
can send data to uart.

Does anybody know how to realise it in c or c++?

Please, would you mind to take this question to a more
appropriate NG (I'm almost sure there is a suitable
comp.<your OS or hardware>.* group somewhere), as the
C language (as it is discussed here) does not know
anything about things like "serial communication
between DeathStation2000(tm) and SiriusCyberneticsCorp.'s(tm)
NasalDemonGenerator(tm)" at all.

As a matter of fact, posting questions like this in c.l.c
may invoke some very serious communication... :)

Anyway: if you'd read the c.l.c's charter and faq, or at
least spent some time reading here, you'd already know.

Good luck,


Irrwahn
 
A

Al Bowers

sarah said:
hI,

I have a project. I need to realise serial communication between PC
and Altera FPGA in c or c++. The function of FPGA is working well. it
can send data to uart.

Does anybody know how to realise it in c or c++?

Thanks

sarah

I can not comment on C++ but C language does not have these
functions in its Standard Library. You can use C language with
an extended library. I have used MarshallSoft. I believe they
have demo versions of their libraries that you can dowload and
test. The web address is
http://www.marshallsoft.com
 
R

Richard Heathfield

Irrwahn Grausewitz wrote:

Anyway: if you'd read the c.l.c's charter and faq,

Charter? What charter?

Proofread carefully to see if you included the word "charter". :)
 
E

E. Robert Tisdale

sarah said:
I have a project. I need to realize serial communication
between PC and Altera FPGA in C or C++.
The function of FPGA is working well.
it can send data to uart.

Does anybody know how to realize it in C or C++?

Did you try the Altera web site?

http://www.altera.com/
 
S

sarah

hi,

I try to the other newsgroup such as comp.arch.fpga. They suggested me
try comp.lang.c/c++.

My hardware part: fpga can work well. The data generated in fpga can
be sent to the serial port. I need to have a file in pc to see what
the trasmitted data is . then using matlab to plot the data. So, how
to read the data from serial port in pc is very important.

Can anybody give solution?

Thanks.

Sarah
 
J

Jan Engelhardt

Subject: Re: serial communication between PC and altera FPGA in C or c++

Before, apart from the subject i donot understand this message.
clc/clc++ is not the right place for hardware things (try asking comp.arch.fpga
or some general HW group).
However, if you want to talk about C/C++, be welcome.
My hardware part: fpga can work well.
Sorry, I do not know what FPGA is. My hardware always works well.
The data generated in fpga can
be sent to the serial port.
Then... do it.
I need to have a file in pc to see what
the trasmitted data is .
You could put a fprintf(logfile, "...") in your code after the data has been
transmitted.
then using matlab to plot the data. So, how
to read the data from serial port in pc is very important.
Reading data from the serial port is HW specific stuff.
Other than that I might suggest taking a look at the inportb()/outportb(),
_inp()/_outp() or inb()/outb() function and its relatives. Possibly
http://www.beyondlogic.org/serial/serial.htm might help you.
 
T

Thomas Matthews

sarah said:
hI,

I have a project. I need to realise serial communication between PC
and Altera FPGA in c or c++. The function of FPGA is working well. it
can send data to uart.

Does anybody know how to realise it in c or c++?

Thanks

sarah
As others have stated, serial ports are a platform specific issue.
I highly suggest you ask in a Windows or MSDOS newsgroup. They
will have better knowledge about how to program _their_ serial
port.

Some platforms require a program to use operating specific
functions. Others can access the port directly. Of those,
some platforms map the port as an address others require
special I/O port instructions. I've worked on both kinds
of platforms and I prefer the memory mapped devices.

Also, serial ports are very common. Somebody, somewhere, has
already written code for the serial port. If you don't get
any responses from the Windows or MSDOS newsgroups, try
searching the web for serial port libraries.

Read the documents below. At least one has a list of
newsgroups that would benefit you.
 
S

Sven Semmler

sarah said:
I try to the other newsgroup such as comp.arch.fpga. They suggested me
try comp.lang.c/c++.

Nope, you are wrong here too, since reading the "serial port" is a matter
of your OS. So I suggest you try the folks in ...


.... or the group which is appropriate for your OS (if you happen to use
e.g. Unix).

/Sven
 
C

CBFalconer

Sven said:
Nope, you are wrong here too, since reading the "serial port"
is a matter of your OS. So I suggest you try the folks in ...


... or the group which is appropriate for your OS (if you
happen to use e.g. Unix).

Try comp.arch.embedded.
 
W

Will

Sven said:
Try comp.arch.embedded.
They are like bad doctors. They keep refering you to other doctors if
they don't now what the hell is going on with a patient.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top