20x2 Retic 5station led display

marks

Senior Member
20x2 Retic 5 station 3 digit 7 segment led display

Recently my rigdel retic controller packed up
i recycled some of the parts and ended up with a
5 station controller.
Runs as soon as power is turned on
displays station 1 and counts down from 20 minutes
and cycles through to station 5 which is not used 00 minutes.
push the button can be paused push again to restart.
push the button a bit longer and stations can be manually controlled
if the push button is continually held down switches off
Code:
main:
let dirsb = %11111111
let dirsc = %10111111
 
 let pinsb=35 pause 1 let pinsb=255 pause 1
 low a.0 let pinsb=171 pause 1 let pinsb=255 pause 1 high a.0
if pinc.6=1 then main
start1:high c.0  high c.1 let w0=120 goto display
start2:low  c.1  high c.2 let w0=220 goto display
start3:low  c.2  high c.3 let w0=320 goto display
start4:low  c.3  high c.4 let w0=420 goto display
start5:low  c.4  high c.5 let w0=500 goto display
paus: let b15 = pinsc 
let pinsc = %10000000
	for b16 =1 to 250
 	 	let pinsb= 12 pause 1let pinsb=255 pause 3
 	if pinc.6 =0 then p
 	next b16
 	
 	for b17 =1 to 250
 	 	let pinsb= 43 pause 1let pinsb=255 pause 3
 	if pinc.6 =0 then n
 	next b17

 	of:
 	   low c.7 let pinsb=192 pause 2 let pinsb=255 high c.7
 	           let pinsb=14 pause 3 let pinsb=255 
 	   low a.0 let pinsb=142 pause 2 let pinsb=255 high a.0
 	if pinc.6=1 then of
 	goto finish
 	
 	N:let pinsb=43 pause 1 let pinsb=255 pause 4
 	if pinc.6=1 then s1
 	goto n
 	
 	s1: for b18=1 to 250 
 	low c.7 let pinsb=249 pause 1 let pinsb=255 pause 1 high c.7
 	high c.0 high c.1
 	next b18
 	if pinc.6=0 then s1
 	if pinc.6=1 then s2
 	
 	s2: for b18=1 to 250 
 	low c.7 let pinsb=164 pause 1 let pinsb=255 pause 1 high c.7
 	low c.1 high c.2
 	next b18
 	if pinc.6=0 then s2
 	if pinc.6=1 then s3
 	
 	s3: for b18=1 to 250 
 	low c.7 let pinsb=176 pause 1 let pinsb=255 pause 1 high c.7
 	low c.2 high c.3
 	next b18
 	if pinc.6=0 then s3
 	if pinc.6=1 then s4
 	
 	s4: for b18=1 to 250 
 	low c.7 let pinsb=153 pause 1 let pinsb=255 pause 1 high c.7
 	low c.3 high c.4
 	next b18
 	if pinc.6=0 then s4
 	if pinc.6=1 then s5
 	
 	s5: for b18=1 to 250 
 	low c.7 let pinsb=146 pause 1 let pinsb=255 pause 1 high c.7
 	low c.4 high c.5
 	next b18
 	if pinc.6=0 then s5
 	if pinc.6=1 then of
 	
 	P:let pinsb=12 pause 1 let pinsb=255 pause 4
 	if pinc.6=1 then pausof
 	goto p
pausof:if pinc.6=1 then pausof let pinsc = b15

Display:
SETTIMER T1S_8
TIMER = 0
if w0 =100 then start2
if w0 =200 then start3
if w0 =300 then start4
if w0 =400 then start5
if w0 =500 then finish

DISPLAY1:

if pinc.6 = 1 then paus
let b10 = w0 dig 2
let b11 = w0 dig 1
let b12 = w0 dig 0

on b10 goto btn1,btn1,btn2,btn3,btn4,btn5

btn1: let b10 =249 goto Digit100c
btn2: let b10 =164 goto Digit100c
btn3: let b10 =176 goto Digit100c
btn4: let b10 =153 goto Digit100c
btn5: let b10 =146 goto Digit100c


	Digit100c:
      low c.7
	let pinsb = b10 
	pause 1
	let pinsb = 255

on b11 goto d00,d10,d20,d30,d40,d50,d60,d70,d80,d90  
d00: let b11 =64  goto Digit10b
d10: let b11 =121 goto Digit10b
d20: let b11 =36  goto Digit10b
d30: let b11 =48  goto Digit10b
d40: let b11 =25  goto Digit10b
d50: let b11 =18  goto Digit10b
d60: let b11 =2   goto Digit10b 
d70: let b11 =120 goto Digit10b
d80: let b11 =0   goto Digit10b
d90: let b11 =16  goto Digit10b

	Digit10b:
	high c.7	
	let pinsb = b11 
	pause 1
	let pinsb = 255
	
