GB2310935A - Digitally activated driver alarm device system for vehicles - Google Patents

Digitally activated driver alarm device system for vehicles Download PDF

Info

Publication number
GB2310935A
GB2310935A GB9604968A GB9604968A GB2310935A GB 2310935 A GB2310935 A GB 2310935A GB 9604968 A GB9604968 A GB 9604968A GB 9604968 A GB9604968 A GB 9604968A GB 2310935 A GB2310935 A GB 2310935A
Authority
GB
United Kingdom
Prior art keywords
timer
address
alarm
subroutine
sound
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Withdrawn
Application number
GB9604968A
Other versions
GB9604968D0 (en
Inventor
Christopher David Edworthy
Tony Stephen Osborn
Anthony Cornelius Sheehan
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Individual
Original Assignee
Individual
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Individual filed Critical Individual
Priority to GB9604968A priority Critical patent/GB2310935A/en
Publication of GB9604968D0 publication Critical patent/GB9604968D0/en
Publication of GB2310935A publication Critical patent/GB2310935A/en
Withdrawn legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G08SIGNALLING
    • G08BSIGNALLING OR CALLING SYSTEMS; ORDER TELEGRAPHS; ALARM SYSTEMS
    • G08B21/00Alarms responsive to a single specified undesired or abnormal condition and not otherwise provided for
    • G08B21/02Alarms for ensuring the safety of persons
    • G08B21/06Alarms for ensuring the safety of persons indicating a condition of sleep, e.g. anti-dozing alarms

Landscapes

  • Business, Economics & Management (AREA)
  • Emergency Management (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Electric Clocks (AREA)

Description

CONFIDENTIAL Digitally Activated Driver Alarm Device System for Vehicles DESCRIPTION FIELD OF THE INVENTION The present invention is concerned with a digitally activated alarm device system located in vehicles to alert drivers, particularly on long journeys, to the problems of fatigue. The alarm device system is fitted in the vehicle cab, within the drivels view and within easy access, and comprises a time-controlled sequence of increasingly noticeable visual and audible alarms that have to be reset periodically, but are easily reset by the driver. More usually the invention is suitable for drivers of vehicles such as long distance lorries, and for similar vehicles such as passenger coaches. But the invention is equally suitable for use in private cars by drivers who will either exceptionally, or, routinely, undertake what may be long and monotonous joumeys.
BACKGROUND OF THE INVENTION The invention incorporates a conventional microprocessor with a data processing function preferably a microcontroller such as the Phillips 87C750, of the kind described in EP 0 051 332, which has been chosen for reasons of availability and cost. It is an eight bit 80C51 based single chip microcontroller unit that has an integral 1KB (1000 byte) Erasable Programmable Read Only Memory (EPROM) and 64 bytes of Random Access Memory (RAM) in the form of registers.
Ideally, the microcontroller also has 19 Input I Output (110) lines, a 16 bit auto reload counter and a three source fixed priority interrupt structure. More particularly, the Phillips make of microcontroller as described in the Phillips' 80C51 based 8-bit microcontrollers handbook (book IC20), and, the manufactureis application notes for the same microprocessor, enable it to be congruent with the invention comprising and constituting the circuitry and the original software program hereinafter described. The said circuitry, the subject-matter of this invention, is devised and designed to provide the exact environment for the said original software program to function in it. Accordingly, the said hardware and software function only in the intended combination, whereas neither will function in any environment alien to them.
SUMMARY OF THE INVENTION It is an object of the present invention to provide a digitally activated alarm device system comprising a microcircuit congruent with an microprocessor, said microcircuit providing an exact environment for means to receive, retrieve, store, and process data stored in the said microprocessor (called the "fetch-execute cycle"), enabling the said microcircuit to activate and operate a timed sequence of light and sound alarm mechanisms. The first "retrieve or fetch" is performed shortly after microprocessor has had power applied. For a brief period after such power brief period after power has been applied, the reset input to the microprocessor is held in an active state. The timing of this event will be about 3 to 5 milli-seconds. After this has passed, the microprocessor is allowed to function correctly, and begins ifs function by fetching the first instruction from its memory at address 0000. The alarm device system in its operation will comprise a display and speaker unit mounted conveniently adjacent to a vehicle driver while the activating electronics housing may be mounted in any convenient location remote from the mechanisms for light and sound operation. The alarm device system will have a DC power supply of 12 or 24 Volts. This will conventionally be sourced from the vehicle's own power supply, although it will function just as well run from a conveniently located battery of the correct voltage. An AC power supply could be utilised, provided an adequate inverter, rectifier and/or smoothing circuit were connected between it and the alarm device system.
Initially the visual alarm mechanism will be activated, which consists of three pairs of lamps, illuminated in a sequence timed from the microprocessor in a pre-set sequence, once the vehicle's ignition switch is tumed on. For example, the first pair of lights are illuminated 10 minutes after the vehicle's ignition switch is turned on; the second pair after 15 minutes; and the final pair after 20 minutes. Five minutes later all the lamps start to flash at a rate of once per second. The microprocessor is programmed to progressively increase the light pattern so as to become noticeable to the driver, and be reset by him or her before the flashing stage is reached. It is an object of this intention that if the flashing stage is reached, the driver will be made aware that his or her concentration has suffered a lapse to a level where rest would be advisable.
The associated audible alarm is brought into operation by a driver operated switch to activate the microprocessor to activate the alarm function as follows: 1. Audible alarm off (alarm lamps only).
2. To sound as each pair of lamps is lit.
3. To sound only when the flashing stage is reached.
BRIEF DESCRIPTION OF ThE DRAWINGS The circuit diagram (Figure 1), shows diagrammatically the relationship between the microprocessor and the microcircuitry of this invention congruent with the same for the timed controlling of the light and sound functions of the alarm through the medium of the software stored within the said microprocessor as hereinafter described.
DETAILED FUNCTIONAL DESCRIPTION OF THE PREFERRED EMBODIMENTS Figure 1 shows diagrammatically how the alarm functions of the invention are activated by the microcircuitry by retrieving and processing data received from the microcontroller to perform the said "fetch-execute cycle". The microprocessor requires a single supply voltage of 5 volts supplied to it via pin 24 with the 0 volt line of the microprocessor connected to pin 12 of the said microcircuitry. A 35 Mhz (Mega Hertz) crystal is connected to pins 10 & 11 of the invention circuit to provide the necessary internal timing. A 22pF (Pico Farad) load capacitor is connected from each crystal pin to 0 volts for frequency stabilisation. The said microcircuitry of this invention contains two switches connected to the VO port 3 bits 4 & 5 on pins 1 & 23. These pins have no need for external pull up resistors because the microprocessor has these built in. The said resistors are enabled simply by writing a logic 1 to them. The other side of the switch is connected to 0 volts so that when the switch is closed it will short the input pin directly to 0 volts.
The said pins 10 & 11, (which are more particularly described in the context of the software disclosures made below), function is as follows: Switchl: Switch2: Function: Closed Closed LED Output Only (No Sound) Open Closed LED Output Then Sounder at end of complete cycle Closed Open LED Output and Sounder at all stages Open Open LED Output and Sounder at all stages A 2.2 uF (micro Farad) capacitor is connected from the reset pin (9) to 5 volts. This is to ensure that after power on the reset line is only allowed to go low (ie enable the processor) after the power supply has stabilised and the crystal oscillator is functioning correctly.
The restart button is connected between the InterruptO input (pin 18) and 0 volts. It is a simple single pole normally open push button. There is no need to provide a de-bounce circuit as multiple interrupt triggers will have no effect other than to slow the operation by a few machine cycles. The interrupt input (interrupt 0) is edge triggered so it does not matter for how long the button is held in.
The LED drive outputs from the microprocessor are through VO Port 3 on the device circuity.
VO Port 3 bits 0, 1 & 2 are on pins 5, 4 & 1 respectively. These output pins are connected to the LED's through an open collector invertor buffer driver chip IC3 a TTL 74LS06. This buffer chip serves several purposes, ie providing an electronic buffer to protect the microprocessor and serving as a current amplifying device to provide (if necessary), the current necessary to illuminate two remotely connected LED's brightly. This integrated circuit requires a single supply of 5 volts on pin 14 and 0 volts on pin 7.
The only other output used is to enable the tone generator circuit. This is also from VO Port 3. Bit 3 is on pin 2 and is connected directly to the tone generating circuit. The tone generator IC2 is a simple NE555 timer connected as an oscillator. The enable pin is in fact the reset pin (8). When pin 4 is held low, the timer is in a reset mode to stop it oscillating. When this signal is set high (ie output a logic 1 from Port 3 bit 3 on the microprocessor), the alarm device is enabled and tone generator IC2 will oscillate at a frequency determined by its timing components R1, R2, VR1 & C1. VR1 is provided to the tone generator IC2 so that the tone frequency can be adjusted if required. It will oscillate only for as long as the enable signal stays at logic 1. The NE555's output is connected to the base of a PNP transistor TR1, (point 2 in the drawing) through resistor R6. The transistors' emitter is connected to ground at 1 and to its collector 3 via the speaker to +12volts. The transistor TR1 has two functions, first, to provide a buffer between the oscillator and the speaker and secondly to allow the speaker to be driven from the 12v supply in order to obtain more volume. Transistor TR1 is used as a simple current amplifying device.
The LED's are connected in pairs from the +12 volt supply through resistors R3, R4 & R5 to the outputs of IC3. The software, at the correct point, will output a logic high from each of the bits 0, 1 & 2 this high signal is then input to IC3, a hex inverter type 74LS06. Each gate will, being an inverter, output a logic 0 to the LED's connected to it and in turn allow current to flow from the 12 volt supply through the LED to ground. The LED's are accordingly illuminated.
The only other components on the said device are the power regulation devices IC4 & IC5 and their associated stabilising components. IC4 produces a stable 5 volt supply from the 12 volt vehicle electrical supply. IC5 provides a stable 12 volt supply from a 24 volt coach or lorry electrical supply. Capacitors C5 to C10 inclusive are for smoothing and regulator stabilisation. If the said NE555 timer is to be powered from a 12 volt electrical system the supply is connected to point +12IN and ground. If fitted to a 24 volt system the supply will be connected to point +24IN and ground. The exposed parts of the said device will be isolated from the power supply to permit operation in a positive ground vehicle. In such circumstances the power supply connections to the timer are reversed.
It will be appreciated that the functions of the microcircuitry of this invention although useless in the application of any program other than the program hereinafter described, will provide exactly the correct signals at the correct points to provide the user of this invention with all required information, be it audio or visual.
DETAILED DESCRIPTION OF DATA FlAC-l lON Data is provided to the alarm device system via the microprocessor where it is stored for subsequent operations. To enable the data to be input in conjunction with the software program integrated into the microprocessor, a detailed description of each of the Mnemonics used below is to be found in the Phillips 80C51 based 8 Bit Microcontrollers handbook (book IC2O).
The MAIN PROGRAM of the invention listed under the heading below is loaded into the Phillips 87C750's internal EPROM memory by means, for example, of the Phillips DS-750 Microcontroller development tool. This tool also includes an assembler for turning the code below into the hex values required for programming. Loading the MAIN PROGRAM thereon will enable the program instructions to be obeyed in sequence.
DETAILED DESCRIPTION OF PROGRAMMING OPERATION Registers (RO - R7) are set to oOh at power up. VO Ports are set at OOh at power up.
The code starts from the power up / reset start address of 0000h (h=Hexadecimal-base 16, d-Decimal-basel0, b-Binary-base 2). The first command at address 0000h is a short jump to the main code. This is required because the interrupt 0 service address used by the restart button mounted adjacent to the driver is 0003h. The NOP instruction at address 0002h is never executed and is just there to fill the byte. The code that starts at address 0003h firstly changes the value in Register 7 from OOh to 01h. This 01h is looked for later in the text and if detected (ie the driver has pressed the restart button) then the program branches back to the beginning. Next, at address 0005h the LED's are extinguished and the speaker is disabled by writing a 30h to port 3. This routine will be used only when the driver presses the restart button, the LED's and speaker being turned off straight away to acknowledge that the button has been pushed. At address 0008h a retum from interrupt instruction (REII) is executed to return program control to the instruction following that which had been executed before servicing the interrupt.
The MAIN PROGRAM begins at address 0010h. The internal counter / timer mode is set to count the processor clock pulses.
Next, at address 0013h the processor executes a subroutine called Flash. The purpose of this routine is to flash the LED's on for one second then off again. This is executed at this time to turn on all the LED's and show the user that they are all working correctly, as no other T LED test is provided. This subroutine is described in further detail later in this section.
Next, at address 0016h, a subroutine named Beep is called. The purpose of this is to sound the tone generator for one second and then turn it off again. This is executed at this time to confirm that the generator is working. This subroutine is described in detail later in this section.
At address 0019h the interrupt input signal interrupt 0 is enabled. This is done by setting high two bits in the interrupt enable register at Address OA8h. The first bit enables the interrupt system, the second enables interrupt 0 only. AT 00lCh a high is output to Port 1 bit 5. This is the actual 110 pin that interrupt 0 is input. It is set high as its power on default value is low.
By setting it high it allows itself to be intemally held high by a resistor. This removes the need for an external pull up resistor.
Address 001Eh is the 'Restart' address for the program to which the program execution is sent after the driver has pressed the restart button. The first operation is to reset anything that may have been left on or at the wrong value. Therefore at address 001Eh any LED's that may be on are tumed off and the tone generator circuit is disabled by outputting a 30h to port 3. Then at address 0021h Register 7 is reset to Olh when the button is pressed by the interrupt 0 service routine at address 0003h.
Address 0025h calls the main timer subroutine. It loops program execution until it has timed out R5 number of minutes. Thus at address 0023h R5 is set to OAh (or 10 decimal). This 10 minute initial wait can be changed and will be determined after field trials have taken place.
After executing this subroutine (Timerl) the programme then compares R7 against OOh at address 0028h to determine whether the interrupt 0 subroutine has been run, ie if the button has been pressed by the driver. The program will branch back to the 'restart' location if R7 is different to OOh, ie been set to 01h.
If R7 is still OOh then program execution continues with location 002Bh. To turn on the first pair of (green) I LED's. This is done by OR'ing the contents of port 3 with 01h. This means that the contents of port 3 stay the same except that the first bit (0) will be set high. The circuit associated with the LED's is discussed under the hardware functional description above.
At address 002Eh the 'Readswitcb' subroutine is called to read the positions of the two switches as described under the above hardware function section. The state of the switches is left in bits 0 & 1 of the Accumulator. A complete description of the 'Readswitch' subroutine is provided under the heading below in this section. The instruction 'JZ NoBeep:' at address 0031h will jump straight to the NoBeep location if the Accumulator is OOh, ie the switches are both closed ( no Sound). If the Accumulator is set to 01h (OOh after being decremented at address 0033h) then again at address 0034h it will jump to the NoBeep location as the switches were open - closed. This means that the beep only sounds at the end of the program.
If the program gets to execute address 0036h then the switches must be set to enable the beep with every illumination of the LED's. Therefore the 'Beep' subroutine is called to sound the tone generator for one second. After this the program returns to address 0039h or 'NoBeep'.
R5 is now reset to 5 which is the number of minutes that the 'Timerl' subroutine (called at address 003Bh) has to wait for.
On return from the Timerl' subroutine a check is made to see if the restart button has been pressed (at location 003Eh). If R7 is set to 01h by the interrupt service subroutine the program will branch back to the restart location (OOlEh). If not set then the orange LED's are lit by OR'ing the contents of Port3 with 03h at address 0041h.. This leaves the contents of port3 as it was except for setting high bits 0 and 1. Bit O (green LED's) will still be high.
At address 0044h the 'Readswitch' subroutine is called again. The instruction 'JZ NoBeepl:' at address 0047h will jump straight to the 'NoBeepl' location if the Accumulator is OOh, ie the switches are both closed ( no Sound). If the Accumulator is set to 01h (OOh after being decremented at address 0049h) then again at address 004Ah it will jump to the 'NoBeepl' location as the switches were open - closed. This means that the Beep will only sound at the end of the program. If the program gets to execute address 004Ch then the switches must be set to enable the beep with every illumination of the LED's. Therefore the 'Beep' subroutine is called to sound the tone generator for one second. After this the program returns to address 004Fh or 'NoBeepl'. R5 is now reset to 5 which is the number of minutes for which the 'Timerl' subroutine (called at address 0051h) has to wait.
On return from the 'Timeri' subroutine a check is made to see if the restart button has been pressed (at location 0054h). If R7 is set to 01h by the interrupt service subroutine the program will branch back to the restart location (OOlEh). If not set then the red LED's are lit by OR'ing the contents of Port3 with 07h at address 0057h. This leaves the contents of port3 as it was except for setting high bits 0, 1 and 2. Bits 0 and 1 (green and orange LED's) will still be high.
At address 005Ah the 'Readswitch' subroutine is called for the third time. The instruction 'JZ NoBeep2:' at address 005Dh will jump straight to the 'NoBeep2' location if the Accumulator is OOh, ie the switches are both closed ( no Sound). If the Accumulator is set to 01h (OOh after being decremented at address 005Fh) then again at address 0060h it will jump to the 'NoBeep2' location as the switches were open closed. This means that the 'Beep' only sounds at the end of the program. If the program gets to execute address 0062h then the switches must be set to enable the beep to sound with every illumination of the LED's. Therefore the 'Beep' subroutine is called to sound the tone generator for one second. After this the program returns to address 0065h or 'NoBeep2'. R5 is now set to 5 which is the number of minutes for which the 'Timerl' subroutine (called at address 0067h) has to wait.
On return from the 'Timerl' subroutine a check is made to see if the restart button has been pressed (at location 006Ah). If R7 is set to 01h by the interrupt service subroutine the program will branch back to the restart location (OOh). If still not set then the switch positions are again read at location 006Dh. If the switches are still set to closed - closed (LED's only - no sound) then the program jumps to the 'KeepFlashing' location 0075h. If the switches are other than closed - closed then the tone generator must be enabled until the restart button is pressed. This is done at location 0072h by setting port 3 bit 3 high. By OR'ing the contents of port 3 with 08h the data already written there will remain the same (ie all LED's on) as well as enabling the tone generator on bit 3.
The program proceeds to the 'KeepFlashing' location 0075h to call the 'Flash:' subroutine. This turns all the LED's off for one second then on for one second then back off again before returning. The program returns to location 0078h where R7 is again checked to see if it is set to Olh. If it is then the restart button has been pressed and the program is branched to the 'Restart' location 001Eh. If R7 is still oOh then a short jump instruction is executed to the 'KeepFlashing' location 0075h. This has the effect of continuing to flash the LED's with the tone generator on until the restart button is pressed.
Subroutines.
Listed in order of use.
1. Flash: This subroutine is only used at the start and end of the MAIN PROGRAM to light the LED's.
It turns them off and waits for 1 second then lights them for a second so that, after power is on, the.user can check their operation. It is used at the end of the MAIN PROGRAM to attract the attention of the driver.
This subroutine runs as an endless loop at the end of the program to keep flashing the LED's until the restart button is pressed. It is used with or without the tone generator depending on the state of the switches SW1 and SW2 This subroutine originates from location 0100h and is started by loading the on-chip 16 bit autoreloadable counter/timer circuit with the values calculated by the formula shown below to give a one second delay. The processor clock runs at 3.5 MHz (Mega Hertz). The formulae is to be found in the reference book IC20.
Osclllator Frequency (3.500.000) Timer~Value - 65535 - 384 * 1 SEC From the above formulae it is possible to calculate that the Timer must be setup with 56,421 or DC65 in Hexadecimal for a 1 second delay.
The value DC65h is loaded into the timer by splitting the number into high and low bytes (DCh & 65h). The value DCh is loaded into the Timer High Byte and the value 65h is loaded into the Timer Low byte. After being set up and enabled the counter timer will decrement this number until it reaches zero at which time the Timer Flag bit is set. Therefore when the Timer Flag bit is set a period of 1 second will have elapsed from enabling. By also loading the same value into the reload bytes (Reload Timer High & Reload Timer Low) the timer/counter circuit will be made to loop count continuously while enabled.
Program locations 0100h to 0109h load the timer high and low bytes. At address O1OCh the Timer Flag bit is cleared, should it be already set. Next at address O1OEh the Timer Run bit is set high enabling the timer. The LED's are turned off at location 0110h, should they be on, by AND'ing the contents of Port 3 with F8h. This has the effect of tuming off the lower three bits (0,1 & 2) without changing the state of port 3.
The instruction at location 0113h thus loops around waiting for the Timer Flag bit to be set, when this occurs the loop is interrupted and program execution continues with instruction 0116h resetting the Timer Flag bit to zero. At location 0118h the restart button is checked to see if it has been pressed (by testing R7 for 01h). If R7 - 01h then the rest of the subroutine is passed by jumping to the 'Endflash' location. If R7 is not equal to 01h the program continues at address O11Bh and turns on the LED's by OR'ing Port 3 with 07h. At location 011Eh the program loops around again waiting for the Timer Flag to be set, at which time the loop is interrupted and the program proceeds to address 0121h. At this address the LED's are extinguished by AND'ing port 3 with F8h again. Address 0124h resets the Timer Run bit to disable the timer and finally, at location 0126h, the program returns from this subroutine to the location following that which called the subroutine.
2. Beep: This subroutine enables the tone generator for one second and then tums it off again. As discussed in the hardware description the tone generator is enabled by setting port 3 bit 3 high.
The tone generator is disabled as soon as this signal is set low.
The subroutine originates at location 0140h. The locations 0140h - 0149h are used to set up the timer high and low bytes as well as the reload bytes. The values to which they are set are discussed fully in the Flash subroutine technical description. At address 014Ch the Timer Flag bit is reset. At address 014Eh the program sets the Timer Run bit thus enabling the timer. R7 is then checked to see if the restart button has been pressed. If it has the rest of the subroutine is bypassed by jumping to the 'EndBeep' location 015Eh. If R7 is still oOh then program execution continues with Location 0153h to set port 3 bit 3 high by OR'ing port 3 with 08h. At address 0156h the program loops around waiting for the Timer Flag bit to be set. When the TF bit is set the program execution drops out to address 0159h where the Timer Flag bit is then reset. At location 015Bh port 3 bit 3 is reset to zero by AND'ing the port with F7h.
At location 015E or 'EndBeep' the Timer Run bit is reset to disable the timer before returning, at address 0160h, to the location following that which called the subroutine.
3. Timer: Timerl is a subroutine used as the main timer. It loops around, counting 1 second intervals timed by the on-chip counter timer. The subroutine counts for 60 1 second intervals and then repeats this minute loop a number of times as specified by Register 5. Register 6 is also used in the subroutine as the one minute counter.
This subroutine originates at location Or80h. At the start address the second counter is set up to be 60 decimal, ie, 1 minute. Addresses 0182h to 018Bh are the same as the start of the flash subroutine that set up the on-chip counter timer to count system clock cycles to generate a delay of one second. Location 018Eh clears the Timer Flag should it be still set from previous use of the counter timer. Next, at address 0190h the timer is started by setting the Timer Run bit high.
The instruction at location 0192h or the 'wait' location is the main one second delay loop. The program loops back to the same instruction waiting for the Timer Flag to be set. This Timer Flag is set by the internal counter timer circuit when the count reaches zero (1 second - see the flash subroutine for details). When the Timer Flag bit is set, the program drops out of the loop to instruction 0195h. Here the Timer Flag bit is cleared. Then at location 0197h R7 is checked to see if it 01h (ie - has the restart button been pressed). If it is set to 01h the rest of the subroutine is bypassed by jumping to the 'Endtimerl' location. If R7 is still OOh then program execution continues at 019Ah. Here the instruction DJNZ Wait: decrements Register 6 (the second counter) and then jumps to wait for one second again if Register 6 is Not Zero. When Register 6 is zero (ie after 60 x 1 second loops - 1 minute) the program drops out of this loop and executes instruction 019Ch. At this location the second counter (R6) is reset to 60 (1 minute). Next at address 019Eh a similar command decrements Register 5 and retums execution to the wait loop.
Thus the whole wait 1 minute procedure is repeated until register 5 becomes zero, ie the subroutine has looped around R5 number of minutes.
Finally at location O1AOh or 'Endtimerl' the on-chip counter timer circuit is stopped by resetting the Timer Run bit to zero and at location 01A2h program execution is returned to the location following that which called the subroutine.
4. Readswitch: This subroutine reads the positions of SW1 and SW2 into port 3 bits 4 & 5. As shown in the technical description of the hardware these switches are arranged to provide a series of high and low voltages into VO port 3 bits 4 & 5. These voltages are read as a number into port 3. This number could be OOd, 16d, 32d or 48d, and is converted, by swapping bits 4 & 5 to 0 & 1, into OOd, Old, 02d or 03d. Only 0Od, Old & 02d are used, 03d will have the same effect as 02d.
The program originates at address O1COh. At the start address a binary mask to blank out all bits other than 4 & 5 is loaded into the Accumulator. This mask is then used, at address 01C2h to AND into the Accumulator just the two switch inputs, bits 4 & 5. At address 01C4h the upper and lower nibbles are swapped over leaving bits 4 & 5 in the positions of bits 0 & 1. Finally, at address 01C5h, program execution is returned to the location following that which called the subroutine.
Main Program for Timer.
This is the main program code for the Timer. Reset address is 0000 at which the code starts.
External Interrupt 0 is connected to the vehicle driver restart button. The first operation is to jump around its service vector address of 0003h (see note below). After performing tests for the leds and tone generator, the Enable all and the external interrupt 0 bits are set in the IE register.
P3 is Input I Output (VO) port 3 which is connected to the leds and controls the tone generator.
P3 is at address OBOh. Tcon is the timer control register and is at address 088h Bits 7 & 8. There are 8 general purpose registers numbered RO - R7. Although only 3 of them, R5, R6 and R7 are used.
Bit References.
Bit references used are:- TF - Timer Flag = Address 088h bit 6, TR = Timer Run = Address 088h bit 5, INTO = InterruptO = Address 095h.
Byte References.
Byte references used are TH & TL = Timer High & Low = address 08Ch & 08Ah, RTH & RTL = Reload Timer High & Low = Address 08Dh & O8Bh, IE = Interrupt Enable = OA8h.
A note about External Interrupt 0.
Early in the following code the External InteruptO signal is enabled. This, as discussed in the technical section, is connected to a push button mounted near the vehicle driver. Therefore this interrupt could be input at any time after it has been enabled. At which time the internal processor hardware finishes executing the current instruction and then forces the program execution to the external Interrupt 0 Service Vector address of 0003h. Program is executed from this address until a RETI (Return from Interrupt) instruction is encountered, after which program execution returns to the location following the location that was being executed when the interrupt signal was input.
MAIN PROGRAM Addr.Label.Code.Comments 0000SJMP Start:;Jump around Interrupt vector address 0002NOP,Just to fill byte 2 not used 0003Int0~vector:MOV R7,01h;set Register 7 to indicate interrupt done- ;ie restart button pressed by driver.
0005MOV P3,#30h;Turn off any LED's that are on and the ;tone generator, output highs to the ;switch inputs bits 4 & 5 for pull up.
0008RETI;Return from interrupt service routine 0010Start:ORL Tcon,#OO;Set timerO control to timer mode, ;internal clock, software control.
0013LCALL Flash:;Jump to flash Leds subroutine. This is ;to show they all work at power on. ;They flash on once for one second 0016LCALL beep:;Jump to Beep subroutine. This is ;to show the tone generator circuit works ;at power on. It beeps for one second.
0019MOV lE,#81h;Enable all int + external interrupt 0.
001CSETB WI0;set interrupt 0 input (Portl bit 5) high 001ERestart:MOV P3,#30h;output to port 3 00 to ensure LED's off, ; & Speaker off 0021MOV R7,#OOh;reset Register 7 - just in case this ;address was reached after an interrupt.
0023MOV R5,#OAh;Load R5 with the number of minutes to ;time for ie. 10 Minutes.
0025LCALL Timerl:;Jump to timer subroutine. This routine ;loops program operation for R5 number ;of minutes.
0028CJNE R7,00h,Restart: ;If interrupted (driver pressed restart ;button) ie R7-1 then goto restart 002BORL P3,#01h;Turn on the Green Leds. ie Completed ;the first delay OO2ELCA1 Readswitch:;Read the switches on port 3 bits 4 & 5.
0031JZ NoBeep:;If switches say Leds only dont beep 0033DEC A; } see if switches are set to 01 0034JZ NoBeep:; } ie Leds then beep - dont beep yet.
0036LCALL Beep:;Switches must be leds and beep, so ;beep Addr Label Code Comments 0039NoBeep:MOV R5,#OSh; Set minute timer to 5 minutes. Second ;pass 003BLCALL Timerl:;Go and wait R5 minutes (5) 003ECJNE R7,00h,Restart: ;If interrupted (driver pressed reset ;button) ie R7-1 then goto restart 00410RL P3,#03h ;Turn on orange leds, ensure green still ;on 0044LCALL Readswitch:;Read switches on port P3 bits 4 & 5 0047JZ NoBeepl:; repeat loop as above ie Leds only 0049DEC A; } See if switches are set to 01 004AJZ NoBeepl:; } ie Leds then Beep - dont beep yet 004CLCALL Beep:;Switches must be leds and beep, so ;beep 004FNoBeepl:MOV R5,#05h;Set timer to wait 5 minutes. Third pass 0051LCALL Timerl:;Go and wait R5 minutes (5) 0054CJNE R7,00h,Restart: ;If interrupted (driver pressed reset ;button) ie R7C1 then goto restart 00570RL P3,#07h ;Turn on red leds, ensure green and ;orange still on.
005ALCALL Readswitch:;Again !! oO5DJZ NoBeep2:;See if switches are 00 ie leds only oOSFDEC A; }See if switches are 01 ie 0060JZ NoBeep2:; } leds then beep - dont beep yet 0062LCALL Beep:; Switches must be leds and beep, so ;beep 0065NoBeep2:MOV R5,#05h; Reset minute counter to 5 minutes 0067LCALL Timerl:;Go and wait R5 minutes (5) 006ACJNE R7,00h,Restart: ;If interrupted (driver pressed reset ;button) ie R7=1 then goto restart 006DLCALL Readswitch:;Read switches for the last time 0070JZ KeepFlashing:;If switches still 00 then dont beep flash ;leds until reset.
00720RL P3,#08h;Set enable high for beep circuit ie beep. ;Then flash leds 0075KeepFlashing:LCALL Flash:;flash leds on for 1 sec. and off for 1 ;sec.
0078CJNE R7,00h,Restart: ;If interrupted (driver pressed reset ;button) ie R7=l then goto restart 007BSJMP KeepFlashing:;jump around in loop flashing leds.
End of main program.
Subroutines.
listed in order of use.
1. flash: The purpose of this subroutine is to wait for one second, then turn on all the leds and wait a further second before turning them off again. It is used at the start of the program to show all the leds work, and again at the end if silent mode (leds only) is selected to attract the drivers attention.
No registers are affected. Bit TF - Timer Flag = 08Dh, Bit TR= Timer Run - 08Ch, Bytes TL & TH are Timer High and Timer Low. The Leds are connected to Port3 bits 0,1 & 2.
Addr. Label Code Comments 0100 MOV TH,#DCh ; }load timer with 1 sec count 0103 MOV Th,#65h ; } 0106 MOV RTH,#DCh ; }reload value for TH & TL registers 0109 MOV RTL,#65h ; }to run continuously 010C CLR TF ; Clear timer flag bit just in case it is set ;already.
010E SETB TR ;Set Timer to Run ie Start.
0110 ANL P3,#F8h ;Turn off LED's first if on 0113 Waitl: JNB TF,Waitl: ;if not timed out yet jump to recheck ie ,måt for the timer to time out.
0116 CIR TF ;When timed out reset timer flag bit 0118 CJNE R7,#00h,Endflash: ;see if restart button pressed OliB ORL P3,#07h ;Toggle on ALL leds.
OllE Wait2: JNB TF,Wait2: ; now wait 1 second with leds on 0121 ANL P3,#F8h ; Turn off leds leave on beep if set.
0124 Endflash: CIR TR ;Stop Timer ie reset timer run bit.
0126 RET ;Return from flash subroutine, End of flash subroutine Subroutines Continued...
2. Beep: The purpose of this subroutine is to enable the output of the tone generator circuit via VO bit 3 on PORT 3. This pin is set high for one second then reset low. Other timings can be produced by modifying the Timer High and Low bytes TH & TL. The frequency of the tone is set by VR1 on IC2. No registers are affected.
Addr Label. Code Comments 0140 MOV TH,#DCh ; }Reset timer for 1 sec delay 0143 MOV Th,#65h ; } 0146 MOV RTH,#DCh ; }Reload values for TH & TL registers 0149 MOV RTL,#65h ; }to run continuously 014C CLR TF ;Clear the TF bit just in case 014E SETB TR ;set Timer Run bit high ie start timer 0150 CJNE R7,#00h,EndBeep: ;Check to see if restart button;hasbeenpased - bypass if so 0153 ORL P3,#08h ; Output Port3 bit 3 high (enable beep) 0156 Wait3: JNB TF,Wait3: ; Wait for timer to time out ie 1 second.
0159 CLR TF ;Clear Timer Flag Bit after use.
015B ANL P3,#F7h ;reset bit 3 port 3 - leave others alone.
015E EndBeep: CLR TR ;reset Timer run bit is Stop timer 0160 RET ;Return from beep subroutine.
End of beep subroutine.
Subroutines Continued...
3. Timer: The purpose of this subroutine is to time a number of minutes as set by register R5. The contents of R6 is destroyed, R5 is reset to zero. It uses the 1 second timer 60 times to produce a 1 minute timer. This 1 minute timer is repeated R5 number of times.
Addr Label Code Comments 0180 MOV R6,#60d ;Set R6 to 60 decimal- (seconds per ;minute) 0182 MOV TH,#DCh ; } set timer to 1 second delay 0185 MOV Th,#65h ; } 0188 MOV RTH,#DCh ; } set reload value of timer to 1 sec 018B MOV RTh,,#65h ; } ie free run @ 1 second delay.
018E CLR TF ; Clear Timer Flag Just in case 0190 SETB TR ; Start timer running 0192 Wait: JNB TF,Wait: ;Wait till time out ie 1 second 0195 CLR TF ; Clear Timer Flag after set 0197 CJNE R7,#00h,Endtimerl: ;Check to see if restart button has; b e e n pressed - bypass if so 019A DJNZ R6,Wait: ;loop to lsecond delay until R6 - O ie ;1 minute 019C MOV R6,#60d ;reset second counter to be 60 (1 minute) 019E DJNZ RS,Wait: ;loop around minute counter for R5 mins 01A0 Endtimerl: CLR TR ;Stop Timer running 01A2 RET ;End of timerl subroutine End of timer Subroutine.
Subroutines Continued...
4. Readswitch: The purpose of this subroutine is to read in the value of two switches which determine the mode of output. The switches are connected to Port3 bits 4 and 5. The two bits are swapped into bits 0 & 1 and left in the accumulator. The result, after this subroutine has been completed is to leave a number from 0-3 in the accumulator. The number is determined elsewhere to mean the following: 00 - LEDS only - beep at all, 01 - LEDS first then beep at the end only, 02 - LEDS and beep all the time. 03 has the same result as 02. The accumulators contents is destroyed.
Addr Label Code Comments 01CO MOV A,#O0110000b ;Mask for the switch inputs only 01C2 ANL A,P3 ;AND mask against switch inputs 01C4 SWAP A ;Swap bits 4 & 5 to bits 0 & 1 01C5 RET ;return from readswitch subroutine.

