I've never been a fan of connecting CPU pins directly to the outside world.
If your design is budget conscious then you might have no choice, but something like a logic FET's are very nice for driving LED's, I've used BSS138's in many projects.
The CPU ports turn on the BSS138 by driving the port pin high (set the Port direction as an output, then change port state to 1).
Eg -
mov #%00000000,PORTB ; Set up Port B values before changing to output.
mov #%11111111,DDRB ; Set up Port B Data Direction values (1=Outputs).
bset 1,PORTB ; Turn on Bit 1 of Port B
bclr 1,PORTB ; Turn off Bit 1 of Port B
The above sets all of PORTB as an output with the default state of off '0'.
To turn on the output you 'bset' the bit you want on and bclr to turn it off.
For inputs it depends on what voltage you are using, if a 12V input then at minimum you need a resistive divider and change the DDR register to be used as inputs.
The Reference manual for the HC08's covers port configuration commands.
Note, I have not used the MC9S08GT60 so I don't know if the same rules apply.
Cheers,
Ross
Message Edited by Bloodhound on 2009-03-22 11:37 PM