on b12 goto d0,d1,d2,d3,d4,d5,d6,d7,d8,d9 
d0: let b12 =192 goto Digit1a
d1: let b12 =249 goto Digit1a
d2: let b12 =164 goto Digit1a
d3: let b12 =176 goto Digit1a
d4: let b12 =153 goto Digit1a
d5: let b12 =146 goto Digit1a
d6: let b12 =130 goto Digit1a
d7: let b12 =248 goto Digit1a
d8: let b12 =128 goto Digit1a
d9: let b12 =144 goto Digit1a
		
	Digit1a:
      low a.0
	let pinsb = b12 
	pause 1
	let pinsb = 255
      high a.0
 
 IF TIMER < 60 THEN display1
 
 w0=w0-1goto display

finish:let pinsc = 0 pause 1000


sw:
high c.7 pause 2000
if pinc.6 =1 then main

low c.7 pause 100
goto sw
 

Attachments

Last edited:

westaust55

Moderator
Hi Mark,

Looks interesting.

I presume you placed most components on the track side of the board due to clerance reasons.

We may have to introduce you to DIPTRACE, one of several CAD packages sed by members here and quite easy to use for drawing schematics.

If you try a search on DIPTRACE here you should find links to downloading a free verison and a couple of PICAXE based add in libraries by forum members
 
Last edited:

Dippy

Moderator
I really must stay in more; what is a rigdel retic ?

Yes, a nice neat CAD would make it a good deal more understandable - and it makes it easier for you too.
 

westaust55

Moderator
@marks,

Came back and had a look at your program.

Suggestion 1:
Add some comments describing how it works - for you later and others now

Suggestion 2:
Improve on the program indentation

Suggestion 3:
Although seemingly the PE allows your code to compile, can I suggest you add a colon ( : ) between commands on the same line

formatting, white space and comments are your friends :)

a line like
let pinsb= 12 pause 1let pinsb=255 pause 3
without even a space between the
PAUSE 1 and the pinsb = 255 become very unreadable


Sugegstion 4:
You can greatly reduce the program size.
just adding three program lines and deleting around 30 lines reduces the program size from693 to 536 bytes.

There are cases where you have structures like:
s1: for b18=1 to 250
low c.7 let pinsb=249 pause 1 let pinsb=255 pause 1 high c.7
high c.0 high c.1
next b18
if pinc.6=0 then s1
if pinc.6=1 then s2

s2: for b18=1 to 250
you can delete the line
if pinc.6=1 then s2
if pinc.6 is not 0 then it must be one and will flow straight through to the S2: label. Each case saves another 3 bytes of program code.

In fact you could change the entire piece of code to something like

s1:
do
for b18=1 to 250
low c.7 : let pinsb=249 : pause 1 : let pinsb=255 : pause 1 : high c.7
high c.0 : high c.1
next b18
loop until pinc.6=1

SO here is a modified version of your code than incorporates some instances of each of the above suggestions to get you thinking on optimisation/improvements

Code:
main:
	let dirsb = %11111111
	let dirsc = %10111111
 
 	let pinsb = 35 pause 1 : let pinsb=255 : pause 1
 	low a.0 : let pinsb=171 : pause 1 : let pinsb=255 : pause 1 : high a.0
	if pinc.6=1 then main

start1:  high c.0 : high c.1 : let w0=120 goto display
start2:  low  c.1 : high c.2 : let w0=220 goto display
start3:  low  c.2 : high c.3 : let w0=320 goto display
start4:  low  c.3 : high c.4 : let w0=420 goto display
start5:  low  c.4 : high c.5 : let w0=500 goto display

paus: let b15 = pinsc 
let pinsc = %10000000
	for b16 =1 to 250
 	 	let pinsb= 12 pause 1let pinsb=255 pause 3
 	if pinc.6 =0 then p
 	next b16
 	
 	for b17 =1 to 250
 	 	let pinsb= 43 pause 1let pinsb=255 pause 3
 	if pinc.6 =0 then n
 	next b17

of:
 	low c.7 let pinsb=192 pause 2 let pinsb=255 high c.7
 	let pinsb=14 pause 3 let pinsb=255 
 	low a.0 let pinsb=142 pause 2 let pinsb=255 high a.0
 	if pinc.6=1 then of
 	goto finish
 	
n:	let pinsb=43 pause 1 let pinsb=255 pause 4
 	if pinc.6=1 then s1
 	goto n
 	
s1:	
	do 
	      for b18=1 to 250 
 			low c.7 : let pinsb=249 : pause 1 : let pinsb=255 : pause 1 : high c.7
 			high c.0 : high c.1
 		next b18
	loop until pinc.6=1 
 	
s2:	for b18=1 to 250 
 		low c.7 let pinsb=164 pause 1 let pinsb=255 pause 1 high c.7
 		low c.1 high c.2
 	next b18
 	if pinc.6=0 then s2
 	if pinc.6=1 then s3
 	
s3:	for b18=1 to 250 
 		low c.7 let pinsb=176 pause 1 let pinsb=255 pause 1 high c.7
 		low c.2 high c.3
 	next b18
 	if pinc.6=0 then s3
 	if pinc.6=1 then s4
 	
s4:	for b18=1 to 250 
	 	low c.7 let pinsb=153 pause 1 let pinsb=255 pause 1 high c.7
 		low c.3 high c.4
 	next b18
 	if pinc.6=0 then s4
 	if pinc.6=1 then s5
 	
