Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Programming hardware with Fortran

Status
Not open for further replies.

GerritGroot

Technical User
Nov 3, 2006
291
ES
Ok, another million dollar question, I don't remember whether I asked this already once, maybe I did, if so I'm sorry, but I couldn't find the thread back.

Is there hardware that can be programmed in fortran. I sometimes look at websites with robotics etc. and all this stuff is programmed directly in some chip, mostly in C. Does this exist in fortran?

And is there a way to give signals to the outside world in fortran? By USB for example. Is there a library or standard solution that does the trick?

Thanks!
 
Hardware can be programmed in any language - all you need is some special instructions/routines to

1) Write to specific addresses
2) (Intel only) Input/output from/to specific addresses

That is the low level stuff that you can still do in Win95/98/ME. With Linux and WinNT upwards, you need access to ioctl calls. Once you have the interface to ioctl, you can do anything.

The callback mechanism used for interrupts is the same in both C and Fortran. The only languages where I found a problem with callbacks are VB and Pascal. Ada handled them quite well.
 
Do you mean something like POKE in basic?

How do you write to specific addresses in fortran?
 
Yes, similar to poke. The input/output in C are called in and out or inw and outw but they're normally not inline so you loose some timing in between. The only language I know of that has them inline is PL/M. Has a very similar syntax to Fortran. Was designed specifically for Intel platforms.

To write to specific addresses, use Cray Pointers. These are similar to pointers in C. Some compilers need compile switches to recognize them.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top