gnupic: hiccoughs on the learning curve.
Subject:
hiccoughs on the learning curve.
From:
Declan Moriarty ####@####.####
Date:
26 Sep 2002 14:19:45 -0000
Message-Id: <02092616071500.00813@genius.chateau.dec>
Learner Alert!
I'm trying to program a 16f877, making with gpasm (no errors - only the
warnings about bit banks) and simulating it. I'm hitting weird things.
1. The following code doesn't actually write, according to gpsim. This is all
in the first few instructions, before a body might lose track of things. I'm
in Bank 0.
Processor 16f877
include "p16f877.inc"
movlw 0x3f ; W = 0011 1111
movf PORTC, 1 ; should put W in PORTC but doesn't
but this does
movlw 0x3f ; W = 0011 1111
movwf PORTC
This does; yet to go by the datasheet, both should. Have I bad breath or
something? I went through and took out the former construction, but why?
2. Again to look at gpsim, this writes to TMR1L but not to TMR1H :-o
clrf STATUS ; BANK 0.
movlw 0x04 ; W=0000 0101
movwf T1CON ; Sets TMR1 @ 1:1 prescale, & internal clk, & off.
clrf TMR1L ; Sets TMR1L as zero
movlw 0xfb ; w=0xfb
movwf TMR1H ; Timer 1 prescaler = FB
I can't spot the obvious mistake.
3. I gather one should write some sort of description file for gpsim with
configuration data (e.g. cpu speed, wdt settings, even maybe a configuration
word). The format 'is similar to gdb' the manual says. Has anyone got a url
for such a thing, or can someone send me theirs, so I can hack it to my own
tastes? I'm not a programmer, and know nothing about gdb.
Put a window for the configuration on a wish list of future features.
--
Regards,
Declan Moriarty
Applied Researches - Ireland's Foremost Electronic Hardware Genius
A Slightly Serious(TM) Company
Experience is like a comb,
that Life gives you - AFTER all your hair has fallen out!