Claims (6)

1. In combination in a data processing system a digitally activated alarm device system located adjacent to the driving position within vehicles comprising a microcircuit to act as principal to a microprocessor with data processing function congruent with the said microcircuit; said microprocessor being typically an eight bit based single chip microcontroller; said microcircuit including means for enabling the same to retrieve data from the said microcontroller and storing and processing the same to activate light and sound alarm mechanisms within the proximity of a vehicle driving position; means for retrieving, storing, and processing data to operate a timed sequence of lighting warning displays; means for retrieving, storing, and processing data to operate a timed sequence for sound alarms to be emitted by way of speaker units located within the said microcircuit; the said microcircuit including means to provide electrical protection to the said microcontroller by an electronic buffer.
2. An apparatus in combination as in Claim 1 wherein a microcircuit functions as a data processing system for retrieving, storing and processing data.
3. An apparatus as in Claim 1 comprising an alarm device system with a display and speaker unit mounted conveniently adjacent to a vehicle driver while the activating electronics housing may be mounted in any convenient location remote from the mechanisms for light and sound operation.
4. An apparatus as in Claim 1 comprising an alarm mechanism consisting of three pairs of lamps, for illuminated in a programmed pre-set sequence; an associated audible alarm activated manually; means for switching function is as follows: Switchl: Switch2: Function: Closed Closed LED Output Only (No Sound) Open Closed LED Output Then Sounder at end of complete cycle Closed Open LED Output and Sounder at all stages Open Open LED Output and Sounder at all stages means incorporating a 2.2 uF (micro Farad) capacitor to control power on the reset line and crystal oscillator function; means for restart of timed alarm sequence; means to control LED drive outputs from the said microprocessor; means to generate tones in timed sequence including means to emit said tones.
5. An apparatus as in Claim 1 incorporating an audible alarm activated by a driver operated switch to activate the microprocessor to activate the alarm function as follows:
1. Audible alarm off (alarm lamps only).
2. To sound as each pair of lamps is lit.
3. To sound only when the flashing stage is reached.
6. A data processing system constituted according to Claim 1 and adapted to operate substantially as herein described with reference to the accompanying drawings.
6. An apparatus according to Claim 1 wherein original software onloaded onto a suitable microcontroller activates said microcircuit enabling the same to retrieve store and process data from the said microcontroller to operate a timed sequence of lighting warning display as aforesaid.
GB9604968A 1996-03-08 1996-03-08 Digitally activated driver alarm device system for vehicles Withdrawn GB2310935A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
GB9604968A GB2310935A (en) 1996-03-08 1996-03-08 Digitally activated driver alarm device system for vehicles

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
GB9604968A GB2310935A (en) 1996-03-08 1996-03-08 Digitally activated driver alarm device system for vehicles

