Accessing an Ethernet or USB port - windows

Good Afternoon,
This post is to ask for ideas on which programming language for Windows Vista you would suggest for accessing raw data from an Ethernet port or a USB port. My strength is in micro-controllers. I have a project underway where the 32-bit micro-controller is the last processing device in a software defined radio. The micro has the capability to output digitized signals over a USB port or an Ethernet port. I would like to use the PC as a plotting tool to display the raw digitized sound as a waveform on the screen and possibly play the sound on the sound card output. Also, I will be creating FFT spectrum data, either in the 32-bit micro or in the PC, if the software is fast enough, for spectrum display on my laptop.
I have past experience with older VB. In my last project, I used a simple basic program (JustBasic) to send control data via a USB/RS232 device to a micro-controller. This interface is certainly not fast enough for this project. Additional future features would be to use the Ethernet or USB to control real time features i.e. filter frequencies, FFT size and sample rates in the micro-controller. Any help is appreciated.

Microsoft provides the Raw Input API to get data straight from a USB device. You could use C# to access the port (see here), or any other .NET language. You could also use C or C++ (see here).

Related

How to Develop iPhone/iPad Accessories

I want to create hardware accessory for iPhone and iPad but there is very less resources out there. I am not a programmer or engineer. My concept is very simple building a number pad connected through lightning cable. It will have 6x4 keys layout, in this 4 keys can be customize as per need means key a will work as copy(command+c)key b will work as paste(command+v) this keys can be customised in diffrent kind of shortcuts. I dont want a blueetoth connectivity.
Do I need a arduino or raspberry pi kind of device to program and test run a functional prototype?
What kind of cable do I need to sue to communicate with the device?
What kind of programming langauge do i need to learn?
Do I need to first register for Mfi program or I can do it after I develop the product?
As far as I'm aware, you'll need to join MFI for developing Lightning accessories.
However, you don't need Apple's permission for designing and building your own Bluetooth LE (Bluetooth 4.0) accessories. You should be able to do what you want by programming a Bluetooth LE capable microcontroller to act as a HID device that sends the key events you want. I've not done this specific type of project myself and I'm far from an expert on embedded stuff, but Adafruit have a bunch of resources and development boards on Bluetooth LE using Arduinos and other dev boards. I believe they even have something that already acts as a HID device. I'd start researching in that direction.
Another option is to program a microcontroller to act as a standard USB HID keyboard device, and plug that into the iDevice using the Lightning to USB Camera adapter. iPads recognise standard USB keyboards without needing MFI approval, but you do need to use Apple's adapter. Note that the adapter allows the USB device to draw very little power (50mA I think) so it will not work with any device that requires more. The USB3 version of the adapter has an extra power input and so allows you to attach a USB device that draws more than that.

programming IC recycled from electronic wastes

