calibration clock 12f508


Results 1 to 14 of 14

Threaded View

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


    Did you find this post helpful? Yes | No

    Default

    Yup but you'll notice many IF/IFDEF/IFNDEF wich are not process by the PIC but by the assembler. if you want to have something a little smaller, open the .asm file. on a 18F452 the single line...
    Code:
    hserout ["hello"]
    will produce
    Code:
    ; PICBASIC PRO(TM) Compiler 2.47, (c) 1998, 2006 microEngineering Labs, Inc. All Rights Reserved.  
    _USED			EQU	1
    
    	INCLUDE	"C:\PBP\18F452.INC"
    
    RAM_START       		EQU	00000h
    RAM_END         		EQU	005FFh
    RAM_BANKS       		EQU	00006h
    BANK0_START     		EQU	00080h
    BANK0_END       		EQU	000FFh
    BANK1_START     		EQU	00100h
    BANK1_END       		EQU	001FFh
    BANK2_START     		EQU	00200h
    BANK2_END       		EQU	002FFh
    BANK3_START     		EQU	00300h
    BANK3_END       		EQU	003FFh
    BANK4_START     		EQU	00400h
    BANK4_END       		EQU	004FFh
    BANK5_START     		EQU	00500h
    BANK5_END       		EQU	005FFh
    BANKA_START     		EQU	00000h
    BANKA_END       		EQU	0007Fh
    
    ; C:\PBP\PBPPIC18.RAM      	00028	FLAGS   VAR     BYTE BANKA SYSTEM       ' Static flags
    FLAGS           		EQU	RAM_START + 000h
    ; C:\PBP\PBPPIC18.RAM      	00012	R0      VAR     WORD BANKA SYSTEM       ' System Register
    R0              		EQU	RAM_START + 001h
    ; C:\PBP\PBPPIC18.RAM      	00013	R1      VAR     WORD BANKA SYSTEM       ' System Register
    R1              		EQU	RAM_START + 003h
    ; C:\PBP\PBPPIC18.RAM      	00014	R2      VAR     WORD BANKA SYSTEM       ' System Register
    R2              		EQU	RAM_START + 005h
    ; C:\PBP\PBPPIC18.RAM      	00015	R3      VAR     WORD BANKA SYSTEM       ' System Register
    R3              		EQU	RAM_START + 007h
    ; C:\PBP\PBPPIC18.RAM      	00016	R4      VAR     WORD BANKA SYSTEM       ' System Register
    R4              		EQU	RAM_START + 009h
    ; C:\PBP\PBPPIC18.RAM      	00017	R5      VAR     WORD BANKA SYSTEM       ' System Register
    R5              		EQU	RAM_START + 00Bh
    ; C:\PBP\PBPPIC18.RAM      	00018	R6      VAR     WORD BANKA SYSTEM       ' System Register
    R6              		EQU	RAM_START + 00Dh
    ; C:\PBP\PBPPIC18.RAM      	00019	R7      VAR     WORD BANKA SYSTEM       ' System Register
    R7              		EQU	RAM_START + 00Fh
    ; C:\PBP\PBPPIC18.RAM      	00020	R8      VAR     WORD BANKA SYSTEM       ' System Register
    R8              		EQU	RAM_START + 011h
    ; C:\PBP\PBPPIC18.RAM      	00027	GOP     VAR     BYTE BANKA SYSTEM       ' Gen Op Parameter
    GOP             		EQU	RAM_START + 013h
    ; C:\PBP\PBPPIC18.RAM      	00023	RM1     VAR     BYTE BANKA SYSTEM       ' Pin 1 Mask
    RM1             		EQU	RAM_START + 014h
    ; C:\PBP\PBPPIC18.RAM      	00026	RM2     VAR     BYTE BANKA SYSTEM       ' Pin 2 Mask
    RM2             		EQU	RAM_START + 015h
    ; C:\PBP\PBPPIC18.RAM      	00021	RR1     VAR     BYTE BANKA SYSTEM       ' Pin 1 Register
    RR1             		EQU	RAM_START + 016h
    ; C:\PBP\PBPPIC18.RAM      	00024	RR2     VAR     BYTE BANKA SYSTEM       ' Pin 2 Register
    RR2             		EQU	RAM_START + 017h
    ; C:\PBP\PBPPIC18.RAM      	00022	RS1     VAR     BYTE BANKA SYSTEM       ' Pin 1 Bank
    RS1             		EQU	RAM_START + 018h
    ; C:\PBP\PBPPIC18.RAM      	00025	RS2     VAR     BYTE BANKA SYSTEM       ' Pin 2 Bank
    RS2             		EQU	RAM_START + 019h
    ; C:\PBP\18F452.BAS        	00024	PORTL   VAR     PORTB
    _PORTL           		EQU	 PORTB
    ; C:\PBP\18F452.BAS        	00025	PORTH   VAR     PORTC
    _PORTH           		EQU	 PORTC
    ; C:\PBP\18F452.BAS        	00026	TRISL   VAR     TRISB
    _TRISL           		EQU	 TRISB
    ; C:\PBP\18F452.BAS        	00027	TRISH   VAR     TRISC
    _TRISH           		EQU	 TRISC
    
    ; EEPROM data.
    
    
    	INCLUDE	"A.MAC"
    	INCLUDE	"C:\PBP\PBPPIC18.LIB"
    
    
    ; C:\PBP\18F452.BAS        	00012	BANKA   $0000, $007F
    ; C:\PBP\18F452.BAS        	00013	BANK0   $0080, $00FF
    ; C:\PBP\18F452.BAS        	00014	BANK1   $0100, $01FF
    ; C:\PBP\18F452.BAS        	00015	BANK2   $0200, $02FF
    ; C:\PBP\18F452.BAS        	00016	BANK3   $0300, $03FF
    ; C:\PBP\18F452.BAS        	00017	BANK4   $0400, $04FF
    ; C:\PBP\18F452.BAS        	00018	BANK5   $0500, $05FF
    ; C:\PBP\18F452.BAS        	00020	LIBRARY "PBPPIC18"
    
    ; C:\PBP\18F452.BAS        	00022	        include "PIC18EXT.BAS"
    
    ; C:\PBP\18F452.BAS        	00029	        include "PBPPIC18.RAM"
    
    ; C:\PBP_PROG\A.BAS        	00001	       hserout ["hello"]
    	HSEROUT?C	068h
    	HSEROUT?C	065h
    	HSEROUT?C	06Ch
    	HSEROUT?C	06Ch
    	HSEROUT?C	06Fh
    
    	END
    the interesting stuff is HSEROUT?C. now open the .MAC file, it produce...
    Code:
    	NOLIST
    ; PICBASIC PRO(TM) Compiler 2.47, (c) 1998, 2006 microEngineering Labs, Inc. All Rights Reserved.  
    
    HSEROUT?C macro Cin
            MOVE?CA Cin
            L?CALL  HSEROUT
        endm
    HSEROUT_USED = 1
    
    
    	LIST
    so you know that it store each character (C) in Wreg(A), and then call the HSEROUT sub.
    Last edited by mister_e; - 5th December 2006 at 00:16.
    Steve

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

Similar Threads

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