Publications (2)

Publication Number Publication Date
GB9604968D0 GB9604968D0 (en) 1996-05-08
GB2310935A true GB2310935A (en) 1997-09-10

Family

ID=10790095

Family Applications (1)

Application Number Title Priority Date Filing Date
GB9604968A Withdrawn GB2310935A (en) 1996-03-08 1996-03-08 Digitally activated driver alarm device system for vehicles

Country Status (1)

Country Link
GB (1) GB2310935A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0932055A2 (en) * 1998-01-21 1999-07-28 Oxford Instruments Limited NMR sensor
WO2000052659A1 (en) * 1999-03-01 2000-09-08 Gotauco Thomas A Apparatus and method to stimulate a sleepy driver
US6215304B1 (en) 1998-01-21 2001-04-10 Oxford Instruments (Uk) Ltd. NMR sensor

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB1332176A (en) * 1971-11-23 1973-10-03 Dynamic Technology Ltd Lighting control apparatus
GB2143966A (en) * 1983-07-26 1985-02-20 Stephen Day Electronic apparatus for switching at predetermined times
US4879542A (en) * 1988-08-24 1989-11-07 Elsey Adrian C Alarm systems
US5012226A (en) * 1990-02-23 1991-04-30 Love Samuel D Safety alertness monitoring system
US5402108A (en) * 1993-03-08 1995-03-28 Just Right, Inc. Driver alerting system

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
GB1332176A (en) * 1971-11-23 1973-10-03 Dynamic Technology Ltd Lighting control apparatus
GB2143966A (en) * 1983-07-26 1985-02-20 Stephen Day Electronic apparatus for switching at predetermined times
US4879542A (en) * 1988-08-24 1989-11-07 Elsey Adrian C Alarm systems
US5012226A (en) * 1990-02-23 1991-04-30 Love Samuel D Safety alertness monitoring system
US5402108A (en) * 1993-03-08 1995-03-28 Just Right, Inc. Driver alerting system

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0932055A2 (en) * 1998-01-21 1999-07-28 Oxford Instruments Limited NMR sensor
EP0932055A3 (en) * 1998-01-21 2000-06-07 Oxford Instruments Limited NMR sensor
US6215304B1 (en) 1998-01-21 2001-04-10 Oxford Instruments (Uk) Ltd. NMR sensor
WO2000052659A1 (en) * 1999-03-01 2000-09-08 Gotauco Thomas A Apparatus and method to stimulate a sleepy driver
US6188312B1 (en) 1999-03-01 2001-02-13 Thomas Gotauco Apparatus and method to stimulate a sleepy driver
US6900722B1 (en) 1999-03-01 2005-05-31 Thomas Gotauco Apparatus and method to enhance motor vehicle safety

