Home  |  Contents 

Microcontroller and PC projects
  Forum Index : Microcontroller and PC projects         Section
Subject Topic: Test Code and BiPolar Test Lamp for E100 Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
disco4now
Senior Member
Senior Member


Joined: 18 December 2014
Location: Australia
Online Status: Offline
Posts: 286
Posted: 09 November 2018 at 8:41pm | IP Logged Quote disco4now

There have been a number of occasions where people have build various Micromites, E100 etc and get to the point where they can talk to the console, but have has issues with LCD etc.
It a long time since I have used a BiPolar test lamp but when I was using it back in the day, it was the only thing you used other than a circuit.(PMG,Telecom)

I built this LED version using a red and green LED and three 200ohm resistors.



You connect to 3.3v and Gnd and when the probe touches a high logic the green Led lights and when touches a low logic level the red lights, and neither lights for a high impedance. With the resistors touching 5v is OK as well.

Here it is probing the LCD connector on an E100



So if you have the console working you can load the program below and use it to set the pins of interest high and low and check them for continuity and shorts using the test lamp.

The program contains a list of the connections you are interested in testing and their corresponding MCU pins. The Space Bar steps through the defined tests and the console tells you which connection to probe.

A good test will be green Led 1 second,No Leds 1 second, Red Led 1 second, No leds 1 second during the four step test.
The Leds swapping from Green directly to Red with no off time indicates a short, you are on the wrong pin or there is an external pullup etc.

1. The pin is set high and all other pins set low. The pin being tested should show as high.
2. The pin is set OFF and all other pins remain low. The pin being tested is not high or low and both test LEDs are off. If either led lights there is possibly a short to another pin .
3. The pin is set low and all other pins set high. The pin being tested should show as low.
4. The pin is set OFF and all other pins remain high. The pin being tested is not high or low and both test LEDs are off. If either led lights there is possibly a short to another pin .

A pin with a pullup resistor will show high for steps 2 and 4
Initially set to test D0-D7 LCD-RST T-CS and T-IRQ on and E100 Board

The console as show during a full set of tests




Quote:
'------------------------------------------------------------------------------'
' Micromite - PCB Connections Test Code for Bipolar Testb L '
' '
' '
' Author: Gerry Allardice '
' '
dim ProgTitle$ = "Bipolar Test Code for E100" '
' '
dim ProgVer$ = "v1.0.0" '
' '
dim ProgDate$ = "09-Nov-2018" '
'------------------------------------------------------------------------------'
' Once a micromite has been built to the point of being able to communicate via the
' CONSOLE this program can be then be loaded and used to verify the pin connections for
' any peripherals (eg LCDPANEL) by using a Bipolar test lamp.
' (tests for continuity and possible shorts to other pins)
'
' This program will monitor the console and when the Space Bar is press will step
' through the pins to be tested. The test of each connection is in 4 phases.
'
' 1. The pin is set high and all other pins set low. The pin being tested should show as high.
'
' 2. The pin is set OFF and all other pins set low. The pin being tested is not high or low
' and both test LEDs are off. If either led lights there is possibly a short to another pin .
'
' 3. The pin is set low and all other pins set high. The pin being tested should show as low.
'
' 4. The pin is set OFF and all other pins set high. The pin being tested is not high or low
' and both test LEDs are off. If either led lights there is possibly a short to another pin .
'
' A pin with a pullup resistor will show high for steps 2 and 4
'
' Initially set to test D0-D7 LCD-RST T-CS and T-IRQ on and E100 Board

Option Explicit
Option Default NONE
Option BASE 1


'================================================================================================
' Data Variables
'================================================================================================


dim integer loc0last,loc0now,loc1last,loc1now,loc2last,loc2now,GetCon=0,GetCom1=0,GetCom2=0
dim integer counter,mode,testno
dim L$(20) as string length 20
' set the maximum value for the number to pins to be tested and the number of pins to be used
' to test against for shourt circuits. most likely the same.
dim integer maxpins=11,testmax=11
' list the pin numbers that will be set high/low during the testing to look for short circuits
dim integer targetpins(maxpins)=(1,3,4,5,93,94,98,99,100,42,40)
dim string buff$=""

