gnupic: Newbie question
Subject:
Newbie question
From:
####@####.####
Date:
7 Nov 2006 10:24:41 +0000
Message-Id: <61000.192.100.116.142.1162895037.squirrel@mail.wipsl.com>
Hi,
I have been studying PIC programming using the gputils. I have propably
really stupid question, but I can not figure out what is the problem, by
reading the data sheets and other assembler codes.
I have coded a seven segment display routine for PICKit2. When using the
potentiometer the seven segment shows the current value from 0-F. If the
whole code is in one .asm file everything works fluently. But if I move
the seven segment routine to second inc/asm file, the seven segment
starts to work weirdly -> 0-2 works pretty ok, 3-5 are dim and 5-F the
PIC hangs up.
ONE file code style (typo warning):
list p=p16f690
#include <p16f690.inc>
__config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & PWRTE_OFF & _MCLRE_OFF &
_CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEM_OFF)
cblock 0x20
segment_val
endc
org 0x00
goto Main
org 0x04
goto Main
Main
initialize all
Loop
read the potentiometer
call cdto7 ;seven segment routine
cdto7
play with PCL
cdto7table
retlw b'00111111' ;0
.
.
TWO file code:
Exactly the same as above but the cdto7 and cdto7table are moved to
second file and the start looks like this.
list p=p16f690
#include <p16f690.inc>
__config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & PWRTE_OFF & _MCLRE_OFF &
_CP_OFF & _BOR_OFF & _IESO_OFF & _FCMEM_OFF)
cblock 0x20
segment_val
endc
org 0x00
goto Main
org 0x04
goto Main
#include "7seg_a.asm"
Main
.
.
.
Loop
.
.
.
Thank you very much for any tips,
-Mika