DONATE
MESSAGE
V. I. N. N. A. R. I. A. N.
Vast Integrated Numerously Notated Assembler Routines Interfacing Accessible Numerics


     My YouTube videos are not intended for entertainment.  Most do not have audio, music, or voice-over; what you will find is valuable information.  They should be paused and read often.  While on the video’s page you will find a code that can be used to download the source code if it is available.  All of my files contain copyrights and were designed and built solely by me.  They are presented here as DIY educational material under the protection of copyright law.  I retain all rights reserved for myself to build devices containing these program routines for resale.  I grant limited personal use to individuals to build devices for themselves only [No Resale].  I will offer pre-programmed chip for Resale.
MORE OPTIONS ON OTHER SIDE
          Electronics  
Website Design  
Writing Stories 
            Anything Blog 
          Mathematics  
Avionics 
Physics 
           Science Blog 
     This menu system is still under construction.
     The Normal window scroll bar has been replaced with my scroll reader-bar.  The middle button will stop and restart the window scrolling.  Also clicking on the screen will work just like the middle button.  The the lower most button is 4 times faster then the button above it.  The same for the upper buttons.  Top or outer most buttons are faster than the next button inward.  I designed this by covering the normal scroll bar with a new button over lay.
Then added code to control the window.

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
     Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.      Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

The end!

Building A High Security Digital Lock
Part 1
Posted
Blinking An LED The Correct Way!  
Part 2
Not Ready
How To Use Timer0 Flag and LED Flags  
Part 3
Not Ready
Building The Key Pad Matrix  
Part 4
Not Ready
Storing Keystrokes  
Part 5
Not Ready
Coding Our Own Serial Port  
Part 6
Not Ready
Using Serial Port To Display A Key  
Part 7
Not Ready
Sending Key Data To Another MCU  
OPEN MENU
CLOSE UP
 
DIY Technician's Equipment  
Go To
Posted
Power & Programming Adapter For PICkit 3  
Go To
Not Ready
 
Go To
Not Ready
 
OPEN MENU
CLOSE UP

    Posted
Part One - Build A High Security Digital Lock
YouTube
Blinking An LED The Correct Way!
Access Code: On YouTube Video
View

      In this video I will show the code used to blink 4 LEDs from anywhere within the whole MCU program without calling any routines.  This code does not produce delays that can block other functions from correctly operating.  It is simple to use and manipulated from any routine in the MCU.  This source code is made of 4 parts for this lesson: the first 3 will be common to all of my machine code program constructions.

The first 3 are: [common files]
      The [body.asm] which holds the PIC MCU constants, configuration instructions, my constants, all include files, and the end for the MCU program.  This file uses 2 bytes of program memory in the MCU [the END instruction].
      The [system_setup.inc] is used to configure the MCU for use.  It sets all registers needed to get the MCU ready for the circuit it's installed on.  It also completes the set-up for the oscillator speed choice.  This file uses 34 bytes of program memory in the MCU.
      The [system_loop.inc] is the heart of any program.  All programs require a loop back to stay alive.  Within this section all recurring tasks can be trigger.  It is possible to have more than 1 system_loop, but for now we have this one.  This current file uses 5 bytes of program memory in the MCU [CALL & GOTO instructions].

The last file: [objective]
      The [key_matrix.inc] for now, contains enough code to allow the LEDs to work.  The code has a section for constants and set-up.  The set-up section should only be called once and is done so in the system_setup.inc.  The main objective of this code is to set-up a multi-tasking routine that check key columns & LED status.  The sectioning is made possible in the system_loop.inc code by calling each column [K1 K2 K3 K4] in turn.  This process repeat many thousands of times per second leaving room for much more code processing.  At this time key_matrix.inc compiles to 79 lines of instruction code.
      In all 119 bytes of the 14KB of flash memory were used for this lesson.

MENU
This lesson concludes with a green blinking LED. 


    Posted
Part Two - Build A High Security Digital Lock
Displaying All 4 LED Flag Combinations.
YouTube
Adding A Routine To Lesson 1.

      I added an independent routine [incr_led_flags.inc] to demonstrate a way to use timer0’s flag and my LED flag register from the last lesson.  This new code has its own constant section and set-up to pre load the flag register.  The set-up section should only be called once and is done so by adding a call instruction in the system_setup.inc.  This lesson will continue the multi-tasking design started in lesson 1.  It checks the timer0 flag and determines what action it should do based on the LED Flag register.  To show all combinations it increments the LED Flag register by 1.  The process happens every 4 timer0 cycles.  Timer0 | 31,000Hz / 4 / 256 / 16 = 1.892Hz | Routine Delay Counter Value of 4 | 1.892 / 4 = .473Hz | Change to seconds 1 / .473 = 2.12 seconds change rate.  That produces 256 different combinations for the LEDs and take a little over 7 minutes with the timer at about 1.8 cycles per second.  Some combinations many look similar to others based on activation timing.  The trigger code processes many thousands of times per second leaving us plenty of more room for future coding.  If it gets too slow we can turn up the main clock from 1MHz to 2Mhz until we reach 32MHz internal clock.  The reason to keep the clock slow is the MCU power use goes up as the Oscillator speed goes up.

