pic16c54


Closed Thread
Results 1 to 10 of 10

Thread: pic16c54

  1. #1
    necati's Avatar
    necati Guest

    Default pic16c54

    Hi,
    I found a code in Microchip's site with extention "asm".
    But I dont know how to convert it to hex file so can be put in pic16c54.

    What program do I need for converting?

    inside the file is like:

    ; *********************************************
    ; * PIC Egg Timer Give-Away *
    ; * *
    ; * Author: John Day *
    ; * Sr. Field Applications Engineer *
    ; * Northeast Region *
    ; * *
    ; * Revision: 1.2 *
    ; * Date September 22, 1994 *
    ; * Part: PIC16C54-LP/P or PIC16LC54A/P *
    ; * Fuses: OSC: LP *
    ; * WDT: OFF *
    ; * PuT: OFF *
    ; * CP: OFF *
    ; *********************************************
    ;
    ; This program is intended to run on a 32 Khz watch crystal and connects
    ; to four multiplexed seven segment displays. It displays the current
    ; time, alarm time and egg count down timers. There are switches that
    ; allow the user to set the alarm, timer and clock functions.

    LIST F=INHX8M,P=16C54
    INCLUDE "c:\pictools\picstarc\p16C5X.inc"
    __FUSES _CP_OFF&_WDT_OFF&_LP_OSC

    ORG 07h
    ; ****************************************
    ; * Static RAM Register File Definitions *
    ; ****************************************
    INDADDR EQU 0 ; Indirect address register
    DISPSEGS_A EQU 07h ; Current Display A segment bit pattern
    DISPSEGS_B EQU 08h ; Current Display B segment bit pattern
    DISPSEGS_C EQU 09h ; Current Display C segment bit pattern
    DISPSEGS_D EQU 0Ah ; Current Display D segment bit pattern
    CLK_SEC EQU 0Bh ; Clock second counter (0-59)
    CLK_MIN_LD EQU 0Ch ; Clock minute low digit counter (0-9)
    CLK_MIN_HD EQU 0Dh ; Clock minute high digit counter (0-5)
    CLK_HOUR_LD EQU 0Eh ; Clock hour low digit counter (0-9)
    CLK_HOUR_HD EQU 0Fh ; Clock hour high digit counter (0-2)
    ALM_MIN_LD EQU 10h ; Alarm minute low digit counter (0-9)
    ALM_MIN_HD EQU 11h ; Alarm minute high digit counter (0-5)
    ALM_HOUR_LD EQU 12h ; Alarm hour lor digit counter (0-9)
    ALM_HOUR_HD EQU 13h ; Alarm hour high digit counter (0-2)
    TMR_SEC_LD EQU 14h ; Timer second low digit counter (0-9)
    TMR_SEC_HD EQU 15h ; Timer second high digit counter (0-5)
    TMR_MIN_LD EQU 16h ; Timer hour low digit counter (0-9)
    TMR_MIN_HD EQU 17h ; Timer hour high digit counter (0-2)
    KEYPAT EQU 18h ; Currently pressed key bits
    FLAGS EQU 19h ; Status of alarms, display on, etc.
    PREVTMR0 EQU 1Ah ; Used to determine which TMR0 bits changed
    PREVSCAN EQU 1Bh ; Store Common Cathode display scan state
    TEMP EQU 1Ch ; Temporary storage
    DISPONCNT EQU 1Dh ; Time the displays have been on
    MODE_COUNT EQU 1Eh ; Current mode state
    ALARMCNT EQU 1Fh ; Time the alarm has been sounding
    ; ****************************************
    ; * Flag and state bit definitions *
    ; ****************************************
    #define SECBIT TEMP,7 ; Bit to spawn 1/4 second count
    #define SCANBIT TMR0,0 ; Bit to spawn display MUX
    #define MODEKEY KEYPAT,4 ; Bit for MODEKEY pressed
    #define UPKEY KEYPAT,6 ; Bit for UPKEY pressed
    #define DOWNKEY KEYPAT,5 ; Bit for DOWNKEY pressed
    #define MODEKEYCHG TEMP,4 ; Bit for delta MODEKEY
    #define TIMENOW FLAGS,7 ; Flag to indicate 1 second passed
    #define ALARMNOW FLAGS,3 ; Flag to indicate wakeup alarm
    #define EGGNOW FLAGS,4 ; Flag to indicate egg timer alarm
    #define ALARMOK STATUS,PA0 ; Flag to enable wakeup alarm
    #define EGGOK STATUS,PA1 ; Flag to enable timer alarm


    and goes on..........
    Last edited by necati; - 31st May 2005 at 17:37.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    As far as i'm aware of, there's no program to translate from ASM to PBP. The only thing you can do is to learn Microchip's asm and do your own conversion.

    There's some user here that know ASM but i feel that they won't do the whole translation... or not for free.

    For what i read in the program header, you can do it easily. If you want to have my easy 1/2 hour code writing... Use a 12FXXX PIC serie(or whatever else), a DS1307 RTC and a 7 segment driver IC like MAX6958... not the cheapest solution but...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    necati's Avatar
    necati Guest


    Did you find this post helpful? Yes | No

    Default

    It is strange that Microchip gives people the code which is useless then.

  4. #4
    Join Date
    Jul 2003
    Location
    Sweden
    Posts
    237


    Did you find this post helpful? Yes | No

    Default

    Use MPLAB to compile it, it's also free from Microchip.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    It's not useless... this is Assembler... download the FREE MPLAB software from the Microchip website... it contains the Assembler needed to convert the .asm into .hex which you can then use to program your PIC.

  6. #6
    necati's Avatar
    necati Guest


    Did you find this post helpful? Yes | No

    Default

    I finally succeed making hexfile using mplab but only after deleting four lines from the asm code.Now I am not sure if it will work.
    I will try..

  7. #7
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default pic16c54

    hello
    the clk8.asm files is readily downloadable from microchip as part of AN615b and the same has been used by me ( of course i have locally compiled) and the same is working FINE.
    Here one thing is to be noted . the common cathode wires coming from RA 0-RA-1 ,RA-2 and RA-3 may require rescheduling. Otherwise the display gets jumbled.

    However PIC16C54a is an OTP device. Perhaps it is better if you can try a newer version PIC16F54 instead as this s flash programmable, by managing a suitable programmer

    Thus, Necati may very well use it. ALL the best

    I only wonder whether some has tried to modify this software to work on PIC16f84 and i request for help in this direction.

    sarma

  8. #8
    Join Date
    May 2004
    Location
    NW France
    Posts
    3,615


    Did you find this post helpful? Yes | No

    Wink

    Hi, Sarma

    Seems migrating from C54' to F84' is not so easy ...

    first, have a look to Appendix C from 16F84 Datasheet : main explanations are here.

    BUT ... if the programmer has used its own tricks ... that can be a bit harder !!!

    I experience it on another clock program ( DCF Berliner Clock ) ... "basic" clock works well, but I still can't get the LED multiplexing work properly ...

    it relates to Writing to the PC ... but where ???

    good luck

    Alain
    ************************************************** ***********************
    Why insist on using 32 Bits when you're not even able to deal with the first 8 ones ??? ehhhhhh ...
    ************************************************** ***********************
    IF there is the word "Problem" in your question ...
    certainly the answer is " RTFM " or " RTFDataSheet " !!!
    *****************************************

  9. #9
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default application note an615 (low power clock with 16c54)

    hi, necati

    hope you might have adopted the clk8.asm by converting the same to hex code

    if so desired perhaps i could send clk8.hex copy
    Regards,
    Sarma

  10. #10
    Join Date
    Mar 2006
    Location
    Hyderabad (India)
    Posts
    123


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mvs_sarma
    hello
    I only wonder whether some has tried to modify this software to work on PIC16f84 and i request for help in this direction.

    sarma
    Hi all and Necati in particular,

    I am now able to modified the an615 (clk8.asm to be able to work on 16F84A and i have two versions-- 1. with display OFF after 8 sec and 2. One to contiuously display-

    i could send the .HEX file if someone wants.

    Enquiries are welcome.
    Regards,
    Sarma

Similar Threads

  1. pic16c54a
    By mavi in forum Schematics
    Replies: 16
    Last Post: - 9th March 2006, 18:10

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts