pin configuration on SuperPRO

Questions about the BASICtools and MakeItC
YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

pin configuration on SuperPRO

Post by YahooArchive »

I am using the Coridium SuperPro Pro+ and am trying to write to GPIO pin P0.26.
The pin is not labeled on the datasheet. It is supposed to be purposed for
P0.26/RXD3/AD03/AOUT. I know this has something to do with the PINSEL1 but I do
not see an example. I just want it to be an output.

I am using C not BASIC by the way.



YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: pin configuration on SuperPRO

Post by YahooArchive »

In both BASIC and C P0(25) thru P0(26) are configured as AD(2) thru AD(3)

As you say that is controlled by 2 bit values in the PINSEL1 register. Those 2
bits select the function of those pins. Our initialize tin code set bits 18:19
and 29:21 to the value 01' which selects the AD function.

To change either of those back, the Table 80 in the NXP User Manual shows the
value of 00 for the GPIO function

To set those to zero you can use

BASIC

PINSEL1 and= &Hffcfffff ' return P0(26) to GPIO

C

PINSEL1 &= 0xffcfffff; // same operation

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: pin configuration on SuperPRO

Post by YahooArchive »

I still cannot get P0.26 to change. I have changed it from AD0.3 to GPIO P0.26
with the following statement

PINSEL1 &= 0xffc3ffff; //Changes P0.25 and P0.26 to GPIO
(11111111110000111111111111111111)

Then I have this code.

FIO0DIR |= (1<<26); // Set P0.26 as an output
FIO1CLR = 1<<22; // Disable
FIO1SET = 1<<22; // Enable
FIO1CLR = 1<<22; // Disable
FIO1SET = 1<<22; // Enable

I get nothing on my logic analyzer and I know I am looking at the right spot in
time using my trigger on other pins. Why can't I set this pin? It stays high
all the time.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: pin configuration on SuperPRO

Post by YahooArchive »

For P0.26

FIO0SET = 1<<26;
FIO0CLR = 1<<26;

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: pin configuration on SuperPRO

Post by YahooArchive »

Hello Jebadiah,

I was playing around with io control last week, and got this to work. After
setting up the DIRection register with a mask, you can write directly to the PIN
register without using the SET and CLR registers. SET and CLR, to me, are
programmatically tedious because you can only set or clear. You can't just
assign the pin a new value. This code will set up port 2 pins 0~7 as a byte wide
port, ie. databus. But you could do the same this with a single pin.

' Port Control Testing Program 7/26/12 DG

#include "LPC17xx.bas"

DIM VALUE As Integer 'Declare "VALUE" as integer

SUB INIT

FIO2DIR = &H000000FF 'This sets port 2 bits 0-7 as outputs and 8-31 as inputs
VALUE = &H0000000F 'Initialize the value of 'VALUE'

ENDSUB

MAIN:
INIT 'run INIT subroutine

MAINLOOP:

FIO2PIN = VALUE 'write VALUE out to port 2
Goto MAINLOOP 'Loop back and do it again

END

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: pin configuration on SuperPRO

Post by YahooArchive »

If you mean it still doesn't work with this code.

In C, include and call the breakpoint routine, then you can read and write
registers directly from the ENTER line. It's how I debug things.

If the bit values all look right, then what is that pin connected to? Could
there be something else driving it?

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: pin configuration on SuperPRO

Post by YahooArchive »

Yes, it still does not work with the 1<<26 code. I put in the breakpoint call
but do know where the memory is for that pin. I have never used the breakpoint
function. I saw in the NXP manual is shows memory locations as 0x2009 C000 -
0x2009 FFFF set aside for GPIO. How do I know what memory address is for what
pin?

The pin is not connected to anything so there should be nothing driving it low
or high.

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: pin configuration on SuperPRO

Post by YahooArchive »

Make sure you are looking in the User Manual (UM10360) not the Data Sheet. The
GPIO Register map showing the register addresses for FIOxPIN is shown in Table
101.

Chris Burrows
--
Astrobe 4.2: Oberon Development System for the SuperPRO / PROplus
http://www.astrobe.com

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: pin configuration on SuperPRO

Post by YahooArchive »

Basicnode, isn't this one of the pins that needs an external pull-up?
(Maybe I dreamt that, cause I can;t find it in the manual)
jebadiah123456 just said that pin is not hooked to anything except his
analyzer.

James

YahooArchive
Posts: 1462
Joined: Fri Oct 19, 2012 5:11 am

Re: pin configuration on SuperPRO

Post by YahooArchive »

Nope, I double checked that none of the LPC175x pins are open-drain.

I did this from BASICtools, but you can do the same thing from breakpoint

Welcome to ARMbasic Kernel[8.14] with Floating Point Copyright 2012,
Coridium Corp.


@4002c000 //' show the PINSEL registers

4002c000: 00000050 00154000 00000000 F0000000 00000000 00000000 00000000 00000000
!4002c004 0 //' set the AD0-3 to GPIOs

@2009c000 //' show the FIO0DIR registers

2009c000: 00000000 00000000 00000000 00000000 00000000 07FF8FFF 00000000 00000000
!2009c000 06000000 //' make P0.25,P0.26 outputs -- pins go low

!2009c018 06000000 //' write to FIO0SET to make P0.25,26 high

Post Reply