s5:	for b18=1 to 250 
 		low c.7 let pinsb=146 pause 1 let pinsb=255 pause 1 high c.7
 		low c.4 high c.5
 	next b18
 	if pinc.6=0 then s5
 	if pinc.6=1 then of
 	
p:	let pinsb=12 pause 1 let pinsb=255 pause 4
 	if pinc.6=1 then pausof
 	goto p

pausof:if pinc.6=1 then pausof let pinsc = b15


Display:
	SETTIMER T1S_8
	TIMER = 0
	if w0 =100 then start2
	if w0 =200 then start3
	if w0 =300 then start4
	if w0 =400 then start5
	if w0 =500 then finish

DISPLAY1:

	if pinc.6 = 1 then paus
	let b10 = w0 dig 2
	let b11 = w0 dig 1
	let b12 = w0 dig 0

;	on b10 goto btn1,btn1,btn2,btn3,btn4,btn5

;	btn1: let b10 =249 goto Digit100c
;	btn2: let b10 =164 goto Digit100c
;	btn3: let b10 =176 goto Digit100c
;	btn4: let b10 =153 goto Digit100c
;	btn5: let b10 =146 goto Digit100c
	
	lookup b10, (249, 164, 176, 153, 146), b10
	


Digit100c:
      low c.7
	let pinsb = b10 
	pause 1
	let pinsb = 255

;	on b11 goto d00,d10,d20,d30,d40,d50,d60,d70,d80,d90  
;	d00: let b11 =64  goto Digit10b
;	d10: let b11 =121 goto Digit10b
;	d20: let b11 =36  goto Digit10b
;	d30: let b11 =48  goto Digit10b
;	d40: let b11 =25  goto Digit10b
;	d50: let b11 =18  goto Digit10b
;	d60: let b11 =2   goto Digit10b 
;	d70: let b11 =120 goto Digit10b
;	d80: let b11 =0   goto Digit10b
;	d90: let b11 =16  goto Digit10b


	lookup b11, (64, 121, 36, 48, 25, 18, 2, 120, 0, 16), b11

Digit10b:
	high c.7	
	let pinsb = b11 
	pause 1
	let pinsb = 255
	

	
;	on b12 goto d0,d1,d2,d3,d4,d5,d6,d7,d8,d9 
;	d0: let b12 =192 goto Digit1a
;	d1: let b12 =249 goto Digit1a
;	d2: let b12 =164 goto Digit1a
;	d3: let b12 =176 goto Digit1a
;	d4: let b12 =153 goto Digit1a
;	d5: let b12 =146 goto Digit1a
;	d6: let b12 =130 goto Digit1a
;	d7: let b12 =248 goto Digit1a
;	d8: let b12 =128 goto Digit1a
;	d9: let b12 =144 goto Digit1a
	
	
	lookup b12, (192, 249, 164, 176, 153, 146, 130, 248, 128, 144), b12

		
Digit1a:
      low a.0
	let pinsb = b12 
	pause 1
	let pinsb = 255
      high a.0
 
	IF TIMER < 60 THEN display1
 
	w0 = w0 - 1 
	goto display


finish:let pinsc = 0 pause 1000


sw:
	high c.7 pause 2000
	if pinc.6 =1 then main

	low c.7 pause 100
	goto sw
 

marks

Senior Member
Hi All ,
tHANKS FOR THE USEFULL iNPUT.

It was actually a : Richdel 6 station Retic Controller ' lol
Turf Irrigation controller (5 zone watering operating 24v ac valve solenoids)
semi auto/manual

Yes components were strangely placed to fit the original enclosure
Diptrace does sound interesting i will have a search
but i do like a easy quick and dirty sketch.

I have added some comments to the code
also when first powered now goes into stanby mode
and another circuit hope this makes it a bit easier!

Code:
goto sm                  'Start in standby mode when powered on (remove line when powered from a timeclock)
main:
let dirsb = %11111111
let dirsc = %10111111

          let pinsb=35   : pause 1                '           Display o
          let pinsb=255 : pause 1                 'Turn off B
          low a.0 : let pinsb=171 : pause 1       '           Display n
          let pinsb=255 : pause 1 : high a.0      'Turn off A
 if pinc.6=1 then main
  
start1:high c.0  : high c.1 : let w0=120 goto display     'start station1.20minutes counts down to 0minutes                     
start2:low  c.1  : high c.2 : let w0=220 goto display
start3:low  c.2  : high c.3 : let w0=320 goto display      '(change wo=399 would become station3. 99minutes)
start4:low  c.3  : high c.4 : let w0=420 goto display
start5:low  c.4  : high c.5 : let w0=500 goto display      'station5   not used 0minutes
         
