You don=B4t need any mosfet for controll led
you may controll with direct conecct to pin ports with
resistor 330 or 470 ohms.
i think you program is correct
maybe your problem is a wrong conection with mosfet.
good look
ANgel Castillo
2008/7/3, Winston Thana
:
>
> Hi everyone,
>
> I am working on testing device to check whethere there are any faulty con=
nection between microcontroller and external device.
> The microcontroller I am using is MC9S12A256C. The test device has LEDs t=
o indicate the faulty; light turned on when the connection is fine,
> and off when there is a faulty connection. In this case I just want to ch=
eck Port S connection (internally connected to SCI and SPI)
> so I have each Port S pin connected to a MOSFET to controll a LED on/off.=
(NOTE: ignore Port S pins that are connected to SPI module
> which means PTS0-3 are used only) The problem is that I cannnot force Por=
t S output pins to be '0' with no connection between microcontrolle and ext=
ernal device.
> Eventhough I have disabled a trasmitter and reciever of SCI module and di=
sabled pull-up resistor of Port S as shown in the code below.
>
> Could anyone please advice me how to turn off LEDs for Port S?
>
> PORTS equ $d8
> DDRS equ $da
> PERS equ $dc
> WOMS equ $de
>
> PAGE
> org $c000
> main:
> sei
> clr PORTS
> ldaa #$FF
> staa DDRS
> ldaa #0
> staa PERS
> ldaa #$FF
> staa WOMS
> loop bclr PORTS,$FF
> bra loop
>
> ; Must start at this specific address
>
> org $fff2
> fdb main ; IRQ
> fdb main ; XIRQ
> fdb main ; Trap
> fdb main ; SWI
> fdb main ; COP
> fdb main ; Crystal mon
> fdb main ; System Reset
> Kind regards
>
> Win
>
> _________________________________________________________________
> News, entertainment and everything you care about at Live.com. Get it now=
!
> http://www.live.com/getstarted.aspx
>
> [Non-text portions of this message have been removed]
> ------------------------------------

(You need to be a member of 68hc12 -- send a blank email to 68hc12-subscribe@yahoogroups.com )