dim mcupin(20) as integer
'================================================================================================
' Program Initialization
'================================================================================================

Print "Starting " + ProgTitle$ + ": " + ProgVer$ + " - " + ProgDate$
Print "!!!!!!! Switch to VT100 mode if using MMEdit !!!!!!!!!!"
Print
Print "Press Space Bar to start and advance to next test"
Print "Enter test no followed by Space Bar to select a specific test"
Print "Press ESC to end"
Print "Press ? for a list of the tests"
'Mode = 0 'Mode = show Main Screen
settick 100,IsSerialOrConsoleComplete,1
settick 1000,secondtick,2
' Enter the details for each test. The details of where the test probe should be placed
' and the micromite pin that is mapped to that particular test point.
L$(1)="TOUCH CS (CON9-20) GNRN":mcupin(1)=1
L$(
2)="LCD D5 (CON9-12) GNRN":mcupin(2)=3
L$(
3)="LCD D6 (CON9-14) GNRN":mcupin(3)=4
L$(
4)="LCD D7 (CON9-16) GNRN":mcupin(4)=5
L$(
5)="LCD D0 (CON9-2) GNRN":mcupin(5)=93
L$(
6)="LCD D1 (CON9-4) GNRN":mcupin(6)=94
L$(
7)="LCD D2 (CON9-6) GNRN":mcupin(7)=98
L$(
8)="LCD D3 (CON9-8) GNRN":mcupin(8)=99
L$(
9)="LCD D4 (CON9-10) GNRN":mcupin(9)=100
L$(
10)="LCD RST (CON9-33) GNRN":mcupin(10)=42
L$(
11)="TOUCH IRQ(CON9-28) GNRN":mcupin(11)=40

testno=
0
'================================================================================================
' Main program loop
'================================================================================================

do
'Watchdog 40000 'reset after 40 secs on hang
'==============================Check Console and Serial Ports====================================
IF GetCon=1 then
ReadConsole
'If data in console1 then GOSUB GetConsole
END IF

IF testno>0 then
IF mode>0 then
IF mode=1 then 'put our test pin high, all others low 'Green LED
'? "mode 1"
setpins mcupin(testno),0
setpin mcupin(testno),DOUT
PIN(mcupin(testno))=1
endif
IF mode=2 then 'put out test pin in read mode i.e. high impedance 'NO LED
'? "mode 2"
setpin mcupin(testno),OFF
endif
IF mode=3 then 'put our test pin low, all others high 'RED LED
'? "mode 3"
setpins mcupin(testno),1
setpin mcupin(testno),DOUT
PIN(mcupin(testno)))=0
endif
IF mode=4 then 'put out test pin in read mode i.e. high impedance 'NO LED
'? "mode 4"
setpin mcupin(testno),OFF
endif

mode=
0
endif
endif


Loop

'================================================================================================
' Procedures providing program functionality components
'================================================================================================

SUB setpins( exclude as integer, value as integer)
local integer x
for x= 1 to maxpins
'? targetpins(x)
IF targetpins(x)<> exclude then
setpin targetpins(x), DOUT
PIN(targetpins(x))=value

endif
next x
END SUB

SUB secondtick
counter =counter +
1
IF counter=1 then
mode=
1
END IF
IF counter=2 then
mode=
2
END IF
IF counter=3 then
mode=
3
endif
IF counter=4 then
counter=
0
mode=
4
endif
END SUB

'Checks console and serial ports for data and sets flag if data has stopped coming in.
SUB IsSerialOrConsoleComplete


