Datalogger IO Issue

Questions about the BASICtools and MakeItC
mikechris
Posts: 12
Joined: Sat Apr 29, 2017 12:02 pm

Datalogger IO Issue

Post by mikechris »

I have an issue with many of the outputs
on a new DataLogger not working. Not sure if I
have a bad board (2nd board was DOA) or if it's
a bug. I have successfully used many Coridium
products over the years, only had one bad chip
and found one bug (fixed in a day).
Is it a bad board, a bug, or am I having a senior moment?
Thanks.

Setup: DataLogger (new), Dongle, USB cable, Laptop, Scope
ARMBasic 9.36k, BASICtools 5.56

A test program is provided below:

' TEST - DataLogger Board
' Square Wave at Outputs
'
'The following is a simplified test prog to test
' some of the IO on a DataLogger Board
#include <LPC43xx>' --> pre-processor error
' works the same without the "#include"
FOR I = 1 TO 100000
IO(0)=1 'Works fine as Ref Sig: J1-3; P0_0
IO(122)=1 'J16-2; P7_5 -->Dead
IO(172)=1 'J4-10; P4_8 -->Dead
IO(173)=1 'J2-6; P4_9 -->Dead
IO(174)=1 'J3-1; P4_10 -->Dead
IO(175)=1 'J1-12; P6_7 -->Dead
IO(176)=1 'J5-10; P6_8 -->Dead
WAIT (1)
IO(0)=0
IO(122)=0
IO(172)=0
IO(173)=0
IO(174)=0
IO(175)=0
IO(176)=0
WAIT (1)
NEXT I
END
'Other bits that don't work as outputs:
' 162/P2_2; 163/P2_3; 164/P2_4; 165/P2_5;
' 166/P2_6; 167/P2_8; 168/P3_1; 169/P3_2;
' 178/P9_5 [Port 9; P9_6, IO(139) works fine]



basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Datalogger IO Issue

Post by basicchip »

The IOs are very strange on the LPC43xx, which was designed in Europe. Unlike other parts, the pin port number have nothing to do with the GPIO pin and port number. Why they did that I have no idea, it does make it confusing.

I'll look at the first one you list, J16.2 which is assigned as one of the AD pins. I have not looked for a while, but I think it is setup as an analog input by default. On newer firmware versions we have made the switch automatic. With that many pins on the LPC43xx we may not have done that, it has been a long time since I looked at the firmware.

When you say DOA, does it run Options->Connect? It may have been an unprogrammed board grabbed by accident. We can upload firmware to it.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Datalogger IO Issue

Post by basicchip »

I just noticed that the picture in the BASIC help file is for an earlier rev board, I renumbered the schematic but have not moved all that to the help files. I am on it, Ol Zeke how come you missed this one?? :)

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Datalogger IO Issue

Post by basicchip »

Took a quick look and pins are left in the default reset state, which may not be as a GPIO (again very different from other NXP parts). A quick look at the configuration registers for those by

Code: Select all

@40086000 100

40086000:  000000D0 000000D0 00000000 00000000 00000000 00000000 00000000 00000000 
40086020:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086040:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086060:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086080:  000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 
400860a0:  000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 
400860c0:  000000D0 000000D0 000000D0 000000D0 000000D0 00000000 00000000 00000000 
400860e0:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086100:  00000041 00000041 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 
40086120:  000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 00000000 00000000 
40086140:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086160:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086180:  000000D0 000000D0 000000D0 000000D3 000000D3 000000D3 000000D3 000000D3 
400861a0:  000000D3 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
400861c0:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
400861e0:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086200:  000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 
40086220:  000000D0 000000D0 000000D0 00000000 00000000 00000000 00000000 00000000 
40086240:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086260:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086280:  000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 
400862a0:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
400862c0:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
400862e0:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086300:  000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 
40086320:  000000D0 000000D0 000000D0 000000D0 000000D0 00000000 00000000 00000000 
40086340:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086360:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
40086380:  000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 000000D0 
400863a0:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
400863c0:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
400863e0:  00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 
A quicker fix is to initialize those in BASIC rather than firmware. I probably didn't notice as J1 is specifically the SGPIO pins which is a very powerful piece of hardware, able to do camera or display interfaces. Yes the user manual is quite complex, but with some study it can do many things

To change those J1 P2 pins from SGPIO to GPIO can be done by--

Code: Select all

* &H40086108 = &HD4	'  IOCON pin mux for P2_2
* &H4008610c = &HD4	'     "  P2_3
* &H40086110 = &HD4	'     "  P2_4
* &H40086114 = &HD4	'     "  P2_5
* &H40086118 = &HD4	'     "  P2_6
* &H40086120 = &HD4	'     "  P2_8

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Datalogger IO Issue

Post by basicchip »

And for the include I think it needs to be "LPC43xx.bas"

