Device driver for custom hardware: C/C++ equivalent of PEEK, POKE

S

Suresh

Hi,

I need to write a program in C/C++ for read/write operation in an
external memory device (RAM). The read/write application program using
C/C++ in my PC needs to communicate with a memory device (in a custom
made board) to find if my program works and that device responds to
it. In BASIC we use PEEK and POKE instructions. We want to transfer
our BASIC program to C/C++ in WIN32 API for faster and efficient
performance. But in C/C++, how do we write such programs, any
specific commands? we have to use memory address, data for read/write
operation. I use ISA bus and 8255 peripheral interface between my PC
and external memory device or the board. We have a custom made board
designed. the operation includes 2 parts: 1. I/O control of this
board using 8255 and ISA bus, and 2. perform read/write operation to
RAM in this board. I request you to kindly give a clear idea about
this and if possible send me some sample programsin C/C++. Also let me
know the steps/instructions in developing this.

Thanks,
Suresh Vasudev
 
E

Emmanuel Delahaye

In said:
I need to write a program in C/C++ for read/write operation in an
external memory device (RAM). The read/write application program using
C/C++ in my PC needs to communicate with a memory device (in a custom
made board) to find if my program works and that device responds to
it. In BASIC we use PEEK and POKE instructions. We want to transfer
our BASIC program to C/C++ in WIN32 API for faster and efficient
performance. But in C/C++, how do we write such programs, any
specific commands? we have to use memory address, data for read/write
operation. I use ISA bus and 8255 peripheral interface between my PC
and external memory device or the board. We have a custom made board
designed. the operation includes 2 parts: 1. I/O control of this
board using 8255 and ISA bus, and 2. perform read/write operation to
RAM in this board. I request you to kindly give a clear idea about
this and if possible send me some sample programsin C/C++. Also let me
know the steps/instructions in developing this.

I think the good place for this question is around:
 
A

Alan Balmer

Hi,

I need to write a program in C/C++ for read/write operation in an
external memory device (RAM). The read/write application program using
C/C++ in my PC needs to communicate with a memory device (in a custom
made board) to find if my program works and that device responds to
it. In BASIC we use PEEK and POKE instructions. We want to transfer
our BASIC program to C/C++ in WIN32 API for faster and efficient
performance. But in C/C++, how do we write such programs, any
specific commands? we have to use memory address, data for read/write
operation. I use ISA bus and 8255 peripheral interface between my PC
and external memory device or the board. We have a custom made board
designed. the operation includes 2 parts: 1. I/O control of this
board using 8255 and ISA bus, and 2. perform read/write operation to
RAM in this board. I request you to kindly give a clear idea about
this and if possible send me some sample programsin C/C++. Also let me
know the steps/instructions in developing this.
First, there is no such language as C/C++. You will have to write your
program in either C or C++. I would guess from your description that C
is probably more appropriate.

Second, you are in the wrong newsgroup. This group discusses only the
Standard C language, not particular implementations or applications.
Try comp.arch.embedded.

Third, your question is much too broad. Essentially, you're asking for
a training course in how to write C programs, followed by information
on how to access hardware devices on a platform which you fail to
specify. I suggest that you spend some time with a basic book about C
programming, paying particular attention to the subject of pointers.
I'm guessing (you didn't say) that you are using MSDOS or pre-97
Windows. If so, you will probably be able to port your program fairly
easily, using implementation-dependent port I/O instructions. For
memory-mapped I/O, you will use pointers to do the same things your
PEEK and POKE instructions do.

Good luck.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top