CircuitGizmos

Electronic Products for Creative Minds

  • Home
  • Gizmo Store/Products
  • Documentation/Datasheets
  • Projects/Libraries
  • GizmoBlog
  • Services/Contact
    • Design
    • Contact Gizmo!
  • Your Gizmo Cart
    • Your Account
You are here: Home / GizmoBlog / MMBasic Language / Input and Output / PORT

PORT

PORT(start, nbr) = value

Set a number of I/O consecutive pins simultaneously (ie, with one command).

‘start’ is an I/O pin number and the lowest bit in ‘value’ (bit 0) will be used to set that pin. Bit 1 will be used to set the pin ‘start’ plus 1, bit 2 will set pin ‘start’+2 and so on for
‘nbr’ number of bits. The I/O pins used must be numbered consecutively and configured as outputs before this command is used.

For example;


PORT(4, 8) = &B10000011


will set eight consecutive I/O pins starting with pin 4. Pins 4, 5 and 12 will be set high while 6 to 11 will be set to a low.

If the range of pins specified by the PORT command and function includes pin(s) that are not valid or not properly configured an error will not be raised. Instead the pin will be ignored or return a zero bit.

PORT(start, nbr)

Returns the value of a number of consecutive I/O pins in one operation.

‘start’ is an I/O pin number and its value will be returned as bit 0. ‘start’+1 will be returned as bit 1, ‘start’+2 will be returned as bit 2, and so on for ‘nbr’ number of bits. The I/O pins used must be numbered consecutively and configured as inputs before this command is used.

This command can be used to conveniently communicate with parallel devices like LCD displays. Any number of I/O pins (and therefore bits) can be used from 1 pin up to 23 pins.

If the range of pins specified by the PORT command and function includes pin(s) that are not valid or not properly configured an error will not be raised. Instead the pin will be ignored or return a zero bit.

See also:
PIN
SETPIN

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

A Ton of Documentation

Open all | Close all

Projects made by Gizmo, Friends, and Members

open all | close all

Recent GizmoBlog Musings

  • Altair 8800 using a ColorMax!
  • Re-energizing the ColorMax, Pt. 3

Visit us!

  • Facebook

Electronic Products for Creative Minds

CircuitGizmos is your source for electronic products that help you create your embedded projects. Here at CircuitGizmos.com you will find a friendly store filled with creative products and all of the documentation that you need to use these gizmos.

We create devices that we believe make electronics fun, but we also know that our products are used for professional designs. For decades we have designed products for commercial, military, and medical industries. Our gizmos here are great for engineers and hobbyists alike.

Copyright © 2008+ CircuitGizmos, L.L.C. All rights reserved

Image already added

Recently Viewed Products

Copyright © 2023 · Generate Pro Theme on Genesis Framework · WordPress · Log in