mikechris
Posts: 12
Joined: Sat Apr 29, 2017 12:02 pm

Re: Datalogger IO Issue

Post by mikechris »

Your quick fix for P2_2,3,4,5,6,8 works good, thanks. I can work around the
other 9 outputs that remain dead, with the exception of the 2 UARTs that
don't work. TXD1 works good, but TXD2 and TXD3 do not. Is there a quick fix
for those two UART pins, or at least one?

The "Include" does need to be <LPC43xx.BAS> (senior moment typo), it resolved
the compile error but did not change the IO issue.

The DOA board is not totally dead, the USB light comes on and "LPC4330 found" is
the response to "Options/connections". It does not respond to any of the
"Options/test" commands or anything else.

The DataLogger board that works has Kernel 8.36h, using ARMBasic 9.36k.

Thanks for your help, your products solved a lot of problems, and saved a lot of
time/money when I worked for the Navy. Just ordered one more DataLogger and a few
Super-Pro's,
Mike


Notes:
1. TXD3 is shown as P2_2 in the main IO table, but is shown as P2.3 in
the UART table and the schematic.
2. TXD2 is shown as P1_15 in the UART table, but as P7_1 in the schematic.
3. RXD2 is shown as P1_16 in the UART table, but as P7_2 in the schematic.
4. Website refers users to old ARMbasic Help files with outdated info.
Example: http://www.coridium.us/files/Schematics/DATAlog.PDF is dated
Sun, Nov 5, 2014; which was replaced with one dated Wed, Nov 5, 2014, which
refers to diff connector #'s (both files are the same "Rev 3"). Latest install
package has the newer schematic for the DATAlogger but has a help file that has
the old pinout table.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Datalogger IO Issue

Post by basicchip »

Copy this file into Program FIles (x86)/Coridium directory.

In BASICtools tools menu you should see a new item install firmware, which should restore the board you have that is missing firmware.
LPC4330.hex
(43.5 KiB) Downloaded 758 times

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Datalogger IO Issue

Post by basicchip »

TXD(2) and RXD(2) should be on P1_15 and P1_16
TXD(3) and RXD(3) should be on P2_2 amd P2_3

I looked into the uart.c code that gets published with the C release. You can move them based on details in NXP's user manual table 190 which shows IO mapping. The table in the help files is correct, I will update the schematic

The html versions of the help files on the web are updated, but the CHM compiled version of that won't get updated until a new release is generated.

You can move those pins using the SFS_Px_y definitions in LPC43xx.bas, which is what I did to connect the GPIOs.

mikechris
Posts: 12
Joined: Sat Apr 29, 2017 12:02 pm

Re: Datalogger IO Issue

Post by mikechris »

Good news, the DOA board lives. You were right, it just needed some firmware, thanks.

Using what you provided, I dug into the NPX manual and the LPC43xx.bas file to
fix 8 more IO. The register programming is shown below:

* &H40086184 = &HD4 ' IOCON pin mux for P3_1
* &H40086188 = &HD4 ' " P3_2
* &H40086220 = &HD4 ' " P4_8
* &H40086224 = &HD4 ' " P4_9
* &H40086228 = &HD4 ' " P4_10
* &H4008631C = &HD4 ' " P6_7
* &H40086320 = &HD4 ' " P6_8
* &H40086494 = &HD4 ' " P9_5

Add that to what you provided:
* &H40086108 = &HD4 ' IOCON pin mux for P2_2
* &H4008610c = &HD4 ' " P2_3
* &H40086110 = &HD4 ' " P2_4
* &H40086114 = &HD4 ' " P2_5
* &H40086118 = &HD4 ' " P2_6
* &H40086120 = &HD4 ' " P2_8

That fixes all but one of the GPIO, P7_5 was listed as IO(122), J16-2. Looking at
all the P7 lines they go in sequence from IO(104) to IO(111), just missing IO(109).
So I tried IO(109) instead of IO(122), and it worked. Looks like IO(122) is just a
typo, should be IO(109), P7_5, J16-2.

That just leaves the Serial lines for UART2 and UART3 (UART0 & UART1 work ok). Will look
into that next.

Notes:
1. Using NPX table 190, it shows:
TXD(3) as P2_3, vs P2_2 in the main help file table (UART table is correct)
RXD(3) as P2_4
2. Online help file shows J1 (old J7) lines as SGPIO, should be GPIO.
3. The install help file (.chm) has a main table that needs some extra space in the
columns to allow the rows to line up.

basicchip
Posts: 1090
Joined: Fri Oct 19, 2012 2:39 am
Location: Weeki Watchee, FL
Contact:

Re: Datalogger IO Issue

Post by basicchip »

Fixed the schematic and help files on web for P7_5. Yes that was a typo.

For your setting the IOCON mux it would be more readable to use the LPC43xx.bas definitions like...

SCU_SFSP3_1 = &HD4
...

Post Reply