Sign in

username:

password:



Not a member?

Search basicx



Search tips

Subscribe to basicx



basicx by Keywords

Accelerometer | ADC | ADXL | Adxl20 | AVR | BasicStamp | BX-35 | BX28 | BX35 | COM3 | Compiler | Downloader | EEPROM | Electromagnet | GetADC | GP2D1 | GPS | I2C | IDE | Keypad | LCD | LCD+ | MIDI | Motors | Multitasking | Netmedia | Networking | PCB | PID | PlaySound | PWM | Relays | RTC | Servo | ShiftOut | SitePlayer | SPI | Stack | Timer | USB

Ads

Discussion Groups

Discussion Groups | BasicX | portA, Bit0-Bit7

Discussion forum for the BasicX family of microcontroller chips.

portA, Bit0-Bit7 - David Sousa Mendes - Jan 14 7:39:49 2008

Hello fellows
In Parallax BasicStamp one can define the logic state of 8 pins using something like: %11100111

Can we do something similar in BasicX?
Looking at the Hardware Reference Manual, pag 14 - "BX24 Pin Definitions", we see that pin 13-pin 20 have as Primary Function : portA, Bit0-Bit7

How can I use this function?
Thanx

David M.

[Non-text portions of this message have been removed]



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


Re: portA, Bit0-Bit7 - Ian Casey - Jan 14 12:14:35 2008

David Sousa Mendes wrote:
> Hello fellows
> In Parallax BasicStamp one can define the logic state of 8 pins using something like: %11100111
>
> Can we do something similar in BasicX?
> Looking at the Hardware Reference Manual, pag 14 - "BX24 Pin Definitions", we see that pin 13-pin 20 have as Primary Function : portA, Bit0-Bit7
>
> How can I use this function?
> Thanx
>
> David M.
>
David,
See Special purpose registers in the Operating system reference.
You'll need to check with the device data sheet for the exact purpose of
each register.

PINA Input Pins, Port A
DDRA Data Direction Register, Port A
PORTA Data Register, Port A

from a previous post:
Register.DDRA = bx0000_0001 will set pin 20 high.

Ian



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

Re: portA, Bit0-Bit7 - Tom Becker - Jan 14 12:49:32 2008

> from a previous post:
> Register.DDRA = bx0000_0001 will set pin 20 high.

Well, that post is not correct. register.DDRn sets the port pin
directions, input or output - not the state of the pins, which can be
set with the corresponding register.PORTn.

To set port pins pin 5 through 12 (Port C) to input, use:
Register.DDRC = 0
or to set pins 17 through 20 as outputs (and pins 13 through 16 as
inputs), use:
Register.DDRA = bx0000_1111

Then, to actually set the output pin states, set register.PORTn (for
example,
Register.PORTA = bx0000_0101
sets pins 17 and 19 low, and pins 18 and 20 high).
Tom



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

Re: Re: portA, Bit0-Bit7 - David Sousa Mendes - Jan 14 16:28:32 2008

Thanx a lot!
BR

David M.

----- Original Message -----
From: Tom Becker
To: b...@yahoogroups.com
Sent: Monday, January 14, 2008 4:40 PM
Subject: [BasicX] Re: portA, Bit0-Bit7
> from a previous post:
> Register.DDRA = bx0000_0001 will set pin 20 high.

Well, that post is not correct. register.DDRn sets the port pin
directions, input or output - not the state of the pins, which can be
set with the corresponding register.PORTn.

To set port pins pin 5 through 12 (Port C) to input, use:
Register.DDRC = 0
or to set pins 17 through 20 as outputs (and pins 13 through 16 as
inputs), use:
Register.DDRA = bx0000_1111

Then, to actually set the output pin states, set register.PORTn (for
example,
Register.PORTA = bx0000_0101
sets pins 17 and 19 low, and pins 18 and 20 high).

Tom

[Non-text portions of this message have been removed]



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