Shop OBEX P1 Docs P2 Docs Learn Events
Javelin equivalent of OutL? — Parallax Forums

Javelin equivalent of OutL?

basicstampedebasicstampede Posts: 214
edited 2004-09-13 22:03 in General Discussion
In BS2, I can write:

LEDs VAR OutL then do
LEDs = counter (where counter is VAR Byte)

Is there a similar thing in Javelin where I can access all 8 bits of a port as a group (instead of turning each pins separately)?

If yes, how about accessing ports as 4 individual Nibs?·(similar to if I had
LEDs VAR OUTA above)

Or one Word (control all 16 ports at same time)? (similar to if I had
LEDs VAR OUTS above).

Thanks.

Comments

  • Peter VerkaikPeter Verkaik Posts: 3,956
    edited 2004-09-13 22:03
    The javelin is not as versatile as the BS with respect to aliases,

    but you can access pins bytewise by the use of the constants

    CPU.PORTA (pins 0-7) and CPU.PORTB (pins 8-15).

    and you access the byteports using the methods

    CPU.readPort() ,·CPU.writePort() and CPU.setInput()

    To use nibbles shift left/right 4 bits leaving not referenced bits intact

    (so you should create a byte shadow variable).

    regards peter
Sign In or Register to comment.