paus: let b15 = pinsc                                              ' save station number and minutes
      let pinsc = %10000000                                      ' turns off outputs 

	    for b16 =1 to 250                                         ' short delay
 	 	let pinsb= 12 pause 1                             ' Display P
 	 	let pinsb=255 pause 3
 	      if pinc.6 =0 then P
 	    next b16
 	
 			for b17 =1 to 250                                ' short delay
 	 		  let pinsb= 43 pause 1                          ' Display n
 	 		  let pinsb=255 pause 3
 			  if pinc.6 =0 then n
 			next b17

 of:
    low c.7  let pinsb=192 : pause 2  : let pinsb=255 high c.7        'Display O
             let pinsb=14  : pause 3  : let pinsb=255                 'Display F
    low a.0  let pinsb=142 : pause 2  : let pinsb=255 high a.0        'Display F
 if pinc.6=1 then of
 goto finish
 	
 			n:let pinsb=43 : pause 1 : let pinsb=255 : pause 4  'Display n
 			if pinc.6=1 then s1
 			goto n
 	
 	s1:do
 	 for b18=1 to 200 
 	 low c.7  : let pinsb=249 : pause 1 : let pinsb=255 : pause 1 : high c.7 'Display 1
 	 high c.0 : high c.1                                                     'Turn on 1
 	    next b18
 	 loop until pinc.6=1
 	 
 	
 	s2:do
 	 for b19=1 to 200 
 	 low c.7 : let pinsb=164 : pause 1 : let pinsb=255 : pause 1 : high c.7  'Display 2
 	 low c.1 : high c.2                                                      'Turn on 2
 	    next b19
 	 loop until pinc.6=1
 	
 	
 	s3:do
 	 for b20=1 to 200 
 	 low c.7 : let pinsb=176 : pause 1 : let pinsb=255 : pause 1 : high c.7  'Display 3
 	 low c.2 : high c.3                                                      'Turn on 3
 	    next b20
 	loop until pinc.6=1
 	
 	
 	s4:do
 	 for b21=1 to 200 
 	 low c.7 : let pinsb=153 : pause 1 : let pinsb=255 : pause 1 : high c.7  'Display 4
 	 low c.3 : high c.4                                                      'Turn on 4
 	    next b21
 	loop until pinc.6=1
 	
 	
 	s5:do
 	 for b22=1 to 200 
 	 low c.7 : let pinsb=146 : pause 1 : let pinsb=255 : pause 1 : high c.7  'Display 5
 	 low c.4 : high c.5                                                      'Turn on 5
 	    next b22
 	loop until pinc.6=1 : goto of
 	
 P:let pinsb=12 :pause 1 :let pinsb=255 :pause 4                          'Display P
 	if pinc.6=1 then pausof
 	goto P
pausof: if pinc.6=1 then pausof :let pinsc = b15                    'Restore staion number and minutes


Display:
SETTIMER T1S_8
TIMER = 0
if w0 =100 then start2                                          'Station 00minutes start next station                                         
if w0 =200 then start3
if w0 =300 then start4
if w0 =400 then start5
if w0 =500 then finish

DISPLAY_CBA: 

if pinc.6 = 1 then paus
let b10 = w0 dig 2                                                
let b11 = w0 dig 1
let b12 = w0 dig 0

DigitC:

lookup b10, (192,249,164,176,153,146),b10                                        
      low c.7
	let pinsb = b10                                               'Display(0,1,2,3,4,5)
	pause 1
	
	let pinsb = 255                                               'Turn off C
	high c.7
	
DigitB:

lookup b11, (64,121,36,48,25,18,2,120,0,16),b11	                  	
	let pinsb = b11                                               'Display(0,1,2,3,4,5,6,7,8,9) 
	pause 1
	
	let pinsb = 255                                               'Turn off B
	
DigitA:

lookup b12, (192,249,164,176,153,146,130,248,128,144),b12        
	low a.0
	let pinsb = b12                                               'Display(0,1,2,3,4,5,6,7,8,9)
	pause 1
	
	let pinsb = 255                                               'Turn off A
      high a.0
 
 IF TIMER < 60 THEN DISPLAY_CBA
 w0=w0-1goto Display                                                'Subtract after 60 seconds  

finish:let pinsc = 0 pause 1000                                     'Turn off all outputs


sm:
high c.7  :pause 2000
if pinc.6 =1 then main
low c.7   :pause 100                                                'Flash decimal point (Standby)
goto sm
 

Attachments

Last edited:

westaust55

Moderator
Perhaps it's just me, but what is it?

e
I guess for the likes of myself lcoated here in West Aust, I know what Marks has built.

Here we can go months without rain and rather than manually moving a spriinkler around to water lawns and gardens we install permanent reticulation systems.
So an electronic controller, solenoids, 100's of metres of buries PVC piping, pop-up sprinkers in lawns (so the mower does not cut the tops off :) ) and fixed sprinkler etc are the norm here.
Certainly when I lived on the east coast of Aust for a year in 1990, such things there were far less common and maybe in places like the UK never required.
 

TAZMANIAN

New Member
Hi all !

A couple of "hardware" questions on power supply ...
Why 2 diodes 1N4007 (and not a full wave bridge rectifier), a 33 volts zener diode and only 100 microfarad filter capacitor ?
Works correctly in this configuration the 7805 regulator ?
 

marks

Senior Member
hi Taz

1 diode will work ok
just there for extra protection if 1 fails and a bit of extra volt drop.

it will work without the 33 v zener
but gives protection to the 7805 regulator which is rated at 35v
against peak dc voltages

works fine with 50v 100uf capacitor size contraint
a little bigger can always be better lol

