Software for FPGA-based PC scope

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.

Reply to
Vagant
Loading thread data ...

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.

formatting link

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
Reply to
Phil Hays

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.

Reply to
sky465nm

More on how to do this in the next exciting episode, I assume.

Reply to
MikeShepherd564

I'd love to hear why "Basic is not an appropriate language".

Reply to
MikeShepherd564

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:

formatting link
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:

formatting link
Examples are included with the tar-ball. Use glade-3:
formatting link
to design the user interface

UDP Socket programmings example from:

formatting link

The code:

formatting link
formatting link

The Socket guide is at:

formatting link

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:

formatting link
?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

Reply to
lm317t

language.

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?

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?

He said he wants it to run under Windows XP. You're offering him a solution to a different problem.

This is just another Linux/Microsoft rant, isn't it?

Reply to
MikeShepherd564

language.

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

I suppose so :-) Personally I like to use the wxwidgets framework

formatting link
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=.)
Reply to
Nico Coesel

language.

Ok then we won't take you seriously.

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.

??

You lost me.

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.

If a rant can exist without an actual rant, then yes I guess it is.

Reply to
lm317t

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

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

Reply to
Mike Treseler

Mike Shephard seems to have a history of these type posts. This thread is a good example, he offers criticism of everyone, but no helpful response to the OP. In the future I know to ignore and avoid his annoying alter ego.

My Apologies to the OP for getting so far off subject.

-Brian

Reply to
lm317t

Actually, IMHO it is a very serious response. I worked on a project where the software was over a year late due in large part to misunderstandings about what Visual Basic could do.

-Jeff

Reply to
Jeff Cunningham

That's right. I have a "history" of "these type" posts and "these type" posts are likely to continue.

People come to the news group looking for practical information but are often met with inane advice like "Programming in Visual Basic is known to cause severe brain-damage". You view appears to be that your contribution is valuable "per se", even where you cannot justify what you write. Your defence is "Its free advice, you get what you pay for". If indeed the advice is worthless, why post it?

What you find uncomfortable in my posts is that I first examine what has been written to determine whether it can be justified. When I find statements which are usually heard while propping up a bar (like your logical fallacy "Use C and you only learn one language..."), I do not fear to point that out. I see no point in proceeding to the technical matter until the misleading drivel is set aside.

Reply to
MikeShepherd564

Which in turn is probably caused by lack of experience. So any language would have caused the project te be delayed by a year. Hiring better programmers would have been the sensible thing to do. The way I see it a programmer is like a tool. 'It' does something well when operating within its capabilities (=language known best).

--
Programmeren in Almere?
E-mail naar nico@nctdevpuntnl (punt=.)
Reply to
Nico Coesel

Here's my workaround using the thunderbird news reader: 1. Click on the offending posting. 2. Message, Create Filter from Message, OK, Close.

*plonk*
Reply to
Mike Treseler

Reply to
lm317t

Visual Basic is quite useful when used for the right project. As you begin to have to handle things like bytes directly it gets really messy. It simply doesn't have the low-level feel that C has (or C+

+). It's been a while since I've used it, but I seem to remember having to use weird constructs like Char(Asc(x)) --brobably the wrong syntax-- to reach out and touch things at the byte level.

It is a neat way to learn a lot about how to program for Windows at a simple level. And, yes, a significant gain in productivity can be had for the right project.

I don't know how VB dotNET or C# change this. I'd be interested to know 'cause I've avoided moving into the new MS tools like the plague (still using VB 6 and MSVC++ 6).

-Martin

Reply to
m

Fair enough. Let me just say that for a task involving hardware synchronization and low level realtime functions (like a FPGA based PC scope), VB is probably a poor tool.

Reply to
Jeff Cunningham

Sounds like you have not heard of the altera NiosII and their free dev tools. Sorry Xilinx people. Anyhow, you can write your for the FPGA in any RTL language like you said, and you can also use any windows language you want on your PC. The thing is you can only use C or C++ (as far as I know) on the FPGA side. You have to have a way of let your windows based program know what your RTL code is doing, and NIOS II is the answer. Send me an email if you dont see what I'm saying.

Reply to
Itandian

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.