Also Published As

Publication number Publication date
GB9604968D0 (en) 1996-05-08

Similar Documents

Publication Publication Date Title
US5054569A (en) Remote vehicle starting system
JPH03504904A (en) Electronic parking meter system
US4855723A (en) Audio-visual alarm system with address display
EP1031480B1 (en) Vehicle usage control and security apparatus
MXPA06004083A (en) Vehicle disablement system user interface.
GB2310935A (en) Digitally activated driver alarm device system for vehicles
KR960042510A (en) LCD Power Sequential Control
JP6231053B2 (en) Game machine
US5245312A (en) Self-timer operation informing device
JP2002052149A (en) Illumination controller for game machine
KR950009364Y1 (en) Micom control circuit in alarm watch
US5602521A (en) Electronic device with light
KR100390181B1 (en) The control system for signal light
JP2015178033A (en) Game machine
JP2004121677A (en) Game machine
JP2000310690A (en) Electronic timepiece with timer function
JPH11157387A (en) Own vehicle recognizing device
KR200224793Y1 (en) Device for display on and off time of signal lamp
KR200319110Y1 (en) Apparatus for controlling crosswalk lamps
KR940006507Y1 (en) Exposure controller of decorating case in electronic clock
JPS5950544B2 (en) Automotive instrument panel lighting system
US4939709A (en) Electronic visual display system for simulating the motion of a clock pendulum
JP6395758B2 (en) Game machine
JP2639382B2 (en) Pachinko machine
KR960008649A (en) Traffic light control device and method

Legal Events

Date Code Title Description
WAP Application withdrawn, taken to be withdrawn or refused ** after publication under section 16(1)