MENU
This lesson concludes showing all 256 LED combinations. 


Part Three - The High Security Digital Lock
Building A Key Pad Matrix.
YouTube
Adding A Routine To Lesson 2.
      In this lesson I will use 16 momentary push button switches to build a matrix that is 4 by 4.  It will be using 8 pins on the MCU.  They are 4 outputs for the columns and LEDs and 4 inputs from key rows.   Each key must have a diode installed in line to block key cross feeding.  The MCU can only see 4 keys in a column at one time and if we don’t have diodes, it detects multiple-keys (holding down more than 1) as if in the same column. 
      What happens is a key in one column activates a row, another key pressed in the same row activates another column, then a key in that column activates a new row which is read as a key in the first column.  The end result is not what the user actually wanted to press.  With the diodes we will be able to record multiple key presses one after the other during a single debounce delay. 
      Using doides sets no limits:The limit now is all keys can be used for a single digit.  Example: hold-1 press-2 press-3 release-1 is recorded as a single key entry of 123.  What is not allowed for example: hold-2 hold-4 release-2 press-2 press-7.  It is recorded as 247 not 2427 because 2 was used earlier.  The debounce code only allows one down per key per debounce.  The debounce doesn't start until all keys are up.  So the rule is; All keys can be used once per recorded digit and a record digit can only have one key value used once in a digit.  The code will save the following: 1-up 2-up hold-2 press-3 press-9 as 1D 2D 239D.  It places a character to end each digit once the debounce code is done. That mean 3 digits 1, 2, & 239.  Many code possibilities can be generated.  73491D 2736D 63E12D The Lock would stop on the last digit because it contained the E key.  If the code 234D 1C34D was entered, it would simply clear the key record bytes because it had a C in it. 

MENU
This lesson concludes with a key pad and demo of key presses no MCU. 


    Posted
Power (3.3v or 5v) & Programming Adapter
YouTube
For the PICkit 3

      The first time I tried to program a PIC in-circuit with power requirements, the PICkit3 stopped and wouldn’t power the circuit.  With a little research I discovered that The PICkit 3 has only enough power to drive a single chip with no loads.  Then I found that the PICkit3 does a check before programming to see if the chip is powered and if it is; it doesn’t apply any power at all.  With that tid-bit of data I decided to make a little helper.  The hardest part is to find very accurate resistors to make the voltage divider for setting the two voltages (3.3v and 5.0V).  Using a meter I found combinations of resistors that were close enough to make it work.  Remember: A voltage divider is more about percentages, getting that right more than values is best.  I used the LM317 as my voltage regulator because it can handle a high input voltage.  A LM7805 has a hard time dropping down 12 volts, and I’ve destroyed a few in the past finding that out. 

So how does it work?
      The LM317 does not use ground.  It was designed to float on the top resistor of a voltage divider.  In that way it can handle much higher input voltages.  The LM317 regulates the output voltage up or down until the adjust pin can detect a 1.25 volt across the top resistor.  The 1.25 volts is therefore a constant, but the resistance and current in the divider is up to you.  From that information we know: 1.25v / R1 = current in divider.  So I selected a current of 5ma making R1 = 1.25v / 5ma = 250 ohms. 

So what is the lower resistor value? 
      For 5v we calculate: 5v - 1.25V = 3.75v.  That means 3.75v / 5ma = 750 ohms.
      For 3.3v we calculate: 3.3v - 1.25V = 2.05v.  That means 2.05v / 5ma = 410 ohms.

So how do we design the divider? 
      The quick answer is to switch between the two lower resistors. 
      The better answer is to short out a resistor in a serial chain of resistors. 

So what resistors are in the divider? 
      250 at the top (for 1.25v constant)
      410 on the bottom (for 3.3v selection)
      That leaves the difference in the middle (750 - 410) = 340 ohms. 
      We put a pin jumper across the 340 ohm resistor.  Without the jumper the regulators is set to 5v, with the jumper 3.3v. 

What should be the input source voltage? 
      The regulator works by dropping the extra voltage across the regulator.  For a 6 volts source: 1 volt drops across the regulator, that times the total current (1 amp max) = 1 watt wasted.  For a 20 volts source: 15 volts drops, that times total current (1 amp max) = 15 watts wasted.  In most cases a 12 volts source is used: 7 volts drops, that times total current (1 amp max) = 7 watts wasted. 

MENU
This project concludes with the construction of:
a power (3.3V or 5V) & programming adapter for projects. 



This website does not require payment for the information given, it is offered for free.
With that said, we do appreciate support and would love to see a donation from you.
Please click the Pay Pal button below to the right.

Thank You
For Your Direct Support
and
Have A GREAT DAY.

 Use Pay Pal To

MENU
 


Anonymous Message

Here you can send us a private anonymous message. You will be unknown to us.
If you just want to make a comment please go back to YouTube and leave it there for everyone to see.
We do not reply to most messages.
We cannot reply to messages without a return e-mail address.

Quantum Message Portal
 
 


 

PWR
CLEAR
SUBMIT


Thank You
For Your Message
and
Have A GREAT DAY.


MENU
 












































Copyright © 2018 by R A Pierce
Close