Home Products Prices Site Map Order Contact What's New Books Free Files Links FAQ
Dontronics Home Page  Code Snippets.
Dontronics Catalog View Shopping Cart Contents
Cheap Micro Keyboard
Easily adapts to any micro © Dean Cocks
Tuesday, January 02, 2001
DeanoC@camtech.net.au
The following article describes a very cheap keyboard interface which can be easily adapted to virtually any micro.
It uses just one low cost IC. The software description given will be for a PIC 16F84 but as mentioned, can be adapted to any micro.  Download the full file: http://www.dontronics.com/pdf/cheap_micro_keyboard.pdf


Subject:         Hi, here is something you might want to add to your faq's
   Date:         Sun, 19 May 2002 08:54:46 -0700
   From:        "Jimbo" <jimbo@jimbo.kicks-ass
     To:         <support@dontronics

Hi all,
Been beating my brain for a couple of days on this. Writing some 'c' code to program a pic microcontroller.
Windows was blocking my output on com2. Here's how I fixed it, nowhere on the internet have I found this
solution.

1. rename the msports.inf in \windows\inf\msports.inf to msportssave.inf
2. rename the serial.vxd in \windows\system\serial.vxd to serialsave.vxd
3. Go into control panel and delete the serial under port system/device manager/ports
4. Reboot, windows will find the ports but won't be able to find a driver, just continue and the ports will be added
to other devices in system/device manager.
5. You can now access the serial ports directly
6 I restored com1 to windows status by renaming the msports.inf file and serial.vxd to original names. Deleted
com1 and rebooted, windows finds com1 and loads the windows drivers and I can still use com2 for my program.
YEEEHAWWWW

Hope this helps others
James Luttrell
JTL-Consulting
jimbo@jimbo.kicks-ass.org



Quozl's 16F84 to 12C509 Porting Checklist
This will assist you to convert 508/9 code to the 16F84

prototype board with 16F84-10P, 12C509-JW, and 12C509 lined up, for illustration only, 52k

Introduction

How practical is it to prototype on a re-usable and quickly reprogrammable EEPROM PIC before moving the design to a UV-erasable or one time programmable (OTP) part? Some have done it, and this document is the distillation of their wisdom. Summary: there are lots of traps.

 This is Revision E of the 16F84 to 12C509 porting checklist. Many on the PIClist have contributed, but a record has not been kept. The checklist is intended to be used when moving working code from one processor to the other, and as a guide for things to avoid when writing code that one day may be moved.

 A source template for assembly code that can be used on both processors is included.

Legend

A keyword colour pattern is used throughout the checklist, as described in this table:
 

Colour

Meaning

blue, 
common
Keywords that are portable, common to both processors.
green, 
ok
Keywords that are specific to the 12C509 processor, that therefore would need to be encased within macros or ifdef sections.
red, 
wrong
Keywords that are specific to the 16F84 processor, that therefore would need to be replaced with keywords or code re-engineered for the 12C509 processor, or again encased within macros or ifdef sections.

Checklist

Here is the checklist. One method of using this is to print it out, sit down at your favourite source code editor, bring up your project source and move down the list ticking each item that your code passes. Then go and re-engineer the code for what you are missing.

Template

 The following assembly source is a suggested template for developing portable assembly code for both processors using gpasm. Note the use of the ifdef directive to determine which sections are to be processed.
 
        ifdef           __16f84
        processor       16f84
        include         "p16f84.inc"
        __config        _cp_off & _wdt_on & _hs_osc
        endif

        ifdef           __12c509
        processor       12c509
        include         "p12c509a.inc"
        __config        _mclre_off & _cp_off & _wdt_on & _intrc_osc
        endif
        
        ifdef   __16f84
base    equ     0x0c            ; first free file register address
port    equ     portb           ; port on which bits are used
movwt   macro                   ; move w to tris
        tris    trisb
        endm
bank0   macro
        endm
bank1   macro
        endm
        endif

        ifdef   __12c509
base    equ     0x07            ; first free file register address
port    equ     gpio            ; port on which bits are used
movwt   macro                   ; move w to tris
        tris    gpio
        endm
page0   macro                   ; select low bank for goto/call
        bcf     status,pa0
        endm
page1   macro                   ; select high bank for goto/call
        bsf     status,pa0
        endm
        endif

        cblock  base
                ephemeral       ; temporary storage
                ...
        endc

        ;; start of executable code
        
        org     0x0

        ifdef   __12c509
        movwf   OSCCAL          ; calibrate internal oscillator
        endif
        page1
        goto    main            ; go to main program
        ...



        ;; calibration for 12C509-JW part
        ifdef   __12c509
        org     0x3ff
        movlw   0x50                    ; my 12c509 #1
        ; movlw 0x30                    ; my 12c509 #2
        endif

        end

28th December 1999, quozl@us.netrek.org

Be sure tocheck for the latest version at:
http://quozl.us.netrek.org/porting-16f84-12c509/
and advise us if it has been updated.



 
 
 
Home Products Prices Site Map Order Contact What's New Books Free Files Links FAQ

Dontronics Home Page

_
Copyright © 1996-2005 Dontronics

 
 
Dontronics Catalog View Shopping Cart Contents