wont work with fullbridge rectifier
needs a common ground
so the picake can operate the triac gate .

the code works perfect the way it is
but may update it at a later date
due to improvements made while working on 4 digit stopwatch
 
Last edited:

marks

Senior Member
Its Winter here and its cold and at the moment we are unable to use our retic systems
because of water restrictions in force. So its time to update the code lol.
Code:
      '              -- --   -- --   -- --
      'B.0-A              | |     | |     |         Picake  20x2  ver C.0
      'B.1-B
      'B.2-C              | |     | |     |         marks
      'B.3-D         -- --   -- --   -- --  
      'B.4-E              |       |       | 
      'B.5-F               
      'B.6-G              |       |       |
      '              -- -- o -- --   -- --          'C.7 Low - D.P Display1 On
	'
	'Display         1       2       3                  
	'Common anode   C.7     B.7     A.0           'C.6  Pushbutton

	SYMBOL pushbutton    = PINC.6
	SYMBOL master        = C.0
	SYMBOL station1      = C.1
	SYMBOL station2      = C.2
	SYMBOL station3      = C.3
	SYMBOL station4      = C.4
	SYMBOL station5      = C.5
	SYMBOL display1      = C.7	
	SYMBOL display2      = B.7
	SYMBOL display3      = A.0
	SYMBOL number           = B10
	SYMBOL stationnumber    = B11 
	SYMBOL stationminutes   = B12
	SYMBOL memory           = B14
	SYMBOL menucharacter    = B15
	SYMBOL hold             = W8 'B16,B17
      
      EEPROM  0,(192,249,164,176,153,146,130,248,128,144,255)     'Number        (0,1,2,3,4,5,6,7,8,9,blank)
      EEPROM 11,(140,136,200,142)                                 'menucharacter (P,A,N,F)
      EEPROM 21,(20,20,99,20,1)                                   'Station Times (1,2,3,4,5)

GOTO sm                   'Start in standby mode when powered on (remove line when powered from a timeclock)
Main:
  LET dirsb = %11111111
  LET dirsc = %10111111

Auto: 
  stationnumber=0
    LET pinsb=35 : PAUSE 1 : LET pinsb=255 : PAUSE 1                                 ' Display o
    LOW display3 : LET pinsb=171 : PAUSE 1 : LET pinsb=255 : PAUSE 1 : HIGH display3 ' Display n
  IF pushbutton = 1 THEN auto        

Next1:
 INC stationnumber : IF stationnumber > 5 THEN finish
  SELECT CASE stationnumber
CASE 1 : LET pinsc = %00000011 : read 21,stationminutes      'start station1                     
CASE 2 : LET pinsc = %00000101 : read 22,stationminutes      'start station2
CASE 3 : LET pinsc = %00001001 : read 23,stationminutes      'start station3
CASE 4 : LET pinsc = %00010001 : read 24,stationminutes      'start station4
CASE 5 : LET pinsc = %00100001 : read 25,stationminutes      'start station5
 END SELECT
 GOTO displaytime

Paus: LET memory = pinsc : LET pinsc = %10000000 ' save station number and minutes / turns off outputs
    IF pushbutton = 1 THEN paus

Menu:menucharacter=11
 Men:hold=0
     	  
         READ menucharacter,pinsb : LOW display1 : PAUSE 1 : HIGH display1      
 	     	  PAUSE 2  	  	 
      IF pushbutton=0 THEN men                               'Display menu
                                                                      
    Menu1:HIGH display1
     IF hold > 800 then Menuselection                        'Hold to select
      INC hold
       LOW display1 : IF pushbutton = 1 THEN menu1

   INC menucharacter                                            'Roam menu on release
  IF menucharacter = 15 THEN menu                              
 GOTO men

Menuselection:IF pushbutton = 1 THEN Menuselection
SELECT CASE menucharacter
CASE 11 : GOTO pausof
CASE 12 : GOTO auto
CASE 13 : GOTO next1
CASE 14 : GOTO finish
END SELECT

Pausof: LET pinsc = memory                      'Restore station number and minutes

Displaytime:
SETTIMER T1S_8
TIMER = 0
IF stationminutes =0  THEN next1

Display:
        IF pushbutton = 1 THEN paus
          READ stationnumber,pinsb     : LOW display1 : PAUSE 1 : HIGH display1   

 	  LET pinsb=255	   	    
	LET number = stationminutes DIG 1	                                          
          READ number,pinsb            : LOW display2 : PAUSE 1 : HIGH display2         
          
      LET number = stationminutes DIG 0			
          READ number,pinsb            : LOW display3 : PAUSE 1 : HIGH display3         

 IF TIMER < 60 THEN display
 stationminutes=stationminutes-1 GOTO displaytime              'Subtract after 60 seconds

Finish: LET pinsb=255 : LET pinsc = 0                          'Turn off all outputs

