Searching \ for '1 Hz [OT]' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=
Search entire site for: '1 Hz [OT]'.

Truncated match.
PICList Thread
'1 Hz [OT]'
2000\05\17@102226 by Samuel Ace Winchenbach

flavicon
face
part 0 742 bytes content-type:application/octet-stream; (decoded 7bit)

I decided that making a servo controller for my first ASM project was a
little over my head...  so instead I decided to see how accurately I could
create a 1Hz signal (50% duty cycle)  The code that I attached is my first
try... I have been debugging it for a few hours now and I will be darned if
I know what is wrong with it.   All I know is that the LED stays lit
constantly.   If anyone has a spare moment maybe they could take a look at
it for me.

Thanks,
Sam

Content-Type: application/octet-stream;
       name="led.asm"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
       filename="led.asm"

Attachment converted: definition:led.asm (????/----) (00014396)

2000\05\17@104224 by Michael Rigby-Jones

flavicon
face
The most blatant error I can see is that you have located your CBLOCK at
location 0.  User ram does not start at 0!! You should move this to (of the
top of my head) location 12 for the 16F84.

What are you defining all the register names yourself?  MPASM has a bunch of
include files to save you the chore of doing this.  Simply include the
relevant file at the top of your source like so:

include <p16f84.inc>

Hope that helps.

Mike

> {Original Message removed}

2000\05\17@105104 by Samuel Ace Winchenbach

flavicon
face
>The most blatant error I can see is that you have located your CBLOCK at
>location 0.  User ram does not start at 0!! You should move this to (of the
>top of my head) location 12 for the 16F84.
<snip>

Thanks Mike!  Got the LED blinking!   YAY!!!!  My first ASM project is
finally doing something.

Now I just need to find out why it is blinking too slowly =(

2000\05\17@111835 by Midgley John

flavicon
face
Does it blink at a quarter of the speed you expect?
Grandmother>Eggs>Suck: at 4MHz, you get 1 million instructions/sec. Just
a thought.

>{Original Message removed}

2000\05\17@114129 by Michael Rigby-Jones

flavicon
face
> >The most blatant error I can see is that you have located your CBLOCK at
> >location 0.  User ram does not start at 0!! You should move this to (of
> the
> >top of my head) location 12 for the 16F84.
> <snip>
>
       {Original Message removed}

2000\05\17@152928 by Samuel Ace Winchenbach

flavicon
face
part 0 864 bytes content-type:application/octet-stream; (decoded 7bit)

Yep, I using a 10.000 Mhz +/- .05% ceramic resonator... and yes, it is
visibly too slow. I found something that I forgot to add to code, fixed it
and it seems _better_ but still when I compare it to my watch it looses
about 1 second every minute or so.  hold on <smile>  I will try it again...
it does seem off...  I am pretty sure my calculations are correct.  Attached
is the new code.  I added a couple of lines at the very bottom of the code
to set the "loops" register back to 200.  :)  Thanks for all your help,
thanks everyone.  This is a great mailing list.

Samuel

Content-Type: application/octet-stream;
       name="led.asm"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
       filename="led.asm"

Attachment converted: creation:led.asm (????/----) (00014575)

2000\05\17@154606 by Samuel Ace Winchenbach

flavicon
face
Well, after posting that message I think I found out where my problem is...
*sighs*

       BCF     PORTA,1                 ;Turn LED on
DELAY0  NOP
       NOP
       NOP
       NOP
LOOP    NOP
D0A     NOP
       .
       .
       .
       DECFSZ  counts,1                ;Delay 25 cycles for "counts" times.
       GOTO    DELAY0                  ;Eats 2 cycles (unless skipped)
       NOP                                     ;Clean up cycle lost from DECFSZ

       MOVLW   250
       MOVWF   counts
       DECFSZ  loops,1         ;Delay  ("counts" * 25 cycles) for "loops" times
       GOTO    D0A                             ;Eats 2 cycles (unless skipped)
       NOP                                     ;Clean up cycle lost from DECFSZ

       BSF     PORTA,1                 ;Turn LED off

I dont know how to explain this... but when there is no more "loops" left to
do...  I am really getting 30 Cycles instead of 25. :/  The code will work
until the very last "loops"  ... if anyone has any idea how to fix that.. it
would be great.

Thanks.

More... (looser matching)
- Last day of these posts
- In 2000 , 2001 only
- Today
- New search...