RE: [uCsimm] Generic IO Ports

From: James (james@telserco.com)
Date: Fri Jul 20 2001 - 08:11:49 EDT


Thanks. I assume you are not referring to the thin hardcopy manual that came
with the Controller. As it did not contain much info. I will browse the CD
for another manual. After installing uClinux, I just put the CD back into
the mailing package. I guess I should of remembered RTFM!

James.

> -----Original Message-----
> From: Steven Merrifield [mailto:smerrifield@tecom.com.au]
> Sent: Thursday, July 19, 2001 7:08 PM
> To: ucsimm@uclinux.org
> Subject: RE: [uCsimm] Generic IO Ports
>
>
> Hi,
>
> Well first of all, there is a nice example in the uCsimm manual
> to flash a LED. This is a good starting point. Secondly, read
> the manual for the 68EZ328, specifically Section 7 - Parallel Ports.
>
> The manual example shows how to setup a pin as an output.
>
> I have attached a simple example to read a pin as an input. I use
> this code to check for a jumper at power-on to setup the default
> networking parameters which are stored in EEPROM.
>
> Cheers,
> steve
>
>
> /*************************************************************
> **********
> check_default.c
>
> Default header is on PD6 (SIMM pin 16), and is normally high.
> If it is read as low, then the default conditions should be
> restored.
>
> sjm July 2001
>
> **************************************************************
> **********/
>
> #include <asm/MC68EZ328.h>
>
> int main(void)
> {
>
> PDSEL |= 0x40; /* bit 6 type = IO pin */
> PDDIR &= 0xBF; /* bit 6 direction = input */
>
> if (PDDATA & 0x40) /* if it's not == 0, then do not
> restore defaults */
> exit(0);
>
> printf("Default header was detected - resetting default
> parameters\n");
> /* set default conditions here */
> return(0);
> }
>
> -----Original Message-----
> From: James [mailto:james@telserco.com]
> Sent: Friday, 20 July 2001 4:34
> To: 'ucsimm@uclinux.org'
> Subject: [uCsimm] Generic IO Ports
>
>
>
> 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.
>
> Thanks in advance.
>
> James Kinney
> This message resent by the ucsimm@uclinux.com list server
> http://www.uClinux.com/
> This message resent by the ucsimm@uclinux.com list server
http://www.uClinux.com/
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