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

Discussion in 'C Programming' started by sarah, Aug 17, 2003.

  1. sarah

    sarah Guest

    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
     
    sarah, Aug 17, 2003
    #1
    1. Advertising

  2. (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

    --
    Proofread carefully to see if you any words out.
     
    Irrwahn Grausewitz, Aug 17, 2003
    #2
    1. Advertising

  3. sarah

    Al Bowers Guest

    sarah wrote:

    > 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


    --
    Al Bowers
    Tampa, Fl USA
    mailto: (remove the x)
    http://www.geocities.com/abowers822/
     
    Al Bowers, Aug 17, 2003
    #3
  4. I'm afraid you have the wrong newsgroup. Try comp.arch.embedded.


    "sarah" <> wrote in message
    news:...
    > 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



    ---
    Outgoing mail is certified Virus Free.
    Checked by AVG anti-virus system (http://www.grisoft.com).
    Version: 6.0.510 / Virus Database: 307 - Release Date: 14/08/03
     
    Jason Bennett, Aug 17, 2003
    #4
  5. Irrwahn Grausewitz wrote:

    <snip>

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


    Charter? What charter?

    > --
    > Proofread carefully to see if you any words out.


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

    --
    Richard Heathfield :
    "Usenet is a strange place." - Dennis M Ritchie, 29 July 1999.
    C FAQ: http://www.eskimo.com/~scs/C-faq/top.html
    K&R answers, C books, etc: http://users.powernet.co.uk/eton
     
    Richard Heathfield, Aug 18, 2003
    #5
  6. sarah wrote:

    > 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/
     
    E. Robert Tisdale, Aug 18, 2003
    #6
  7. sarah

    sarah Guest

    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


    > I'm afraid you have the wrong newsgroup. Try comp.arch.embedded.
    >
    >
     
    sarah, Aug 19, 2003
    #7
  8. >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.

    --
    - Jan Engelhardt
     
    Jan Engelhardt, Aug 19, 2003
    #8
  9. sarah wrote:

    > 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.

    --
    Thomas Matthews
    C Faq: http://www.eskimo.com/~scs/c-faq/top.html
    alt.comp.lang.learn.c-c++ faq:
    http://www.raos.demon.uk/acllc-c /faq.html
     
    Thomas Matthews, Aug 19, 2003
    #9
  10. sarah

    Sven Semmler Guest

    sarah wrote:

    > 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 ...

    news:comp.os.ms-windows.programmer.win32

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

    /Sven

    --
    Sven Semmler http://www.semmlerconsulting.com/
    GPG Fingerprint: 72CA E26D C2A3 1FEB 7AFC 10EA F769 A9A4 937F 5E67
     
    Sven Semmler, Aug 19, 2003
    #10
  11. sarah

    CBFalconer Guest

    Sven Semmler wrote:
    > sarah wrote:
    >
    > > 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 ...
    >
    > news:comp.os.ms-windows.programmer.win32
    >
    > ... or the group which is appropriate for your OS (if you
    > happen to use e.g. Unix).


    Try comp.arch.embedded.

    --
    Chuck F () ()
    Available for consulting/temporary embedded and systems.
    <http://cbfalconer.home.att.net> USE worldnet address!
     
    CBFalconer, Aug 20, 2003
    #11
  12. sarah

    Will Guest

    > Sven Semmler wrote:
    > > sarah wrote:
    > >
    > > > 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 ...
    > >
    > > news:comp.os.ms-windows.programmer.win32
    > >
    > > ... or the group which is appropriate for your OS (if you
    > > happen to use e.g. Unix).

    >
    > 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.
     
    Will, Aug 20, 2003
    #12
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. pandora
    Replies:
    0
    Views:
    575
    pandora
    Apr 14, 2004
  2. lsha
    Replies:
    0
    Views:
    1,243
  3. underground
    Replies:
    5
    Views:
    4,236
    underground
    Jul 22, 2004
  4. sarah
    Replies:
    1
    Views:
    1,044
    Jim Fischer
    Aug 17, 2003
  5. chaitu
    Replies:
    1
    Views:
    822
Loading...

Share This Page