Sm:
HIGH display1   :  PAUSE 1200
IF pushbutton = 1  THEN main
LOW  display1   :  PAUSE 50                                    'Flash decimal point (Standby)
GOTO sm
the code is evolving now down from over 500 to 332 bytes it looks a lot different lol
when first powered starts in standby mode ( . )d.p flashes
when the button is pushed( on) the auto sequence will start (1.20)showing station number and minutes countingdown until the last station (5.00)
finishes and back to standbymode( . )
if we press button during the auto sequence it will pause outputs turn off i'll call this menu mode lol at the moment you can cycle through 4 options
(P. )Pause- if we hold on this until it disappears it will return where it left off (1.20)
(N. )Next-if we hold on this until it disappears it will start at the next station(2.20)
(A. )Auto-if we hold on this until it disappears it will start from the beginning (1.20)
(F. )Finish-if we hold on this until it disappears it will return to standbymode( . )
At the moment station times are in eeprom 21,(20,20,20,20,0)just change to whats required in minutes upto 99 will be displayed.
more changes to come later lol...
 
Last edited:

marks

Senior Member
The code is getting messy again lol
Added to the menu now consists of (P,A,N,F,1,2,3,4,5)
(1. )Station1 manual
(2. )Station2 manual
(3. )Station3 manual
(4. )Station4 manual
(5. )Station5 manual
A single station can be selected only when time period completed will finish( . )
After we hold on our selected station (4. ) we can enter our selected minutes
( .6 ) hold
( . 9) hold -- controller will start and time down (4.69)
Code:
 '              -- --   -- --   -- --
      'B.0-A              | |     | |     |         Picake  20x2  ver C.0
      'B.1-B
      'B.2-C              | |     | |     |         marks
      'B.3-D         -- --   -- --   -- --  
      'B.4-E              |       |       | 
      'B.5-F               
      'B.6-G              |       |       |
      '              -- -- o -- --   -- --          'C.7 Low - D.P Display1 On
	'
	'Display         1       2       3                  
	'Common anode   C.7     B.7     A.0           'C.6  Pushbutton

	SYMBOL pushbutton    = PINC.6
	SYMBOL master        = C.0
	SYMBOL station1      = C.1
	SYMBOL station2      = C.2
	SYMBOL station3      = C.3
	SYMBOL station4      = C.4
	SYMBOL station5      = C.5
	SYMBOL display1      = C.7	
	SYMBOL display2      = B.7
	SYMBOL display3      = A.0
	SYMBOL number           = B9
	SYMBOL stationnumber    = B10 
	SYMBOL stationminutes   = B11
	SYMBOL memory           = B12
	SYMBOL menucharacter    = B13
	SYMBOL minutes          = B14
	Symbol recall           = B15
	SYMBOL hold             = W8 'B16,B17
      
      EEPROM  0,(192,249,164,176,153,146,130,248,128,144,255)     'Number        (0,1,2,3,4,5,6,7,8,9,blank)
      EEPROM 11,(140,136,200,142,249,164,176,153,146)             'menucharacter (P,A,N,F,1,2,3,4,5)
      EEPROM 21,(20,20,99,20,1)                                   'Station Times (1,2,3,4,5)

GOTO sm                   'Start in standby mode when powered on (remove line when powered from a timeclock)
Main:
  LET dirsb = %11111111
  LET dirsc = %10111111

Auto: 
  stationnumber=0
    LET pinsb=35 : PAUSE 1 : LET pinsb = 255 : PAUSE 1                                   ' Display o
    LOW display3 : LET pinsb = 171 : PAUSE 1 : LET pinsb = 255 : PAUSE 1 : HIGH display3 ' Display n
  IF pushbutton = 1 THEN auto        

Next1:
 INC stationnumber : IF stationnumber > 5 THEN finish
 let recall = stationnumber + 20
 read recall,stationminutes
Manual:HIGH a.0  :   IF pushbutton = 1 THEN manual
  SELECT CASE stationnumber
CASE 1,15 : LET pinsc = %00000011       'start station1                     
CASE 2,16 : LET pinsc = %00000101       'start station2
CASE 3,17 : LET pinsc = %00001001       'start station3
CASE 4,18 : LET pinsc = %00010001       'start station4
CASE 5,19 : LET pinsc = %00100001       'start station5
 END SELECT
 If stationnumber > 5 then let stationminutes = minutes endif
 GOTO displaytime

Paus: LET memory = pinsc : LET pinsc = %10000000 ' save station number and minutes / turns off outputs
    IF pushbutton = 1 THEN paus

Menu:menucharacter = 11
 Men:hold=0
     	  
         READ menucharacter,pinsb : LOW display1 : PAUSE 1 : HIGH display1      
 	     	  PAUSE 2  	  	 
      IF pushbutton=0 THEN men                               'Display menu
                                                                      
    Menu1:HIGH display1
     IF hold > 700 then Menuselection                        'Hold to select
      INC hold
       LOW display1 : IF pushbutton = 1 THEN menu1

   INC menucharacter                                            'Roam menu on release
  IF menucharacter = 20 THEN menu                              
 GOTO men