loc0now=
LOC(#0)
IF Loc0now>0 then
IF loc0now=loc0last then 'data finished
GetCon=1 'If data in CON then set GetConsole flag
else
loc0last=loc0now
endif
END IF

' loc1now=LOC(#1)
' IF loc1now > 0 THEN
' if loc1now=loc1last then 'data finished
' GetCom1=1
' ELSE
' loc1last=loc1now
' ENDIF
' ENDIF
'
' loc2now=LOC(#2)
' IF loc2now > 0 THEN
' if loc2now=loc2last then 'nothin new
' GetCom2=1
' ELSE
' loc2last=loc2now
' ENDIF
' ENDIF

END SUB

'Reads data from the console
SUB ReadConsole
local char$
local integer i,j
j=
LOC(#0)
char$=
INPUT$(100,#0)

IF char$<>"" then

IF len(char$)=1 then
' ? char$;
' ? ASC(left$(char$,1));

IF Char$="0" then buff$=buff$+ "0"
IF Char$="1" then buff$=buff$+ "1"
IF Char$="2" then buff$=buff$+ "2"
IF Char$="3" then buff$=buff$+ "3"
IF Char$="4" then buff$=buff$+ "4"
IF Char$="5" then buff$=buff$+ "5"
IF Char$="6" then buff$=buff$+ "6"
IF Char$="7" then buff$=buff$+ "7"
IF Char$="8" then buff$=buff$+ "8"
IF Char$="9" then buff$=buff$+ "9"
IF Char$="?" then
for i= 1 to testmax
?
"Test"+str$(i)+ " Place bipolar probe on ",L$(i)
next i
?
"Test no + Space Bar to continue"
endif

' space Bar
IF Char$=" " then

IF buff$="" then
testno=testno+
1
else
testno=
val(buff$)
IF testno>testmax then testno=1
buff$=
""
endif
IF testno>testmax then
testno=
0
Print "Tests finished"
Print " Press Space bar to continue"
Print " test no and Then Space Bar for a specific test"
Print " ESC to end"
else
Print "Test no.",testno,"Place bipolar probe on ",L$(testno)
endif
endif
else
? char$;
?
ASC(left$(char$,1));
endif
IF ASC(left$(char$,1))=27 then
'? "ESC"
END
END IF


END IF
END IF

END SUB



The data could be adjusted to test more connections on the E100 or for any other board.
Once you get the console working you can use it to test/troubleshoot board issues.

Hoping someone finds it useful.

Regards
Gerry










Back to Top View disco4now's Profile Search for other posts by disco4now
 
Chopperp
Guru
Guru
Avatar

Joined: 03 January 2018
Location: Australia
Online Status: Offline
Posts: 319
Posted: 10 November 2018 at 5:36pm | IP Logged Quote Chopperp

Hi Gerry,

Looks interesting.

Been meaning to let you know that your MMreplace.exe prog is still working well with MMEdit and my CMM. Certainly makes dealing with Library files so much easier (as long as I remember to set the directives properly).

Thanks again

Brian

__________________
ChopperP
Back to Top View Chopperp's Profile Search for other posts by Chopperp
 
Grogster
Guru
Guru
Avatar

Joined: 31 December 2012
Location: New Zealand
Online Status: Offline
Posts: 6229
Posted: 10 November 2018 at 7:11pm | IP Logged Quote Grogster

I also have a tester PCB available, for those who are curious if their port pins are working correctly. Third from the bottom of the page. Tests both the parallel and the SPI based MM boards.





MMBASIC code to use the tester is available from my downloads page.
PCB only. You need to supply the components.



__________________
Smoke makes things work. When the smoke gets out, it stops!
Back to Top View Grogster's Profile Search for other posts by Grogster Visit Grogster's Homepage
 


If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Search the forums using Google.
In the news...
 
Post ReplyPost New Topic
Printable version Printable version
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum

Powered by Web Wiz Forums version 7.8
Copyright ©2001-2004 Web Wiz Guide

This page was generated in 0.1094 seconds.
Privacy Policy     Process times : 0, 0, 0, 0.11