DPRG
DPRG List  



[DPRG] drive a IRPD kit

Subject: [DPRG] drive a IRPD kit
From: Erick Wagner erickwagner at hotmail.com
Date: Thu May 11 22:05:56 CDT 2000

>From: LO VENG CHEONG <d961706 at wkg1.umac.mo>
>Subject: [DPRG] drive a IRPD kit

>I have seen the schematics of the Handyboard and since that the
>Output ports of the 68hc11 are configed to different uses: driving
>a speaker, linking an expansion bus, etc... but I find the PORT D
>is configed to do the SPI originally.

>Since I think that i don't need to do the SPI in my project, I want to
>try to reconfig the bit2 - bit5 in the port D as output ports. But, i
>don't know how to access the control register of the 68hc11 by using the
>interactive C. Can anybody tell me how to do? (or just tell me which
>register should i try to access?)

I don't have a Handyboard nor have I used Interactive C but couldn't
you create a pointer variable that contained the address of the
port D control register and then use the indirection operator ("*") to
dereference the address and modify the value it points at with a
specific value, use bitwise operators and an appropriate mask to either set 
(OR "|" with ones) or clear (AND "&" with zeros) or toggle
(XOR "^" with ones) the bits?

/* where hhll is the address of the port D control register */
unsigned char * portd_ctl_ptr = 0xhhll;

*portd_ctl_ptr = 0x3c; /* this turns off bits 7,6,1,0 and sets 5,4,3,2 */
*portd_ctl_ptr = *portd_ctl_ptr & 0xdf; /* clear bit 5 */

Erick

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com



More information about the DPRG mailing list