CountDown Timer 3 Digit 7 Segment reusing an axe133 (18m2)

marks

Senior Member
CountDown Timer 3 Digit 7 Segment reusing an axe133 Board with (18m2)

Have been wanting to try driving a multiplexed display using an 18m2.
and using hardware TIME seems very accurate for seconds.
In this example our selected time is 120 seconds displayed at start.
output1 is OFF.

Push the button too start countdown.
output1 ON.

When counting down push the button to pause or continue at anytime.
output1 remains ON.

If we hold the button and release or if our countdown reaches zero.
it will reset and display 120
output1 will be OFF.

Added output2 will be HIGH for the last 10 seconds of countdown.
Code:
#picaxe 18m2    'version 2.D   
	'             -- --   -- --   -- --   
	' B0-A       |     | |     | |     | 
	' B1-B	
	' B2-C       |     | |     | |     | 
	' B3-D        -- --   -- --   -- --            MarkS
	' B4-E       |     | |     | |     | 
	' B5-F
	' B6-G       |     | |     | |     | 
	' B7-dp       -- --   -- --   -- --     
	'
	'Display        1       2       3       
	'Common anode  C.2     C.1     C.0     
SETFREQ M16	
eeprom 0,(192,249,164,176,153,146,130,248,128,144,255) 'Display (0,1,2,3,4,5,6,7,8,9,blank)
 SYMBOL pushbutton    = PINC.5
 SYMBOL output1       = C.7
 SYMBOL output2       = C.6
 SYMBOL display1      = C.2     
 SYMBOL display2      = C.1
 SYMBOL display3      = C.0
 SYMBOL push          = B10
 SYMBOL number        = B11
 SYMBOL secs          = W6 'b12,b13
 SYMBOL timer         = W7 'b14,b15
 
LET dirsb = %11111111
LET dirsc = %11001111
ENABLETIME

Zero:
 timer = 120 ' * timer = our selected secs to countdown ie (10-999) *
 push = 0                                   ' reset menu                                        
 TIME = 0                                   ' reset Hardware M2 timer   
 
Start:
 secs=Timer-TIME                                            

Control:
 IF secs = Timer then low output1         
 else high output1                          'output1 high when countingdown
 endif
 
 IF secs > 10    then low output2         
 else high output2                          'output2 high when countingdown from 10 seconds
 endif
                                                               
Display:          
 number = 10 :  IF secs < 100 THEN Dig1     'Display1 Zero blanking	
      LET number = secs /100                                       
    Dig1:  READ number,pinsb : LOW display1 : PAUSE 1 : HIGH display1      
 
                IF secs < 10  THEN Dig2     'Display2 Zero blanking
	LET number = secs //100/10 	                                          
    Dig2:  READ number,pinsb : LOW display2 : PAUSE 1 : HIGH display2  	
	
	LET number = secs //100//10			
    Dig3:  READ number,pinsb : LOW display3 : PAUSE 1 : HIGH display3  
		
      IF pushbutton = 1 THEN Selection 	  'start or pause with a single press        
           	                                                                                     
IF  secs = 0 THEN Zero                      'once 0 is reached resets to our timer value                                         
 ON push GOTO Zero,Start,Display 
                              
Selection:
IF push = 2 THEN StopAndPause               'if we pause  output1 remains high

 Selection1:
  INC  push : PAUSE 1000                    'at M16 1000ms/4
  IF pushbutton = 1  THEN Selection1                                       
  ON push GOTO Zero,Start,Display
  IF push > 2 THEN Zero                     'if we hold our pusbutton resets to our timer value
   
  StopAndPause:
   push = 0
   TIME = timer-secs
   GOTO Start
The RevEd Product code AXE132 is a standalone serialdriver board marked(axe133) complete with 18m2 and components
which we can reuse to make a great project board its well priced ! just dont tell no one lol !
http://www.techsupplies.co.uk/epages/Store.sf/en_GB/?ObjectPath=/Shops/Store.TechSupplies/Products/AXE132

It is also included with other products like
Product code AXE133 (serialdriverboard + budget LCD Display)
Product code AXE133Y(serialdriverboard + OLED Display)

I'll proberly be banned for advertising lol!
I still cant wait for product code AXE133B to appear.

I like a nice smooth supply for my picaxe and prefer to use a 47uf in place of vr1 see drawing .
 

Attachments

Last edited:

westaust55

Moderator
@marks,

You make many references to AXE133 which is a serial OLED display kit including an OLED display module.

In reality either by removal of the OLED display module or direct purchase (without the OLED), you are in fact using an AXE132.

Maybe being a bit pedantic, however it may be worthwhile editing your words to reflect that you are using the AXE132 Serial OLED/LCD driver board as a stand alone development/proto-typing board. When I see AXE133, I tend to immediately think of a complete OLED display module kit.

Otherwise well done and there is no problems with re-purposing an AXE part for a new function than originally intended.
 

dbarry722

Member
Hi Marks..

Just looking at your circuit whilst waiting for my bits and pieces to arrive from Techsupplies.

Could you answer something for me as I'm a newby to this but can read electronic diagrams. In your program, you refer to 'SYMBOL output2 = C.6' but whilst looking at your diagram, C6 doesn't appear to connected to anything. Its this just a 'pin' that could have a buzzer attached to it for the last 10 secs (output 2 high for last 10 secs) :eek:

Declan
 

marks

Senior Member
Hi dbarry722,
You are correct the code was edited after it proberly would be a good idea to update that lol !
 

hippy

Technical Support
Staff member
The RevEd Product code AXE132 is a standalone serialdriver board marked(axe133) complete with 18m2 and components which we can reuse to make a great project board its well priced ! just dont tell no one lol !
http://www.techsupplies.co.uk/epages/Store.sf/en_GB/?ObjectPath=/Shops/Store.TechSupplies/Products/AXE132
I'll proberly be banned for advertising lol!
:)

There's no problem with anyone coming up with innovative or alternative uses for our PCB's and the AXE132 does make a nice compact breakout board for the 18M2 which is included in the price.

I was wondering how many could be glued into a 19" rack mount case, but also wondering what anyone would do with so many if they did !
 
Top