Bmenu:stationminutes = 0
 Bmen:hold=0  	         
                 LET pinsb = 255 : LET number = stationminutes DIG 1	                                          
              READ number,pinsb : LOW display2 : PAUSE 1 : HIGH display2            
           IF pushbutton=0 THEN bmen
                                                                
    Bmenu1:low display2 : IF hold > 700 then amenu                      
              INC hold  :  high display2
           IF pushbutton = 1 THEN bmenu1
      
    stationminutes = stationminutes + 10                                            
  IF stationminutes = 100 THEN bmenu                              
 GOTO bmen
           aMenu: high display2 :IF pushbutton = 1 THEN amenu
                  minutes = stationminutes  :  recall=stationminutes+10
                  
            aMen:hold=0                                  
                 LET pinsb = 255 : LET number = minutes DIG 1	                                          
              READ number,pinsb  : LOW display2 : PAUSE 1 : HIGH display2  
          
                 LET number = minutes DIG 0			
              READ number,pinsb  : LOW display3 : PAUSE 1 : HIGH display3        
           IF pushbutton=0 THEN amen
                                                                
    aMenu1:low display3 : IF hold > 700 then Manual                       
              INC hold  :  high display3
           IF pushbutton = 1 THEN amenu1
      
    inc minutes                                            
  IF minutes = recall  THEN amenu                              
 GOTO amen
 
Menuselection:IF pushbutton = 1 THEN Menuselection
SELECT CASE menucharacter
CASE 11 : GOTO pausof
CASE 12 : GOTO auto
CASE 13 : GOTO next1
CASE 14 : GOTO finish
CASE 15 to 19 : let stationnumber = menucharacter : GOTO bmenu 
END SELECT

Pausof: LET pinsc = memory                      'Restore station number and minutes

Displaytime:
SETTIMER T1S_8
TIMER = 0
IF stationminutes = 0  THEN next1

Display:
        IF pushbutton = 1 THEN paus
          READ stationnumber,pinsb     : LOW display1 : PAUSE 1 : HIGH display1   

 	  LET pinsb = 255	   	    
	LET number = stationminutes DIG 1	                                          
          READ number,pinsb            : LOW display2 : PAUSE 1 : HIGH display2         
          
      LET number = stationminutes DIG 0			
          READ number,pinsb            : LOW display3 : PAUSE 1 : HIGH display3         

 IF TIMER < 60 THEN display
 stationminutes = stationminutes - 1 GOTO displaytime              'Subtract after 60 seconds

Finish: LET pinsb = 255 : LET pinsc = 0                          'Turn off all outputs

Sm:
HIGH display1   :  PAUSE 1200
IF pushbutton = 1  THEN main
LOW  display1   :  PAUSE 50                                    'Flash decimal point (Standby)
GOTO sm
Hmmm no comments no complaints maybe lol ...
 

marks

Senior Member
Thanks Dippy ! i think
you can now save entered minutes for stations to EEPROM
Added r to the menu now consists of (P,A,N,F,1,2,3,4,5,r)

(r. ) remember -as before hold to select
(1. ) selection 1 - 5
( .6 ) hold ( . 9) hold on release will start auto sequnce from that position (1.69)

station 1 now saved in eeprom so it will just continue auto sequence then finish ( . )
note if 00 minutes is selcted on release will show next station (2.20)cont until finish( . )
as before push the button during auto sequence will return to menu mode(P. )outpus off
Code:
      '              -- --   -- --   -- --
      'B.0-A              | |     | |     |         Picake  20x2  ver C.0
      'B.1-B
      'B.2-C              | |     | |     |         marks
      'B.3-D         -- --   -- --   -- --  
      'B.4-E              |       |       | 
      'B.5-F               
      'B.6-G              |       |       |
      '              -- -- o -- --   -- --          'C.7 Low - D.P Display1 On
	'
	'Display         1       2       3                  
	'Common anode   C.7     B.7     A.0           'C.6  Pushbutton

	SYMBOL pushbutton    = PINC.6
	SYMBOL master        = C.0
	SYMBOL station1      = C.1
	SYMBOL station2      = C.2
	SYMBOL station3      = C.3
	SYMBOL station4      = C.4
	SYMBOL station5      = C.5
	SYMBOL display1      = C.7	
	SYMBOL display2      = B.7
	SYMBOL display3      = A.0
	SYMBOL number           = B9
	SYMBOL stationnumber    = B10 
	SYMBOL stationminutes   = B11
	SYMBOL memory           = B12
	SYMBOL menucharacter    = B13
	SYMBOL minutes           =B14
	Symbol recall            =B15
	SYMBOL hold             = W8 'B16,B17
      
      EEPROM  0,(192,249,164,176,153,146,130,248,128,144,255)   'Numbercharacter (0,1,2,3,4,5,6,7,8,9,blank)
      EEPROM 11,(140,136,200,142,249,164,176,153,146,175)       'menucharacter   (P,A,N,F,1,2,3,4,5,r)
      EEPROM 21,(20,20,99,20,1)                                 'Station Times   (1,2,3,4,5)

GOTO sm                   'Start in standby mode when powered on (remove line when powered from a timeclock)
Main:
  LET dirsb = %11111111
  LET dirsc = %10111111

Auto: 
  stationnumber=0
    LET pinsb=35 : PAUSE 1 : LET pinsb = 255 : PAUSE 1                                   ' Display o
    LOW display3 : LET pinsb = 171 : PAUSE 1 : LET pinsb = 255 : PAUSE 1 : HIGH display3 ' Display n
  IF pushbutton = 1 THEN auto        