I have a usb modem with MT6272M chipset, can I take out its chipset and program it? I know that some ICs are programmable and some are not but I really want to program an IC without investing on arduino, rhasberry pi, or intel gallileo so trying to recycle electronic wastes.
Most of the ICs in the electronic waste are not programmable. Because they are specifically designed to do one job efficiently and that program is bound to the IC.
What you are searching is Programmable Integrated Circuit or Micro-controller chips. These are specifically designed to re-program again and again.
Anyhow if you find a specific Integrated Circuit from the waste,
First and most importantly, find its data-sheet (mostly available
in their manufacturer's website for free).
check whether is it a Programmable Integrated Circuit.
if yes, what is the hardware requirement to program it and build the
hardware circuit
write the program according to the specific requirements using
compatible libraries.
connect to the PC
Find the correct boot loader and upload it to the IC.
upload the program, which you have written, to the Programmable Integrated Circuit.
Test it
As you can see, you will need to build different hardware for different Programmable Integrated Circuit. So it is cheaper for you to buy arduino or raspberry circuit board. Then you can reprogram more chips using same board again and again plus the help of the community and the thousands of libraries.
Edit
If it is not mentioned in the datasheet whether you can program it or not , most probably it can't reprogram.
And other thing is that the main function of a modem is signal processing. For example, old cable modems are converting analog signals into digital signals. So they are not designed to reprogram or to do logical calculations. With my personal experience, you better start with a simple micro-controller and once you know the basics, you can go for higher level. Anyway I admire your idea to recycle the waste ICs.

Distributable fpga design

I'm new to fpga programming, and I'm wondering how to make my fpga design distributable. Here's the scenario I have in mind. I have a network of computers, each deployed with an fpga based peripheral. I want to update the fpga design on the peripherals periodically. How do I accomplish this without spending a fortune on software licenses?
I have a small dev kit for an fpga that shipped with an executable to load example design files (it was an Altera fpga FYI). Does anyone know how I would create such an executable?
Some specifics:
My fpgas are Xilinx Spartan 6Es. I'm using Xilinx ISE for fpga development. The host computers are running debian linux.
Thanks for any and all advice!
If youre dealing with Altera: one computer would have the software tools and licenses needed to synthesize the project. Assuming all the FPGAs are the same model on each station/node, Quartus will generate an .sof file which you can copy and open from station to station. All you would need to do is download the Altera programmer tool (I believe you can download it separately from Quartus II) on each station which is free. Then upload the .sof to the board using the programmer, where you can permanently store it on the fpga prom using a technique similar to the following:
https://m.youtube.com/watch?v=ZrMe8JS7Ktk
However if you have Xilinx and Altera mix, Xilinx has .bit/xdl files, and uses another tool (impact) to upload their bitstreams. They can't be converted to and from bit and sof. So it's recommended that you probably stick to one make (Xilinx or Altera) and model based on your plans.
It looks like what you are looking for is how to make your FPGA's field upgradable. Assuming your FPGA is loading from an external memory such as an SPI flash chip, then you need to modify your design so that it is capable of writing to the SPI chip (or whatever) itself. This is most simply done by putting a register in your design which maps to the individual pins on the flash chip, and then "bit bang" the register from a connected computer. Assuming your FPGAs feed data into your own software running on the computer, then you would modify this software to have the functionality of manipulating this register to reflash the flash device. Obviously, if this goes wrong you bricked your device until it can be flashed again with the JTAG, but it provides a way for all the devices to get updated in the systems they operate without needing to buy a JTAG cable for every single station.
If you have Ethernet on your board you can use the remote programming tool from fpga-cores.
Then you can remote login to the network and program the FPGAs or mail the new config file to you customer and they run the programmer. This is how we remotely updates our boards.
Spartan 6 is supported. As a bonus you can also do some remote debugging with the remote logic analyzer.
Everything is free for non commercial use.

Adding Thorlabs DCC cmos as an input device in Matlab to record video?

I'm trying to record timing video from a Thorlabs DCC cmos 1280x1024 with a code in Matlab but Matlab don't recognize it as a video device in imaqhwinfo,
a=imaqhwinfo('winvideo',1) command.
How can I fix it?
It's not supported hardware, see the Supported Hardware page.
Your options are to either request for your hardware to be added to the supported hardware list (if you're prepared to wait a few years...) or use the adaptor kit to write a communication layer between the Image Acquisition Toolbox acquisition engine and the third-party SDK and drivers for your hardware. However, this is a very advanced manoeuvre for experienced users and requires extensive knowledge of the hardware vendor's SDK (and is not something I can help you with).

Controlling the USB from Windows

I know this probably is not the easiest thing to do, but I am trying to connect Microcontroller and PC using USB. I dont want to use internal USART of Microcontroller or USB to RS232 converted, its project indended to help me understand various principles.
So, getting the communication done from the Microcontroller side is piece of cake - I mean, when I know he protocol, its relativelly easy to implement it on Micro, becouse I am in direct control of evrything, even precise timing.
But this is not the case of PC. I am not very familiar with concept of Windows handling the devices connected. In one of my previous question I ask about how Windows works with devices thru drivers. I understood that for internal use of Windows, drivers must have some default set of functions available to OS. I mean, when OS wants to access HDD, it calls HDD driver (which is probably internal in OS), with specific "questions" so that means that HDD driver has to be written to cooperate with Windows, to have write function in the proper place to be called by the OS. Something similiar is for GPU, Even DirectX, I mean DirectX must call specific functions from drivers, so drivers must be written to work with DX. I know, many functions from WinAPI works on their own, but even "simple" window must be in the end written into framebuffer, using MMIO to adress specified by drivers. Am I right?
So, I expected that Windows have internal functions, parts of WinAPI designed to work with certain comonly used things. To call manufacturer-designed drivers. But this seems to not be entirely true becouse Windows has no way to communicate thru Paralel port. I mean, there is no function in the WinAPI to work with serial port, but there are funcions to work with HDD,GPU and so.
But now there comes the part I am getting very lost at. So, I think Windows must have some built-in functions to communicate thru USB, becouse for example it handles USB flash memory. So, is there any WinAPI function designed to let user to operate USB thru that function, or when I want to use USB myself, do I have to call desired USB-driver function myself? Becouse all you need to send to USB controller is device adress and the infromation right? I mean, I donĀ“t have to write any new drivers, am I right? Just to call WinAPI function if there is such, or directly call original USB driver. Does any of this make some sense?
To make your life easier, and avoid writing your own driver, try using the HID (Human Interface Device) API on top of USB. Although it says "Human Interface", it doesn't actually have to be for devices that a human controls. The advantage is that modern OSes already come with a HID driver and you can use sample code such as what you can find here to get started. Many microcontroller manufacturers provide suitable code for the embedded of the protocol.
Because OSes already understand HID, if you build a device using the HID interface you'll find that not only can you read from it from any OS, you may also find that many applications can already talk to your device if its communication is restricted to a small enough subset of HID. (For example, I built an input device for a music app, but amazingly I found I could literally plug it straight into a 3D animation app we use at work, running on a different OS, and have it work right away without writing a single additional line of code!)
This answer might aim you in the right direction.
The first answer here might also be helpful.
The answers to this have some actual code and links to yet other resources.
USB includes a set of stock functionality, much like supporting USB flash drives (USB Mass Storage class). The two most interesting for microcontroller interfacing are HID and CDC. CDC is easiest to use as it directly emulates an old fashioned serial port.
If you configure the microcontroller to act as a CDC device, Windows will enumerate it as a serial port, and all the old serial APIs will work on it.

Resources