calibration clock 12f508


Results 1 to 14 of 14

Threaded View

  1. #12
    Join Date
    May 2006
    Location
    Del Rio, TX, USA
    Posts
    343


    Did you find this post helpful? Yes | No

    Default

    Joe, not all of what you see is executed by the PIC (really only a small portion). Here is a snippet of a .lst file. Only what is highlighted in RED are actual lines of code which find there way into the PIC:

    Code:
      00000032            00472 _timeloopconst                  EQU     00032h
      00000064            00473 _timeloopMAX                    EQU     00064h
                          00474         INCLUDE "MAIN_4.MAC"
                          00001 
                          01236         LIST
                          00475         INCLUDE "C:\PBP\PBPPIC18.LIB"
                          00001 ;******************************************************************
                          00002 ;*  PBPPIC18.LIB                                                  *
                          00003 ;*                                                                *
                          00004 ;*  By        : Leonard Zerman, Jeff Schmoyer                     *
                          00005 ;*  Notice    : Copyright (c) 2005 microEngineering Labs, Inc.    *
                          00006 ;*              All Rights Reserved                               *
                          00007 ;*  Date      : 09/22/05                                          *
                          00008 ;*  Version   : 2.46a                                             *
                          00009 ;*  Notes     :                                                   *
                          00010 ;******************************************************************
                          00124   LIST
                          00125 ; Oscillator is 40MHz
                          01131   LIST
    000000                01132     ORG RESET_ORG               ; Reset vector at 0
                          01136   LIST
    000000 6A1C           01137         clrf    FLAGS           ; Clear all flags on reset
                          01141   LIST
    000002 EF4A F002      01142         goto    INIT            ; Finish initialization
                          01152   LIST
    000008                01153     ORG RESET_ORG + 8           ; High priority interrupt vector at 8
    
    000008 EF69 F002      01154         goto    INTHAND         ; Goto high priority user interrupt handler
                          01166   LIST
    000018                01167     ORG RESET_ORG + 18h         ; Low priority interrupt vector at 18h
    000018 EF8F F002      01168         goto    INTLHAND        ; Goto low priority user interrupt handler
                          02164   LIST
    00001C 50E9           02165 HSEROUTJ movf   FSR0L, W        ; Jumpman entry
                          02171   LIST
    00001E                02172 HSEROUT
                          02173         CLRWDT?                 ; Keep Watchdog clear
                              M     ifndef NO_CLRWDT
    00001E 0004               M         clrwdt
                              M     endif
    000020 A89E           02174         btfss   PIR, TXIF       ; Wait till ready
    000022 D7FD           02175         bra     HSEROUT
                          02176 
                          02177      ifdef HSERPARITY_USED
                          02178           if (HSER_BITS != 9)
                          02179         andlw   7fh             ; Clear top bit
                          02180         rcall   HSERPARITY      ; Calculate the parity
                          02181             ifdef HSER_ODD
                          02182         btfss   GOP, 0
                          02183             else
                          02184         btfsc   GOP, 0
                          02185             endif
                          02186         iorlw   80h             ; Set parity
                          02187           else
                          02188         rcall   HSERPARITY      ; Calculate the parity
                          02189         bcf     TXSTA, TX9D     ; Start parity at 0
                          02190             ifdef HSER_ODD
                          02191         btfss   GOP, 0
                          02192             else
                          02193         btfsc   GOP, 0
                          02194             endif
                          02195         bsf     TXSTA, TX9D     ; Set parity in 9th bit
                          02196           endif
                          02197       endif
                          02198 
    000024 6EAD           02199         movwf   TXREG           ; Send the char
    000026 80D8           02200         bsf     STATUS, C       ; Set no timeout for Serout2mod
    000028 EF47 F002      02201         goto    DUNN            ; That's it
    The other colors are:
    BLUE = Declarations, processed by assembler
    ORANGE= Assembler commands, directives, macros
    GREEN = Comments
    PURPLE= Labels

    Also, here is a little legend for the lines of code:
    Code:
     PIC   Commands        ASM             Commands			
    line#  in HEX         line#             in ASM        .        
    000024 6EAD           02199         movwf   TXREG           ; Send the char
    000026 80D8           02200         bsf     STATUS, C       ; Set no timeout for Serout2mod
    000028 EF47 F002      02201         goto    DUNN            ; That's it
    
    EDIT: Maybe some better discriptors:
       PIC line# = ADDRESS in PIC program memory
       Commands in HEX = PIC Object Code (or OPCODE or Instruction)
       Commands in ASM = Source Code

    Hope this helps you in your understanding of what goes on "under the hood"

    SteveB
    Last edited by SteveB; - 5th December 2006 at 04:43.

Similar Threads

  1. Single digit 7 Seg LED clock - PIC16F88
    By thirsty in forum Code Examples
    Replies: 4
    Last Post: - 17th July 2009, 08:42
  2. UberNewbie can't set his clock...
    By Byte_Butcher in forum General
    Replies: 19
    Last Post: - 7th January 2009, 04:22
  3. EM4095 Chip, get Clock and Data signals?
    By mindthomas in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 19th August 2008, 06:27
  4. Shiftout/in
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 23rd August 2007, 11:48
  5. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36

Members who have read this thread : 0

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