Next1:
 INC stationnumber : IF stationnumber > 5 THEN finish
 let recall = stationnumber + 20
 read recall,stationminutes
Manual:  IF pushbutton = 1 THEN manual
  SELECT CASE stationnumber
CASE 1,15 : LET pinsc = %00000011       'start station1                     
CASE 2,16 : LET pinsc = %00000101       'start station2
CASE 3,17 : LET pinsc = %00001001       'start station3
CASE 4,18 : LET pinsc = %00010001       'start station4
CASE 5,19 : LET pinsc = %00100001       'start station5
 END SELECT
 
 GOTO displaytime

Paus: LET memory = pinsc : LET pinsc = %10000000 ' save station number and minutes / turns off outputs
    IF pushbutton = 1 THEN paus

Menu:menucharacter = 11
 Men:hold=0
     	  
         READ menucharacter,pinsb : LOW display1 : PAUSE 1 : HIGH display1      
 	     	  PAUSE 2  	  	 
      IF pushbutton=0 THEN men                               'Display menu
                                                                      
    Menu1:HIGH display1
     IF hold > 700 then Menuselection                        'Hold to select
      INC hold
       LOW display1 : IF pushbutton = 1 THEN menu1

   INC menucharacter                                         'Roam menu on release
  IF menucharacter = 21 THEN menu                              
 GOTO men

cMenu:menucharacter = 1
 cMen:hold=0
     	  
         READ menucharacter,pinsb : LOW display1 : PAUSE 1 : HIGH display1      
 	     	  PAUSE 2  	  	 
      IF pushbutton=0 THEN cmen                               'Display menu
                                                                      
    cMenu1:HIGH display1
     IF hold > 700 then bmenu                                 'Hold to select
      INC hold
       LOW display1 : IF pushbutton = 1 THEN cmenu1

   INC menucharacter                                          'Roam menu on release
  IF menucharacter = 6 THEN cmenu                              
 GOTO cmen
 
Bmenu: IF pushbutton = 1 THEN bmenu  :stationminutes = 0
 Bmen: hold=0  	         
                 LET pinsb = 255 : LET number = stationminutes DIG 1	                                          
              READ number,pinsb : LOW display2 : PAUSE 1 : HIGH display2            
           IF pushbutton=0 THEN bmen
                                                                
    Bmenu1:low display2 : IF hold > 700 then amenu                      
              INC hold  :  high display2
           IF pushbutton = 1 THEN bmenu1
      
    stationminutes = stationminutes + 10                                            
  IF stationminutes = 100 THEN bmenu                              
 GOTO bmen
           aMenu: high display2 :IF pushbutton = 1 THEN amenu
                  minutes = stationminutes  :  recall=stationminutes+10
                  
            aMen:hold=0                                  
                 LET pinsb = 255 : LET number = minutes DIG 1	                                          
              READ number,pinsb  : LOW display2 : PAUSE 1 : HIGH display2  
          
                 LET number = minutes DIG 0			
              READ number,pinsb  : LOW display3 : PAUSE 1 : HIGH display3        
           IF pushbutton=0 THEN amen
                                                                
    aMenu1:low display3 : IF hold > 700 then program                       
              INC hold  :  high display3
           IF pushbutton = 1 THEN amenu1
      
    inc minutes                                            
  IF minutes = recall  THEN amenu                              
 GOTO amen
 
Menuselection:IF pushbutton = 1 THEN Menuselection
SELECT CASE menucharacter
CASE 11 : GOTO pausof
CASE 12 : GOTO auto
CASE 13 : GOTO next1
CASE 14 : GOTO finish
CASE 15 to 19 : GOTO bmenu
CASE 20 : GOTO cmenu 
END SELECT

Program:HIGH display3
let stationnumber = menucharacter  :  let stationminutes = minutes  :  If stationnumber > 5 then manual 
  let recall = menucharacter + 20  :  write recall,stationminutes   :  GOTO manual

Pausof: LET pinsc = memory                      'Restore station number and minutes

Displaytime:
SETTIMER T1S_8
TIMER = 0
IF stationminutes = 0  THEN next1

Display:
        IF pushbutton = 1 THEN paus
          READ stationnumber,pinsb     : LOW display1 : PAUSE 1 : HIGH display1   

 	  LET pinsb = 255	   	    
	LET number = stationminutes DIG 1	                                          
          READ number,pinsb            : LOW display2 : PAUSE 1 : HIGH display2         
          
      LET number = stationminutes DIG 0			
          READ number,pinsb            : LOW display3 : PAUSE 1 : HIGH display3         

 IF TIMER < 60 THEN display
 stationminutes = stationminutes - 1 GOTO displaytime   'Subtract after 60 seconds

Finish: LET pinsb = 255 : LET pinsc = 0                 'Turn off all outputs

Sm:
HIGH display1   :  PAUSE 1200
IF pushbutton = 1  THEN main
LOW  display1   :  PAUSE 50                             'Flash decimal point (Standby)
GOTO sm
 
Top