FPGARelated.com
Forums

Software for FPGA-based PC scope

Started by Vagant February 28, 2008
Hello,

Although I am a newbie in FPGA design and have experience only with
some simple designs so far, I am thinking of some more ambitious
project and want to design a FPGA-based PC scope working in Windows
XP.
Let's assume that I know how to program (in VHDL) and implement this
on FPGA. Then I will need to write software for this and I need advice
about it. What software such project will require and what development
tools I will need to write such software? May I write this in C++
Builder or Visual Basic or I will need some lower level programming?
So, my question is very general and I would appreciate your advice
which I need to start up with this since on my own I just feel stuck
about software for my project.
Vagant wrote:

> Hello, > > Although I am a newbie in FPGA design and have experience only with some > simple designs so far, I am thinking of some more ambitious project and > want to design a FPGA-based PC scope working in Windows XP. Let's assume > that I know how to program (in VHDL) and implement this on FPGA. Then I > will need to write software for this and I need advice about it. What > software such project will require and what development tools I will > need to write such software? May I write this in C++ Builder or Visual > Basic or I will need some lower level programming? So, my question is > very general and I would appreciate your advice which I need to start up > with this since on my own I just feel stuck about software for my > project.
I'm not sure what you are trying to get out of this. This sounds like perhaps a bit too ambitious of project. However, this is how I'd look at this task: 1) Need to get data from analog to digital. Buy an 8 bit ADC. Or if much slower or somewhat lower resolution is acceptable, design your own. Think about protecting the input against too much voltage. 2) Need to handle triggering, timebases, buffering, and such. FPGA. 3) Need to send data to PC. Buy an Ethernet MAC and PHY. Send the commands to the scope as UDP packets. http://en.wikipedia.org/wiki/User_Datagram_Protocol 3) Use any programming language that can send and receive packets from Ethernet (python, C, C++, Tcl, perl, ...). Write a display and control application. To debug the software for this, you might want to write a "scope simulator" that runs on a second PC. This would allow you to develop the software independently of having working hardware. Capture packets into a form that can be turned into simulation vectors for your FPGA design, and use these to debug your FPGA design. This might be a much bigger project that you think it is. If nothing else, you will learn a lot by trying. Good luck and have fun. -- Phil Hays
Vagant <vladimir.v.korostelev@rambler.ru> wrote:
>Although I am a newbie in FPGA design and have experience only with >some simple designs so far, I am thinking of some more ambitious >project and want to design a FPGA-based PC scope working in Windows >XP. >Let's assume that I know how to program (in VHDL) and implement this >on FPGA. Then I will need to write software for this and I need advice >about it. What software such project will require and what development >tools I will need to write such software? May I write this in C++ >Builder or Visual Basic or I will need some lower level programming? >So, my question is very general and I would appreciate your advice >which I need to start up with this since on my own I just feel stuck >about software for my project.
Use bsd/linux, or something with less bloat when dealing with tight latency. C/C++ language is the choice (of weapon). Basic is not an appropriate language.
>>...want to design a FPGA-based PC scope working in Windows XP.
>Use bsd/linux...
More on how to do this in the next exciting episode, I assume.
>>...want to design a FPGA-based PC scope >>...May I write this in C++ Builder or Visual Basic...?
>C/C++ language is the choice (of weapon). Basic is not an appropriate language.
I'd love to hear why "Basic is not an appropriate language".
On Feb 28, 10:18 pm, MikeShepherd...@btinternet.com wrote:
> >>...want to design a FPGA-based PC scope > >>...May I write this in C++ Builder or Visual Basic...? > >C/C++ language is the choice (of weapon). Basic is not an appropriate language. > > I'd love to hear why "Basic is not an appropriate language".
Programming in Visual Basic is known to cause severe brain-damage. Use C and you only learn one language and one compiler (gcc) for Windows, Linux, Mac, 32-bit ARMs, and even 8-bit AVR CPUs. Even many of the API's are the same from AVR to Windows You can do all this under Ubuntu Linux: http://iso.linuxquestions.org/ You can install it dual boot on your PC or a virtual machine if the pc is fast enough. Don't worry the resize Windows NTFS feature is magical and harmless. as root: install gcc and automake tools as well as any development library headers. Unlike downloading and installing exe's under windows, under linux you can anything, all headers, programs, etc from the gui tool synaptic or the command line tool aptitude. This tool is called a package manager. Windows lacks one of these and is on of the many reasons I avoid using MS. A great library in C for displaying data, even in real time: http://www.eudoxos.net/gtk/gtkdatabox/ Examples are included with the tar-ball. Use glade-3: http://glade.gnome.org/ to design the user interface UDP Socket programmings example from: http://beej.us/guide/bgnet/output/html/multipage/clientserver.html The code: http://beej.us/guide/bgnet/examples/listener.c http://beej.us/guide/bgnet/examples/talker.c The Socket guide is at: http://beej.us/guide/bgnet/output/html/multipage Personally I use the FT232RL for most of my embedded stuff. No need for a 232 level shifter, it goes straight from USB to UART: http://www.digikey.com/scripts/DkSearch/dksus.dll?Detail?name=604-00043-ND You could also go straight USB w/ the FPGA, but thats a bit of a pain and isn't perfect USB either. Check out opencores.org if you go the UDP route for Verilog/VHDL cores so you don't reinvent the wheel or any other widgets. There are tons of C examples on the net to pull from. Just google. -Brian
>>>>...want to design a FPGA-based PC scope >>>>...May I write this in C++ Builder or Visual Basic...?
>> >C/C++ language is the choice (of weapon). Basic is not an appropriate language.
>> I'd love to hear why "Basic is not an appropriate language".
>Programming in Visual Basic is known to cause severe brain-damage.
This is not a serious response. Do you have a rational justification to advise against BASIC? As I understand it, VB.NET is a powerful language which supports object-oriented programming and mixed language development. If (for example), I have a class written in VB.NET, C++.NET or C#.NET then I can use it (or even derive from it) in any of the other languages. The development environment and compilers for all these languages are available free from Microsoft. Perhaps the BASIC with which you are familiar is still limited to two-character symbols?
>Use C and you only learn one language and one compiler (gcc) for >Windows, Linux, Mac, 32-bit ARMs, and even 8-bit AVR CPUs. Even many >of the API's are the same from AVR to Windows
You are immediately confused between "use" and "learn" by an assumption that the advised person does not yet know any of these languages. It's not clear that this is so. If he knows both BASIC and C, then what has learning to do with it?
>You can do all this under Ubuntu Linux...
He said he wants it to run under Windows XP. You're offering him a solution to a different problem.
>...many reasons I avoid using MS.
This is just another Linux/Microsoft rant, isn't it?
MikeShepherd564@btinternet.com wrote:

