Re: [uCsimm] Generic IO Ports

From: Juan José (peco@microbotica.es)
Date: Fri Jul 20 2001 - 12:20:11 EDT


On Thu, 19 Jul 2001, you wrote:
> Can anyone give me a simple example of how to read and write to the
> Generic IO Pins on the ucsimm. I have browsed some different source code to
> try to determine how and so far I have been unsuccessful.

#include <asm/MC68EZ328.h>
int main(int argc, char *argv[])
{
  PDSEL|=0x01; //configure the bit 0 of the Port D like output
  PDDIR|=0x01;
 
  puts("Blinking?");
  while(1){
    PDDATA^=0x01; // Write on the Port D (data) in order to change the
                        // status
     sleep(1);
  }
}

Juan José "Peco" San Martín

Microbótica, S.L
Mail: peco@microbotica.es
Web: www.microbotica.es
This message resent by the ucsimm@uclinux.com list server http://www.uClinux.com/



This archive was generated by hypermail 2b30 : Sun Apr 07 2002 - 00:01:43 EST