>>>>>...want to design a FPGA-based PC scope >>>>>...May I write this in C++ Builder or Visual Basic...? > >>> >C/C++ language is the choice (of weapon). Basic is not an appropriate language. > >>> I'd love to hear why "Basic is not an appropriate language". > >>Programming in Visual Basic is known to cause severe brain-damage. > >This is not a serious response. Do you have a rational justification >to advise against BASIC? As I understand it, VB.NET is a powerful > > >>You can do all this under Ubuntu Linux... > >He said he wants it to run under Windows XP. You're offering him a >solution to a different problem.
Indeed. If the application is limited to Windows, C# is the only sane way to go nowadays. C# support for Linux is also there (haven't tried it yet though).
>>...many reasons I avoid using MS. > >This is just another Linux/Microsoft rant, isn't it?
I suppose so :-) Personally I like to use the wxwidgets framework (www.wxwidgets.org). This leaves out 99.9% of the headaches about cross platform programming. In fact, wxwidgets makes live much easier when you have to deal with user interfaces, sockets, serial ports, etc. I even use it on embedded devices running Linux. Too bad there isn't a decent GUI tool for it. -- Programmeren in Almere? E-mail naar nico@nctdevpuntnl (punt=.)
On Mar 2, 5:27 am, MikeShepherd...@btinternet.com wrote:
> >>>>...want to design a FPGA-based PC scope > >>>>...May I write this in C++ Builder or Visual Basic...? > >> >C/C++ language is the choice (of weapon). Basic is not an appropriate language. > >> I'd love to hear why "Basic is not an appropriate language". > >Programming in Visual Basic is known to cause severe brain-damage. > > This is not a serious response.
Ok then we won't take you seriously.
>Do you have a rational justification > to advise against BASIC? As I understand it, VB.NET is a powerful > language which supports object-oriented programming and mixed language > development. If (for example), I have a class written in VB.NET, > C++.NET or C#.NET then I can use it (or even derive from it) in any of > the other languages. The development environment and compilers for > all these languages are available free from Microsoft. >
Then you are locked into one tool for one platform only. Now when you need to program a picoblaze, avr etc you get to learn a tool you could have been using all along.
> Perhaps the BASIC with which you are familiar is still limited to > two-character symbols?
??
> > >Use C and you only learn one language and one compiler (gcc) for > >Windows, Linux, Mac, 32-bit ARMs, and even 8-bit AVR CPUs. Even many > >of the API's are the same from AVR to Windows > > You are immediately confused between "use" and "learn" by an > assumption that the advised person does not yet know any of these > languages. It's not clear that this is so. If he knows both BASIC > and C, then what has learning to do with it?
You lost me.
> > >You can do all this under Ubuntu Linux... > > He said he wants it to run under Windows XP. You're offering him a > solution to a different problem.
Its free advice, you get what you pay for. I was just telling him what I wish someone had told me early on before I learned Visual Basic/ C# etc.
> > >...many reasons I avoid using MS. > > This is just another Linux/Microsoft rant, isn't it?
If a rant can exist without an actual rant, then yes I guess it is.
MikeShepherd564@btinternet.com wrote:

> He said he wants it to run under Windows XP. You're offering him a > solution to a different problem.
He also said, "So, my question is very general and I would appreciate your advice which I need to start up with this since on my own I just feel stuck about software for my project."
> This is just another Linux/Microsoft rant, isn't it?
Linux vs xp is a matter of style not substance. I thought that Brian's posting shows the OP a plausible alternative to consider. -- Mike Treseler