Subject:
Re: [gnupic] Not being able to use variables on pic18fxx50
From:
Lope Vega ####@####.####
Date:
22 Aug 2008 17:51:50 -0000
Message-Id: <720408.23636.qm@web28206.mail.ukl.yahoo.com>
--- El vie, 22/8/08, Robert Pearce ####@####.#### escribió:
> De: Robert Pearce ####@####.####
> Asunto: Re: [gnupic] Not being able to use variables on pic18fxx50
> Para: ####@####.####
> Fecha: viernes, 22 agosto, 2008 7:55
> On Fri, 22 Aug 2008, Peter Stuge ####@####.####
> wrote :
> >
> >> code 0
> >> pagesel main
> >> goto main
> >>
> >> code
> >
> >These lines should read:
> >
> > code
> > org 0
> > pagesel main
> > goto main
> >
> Actually the former is acceptable - the 'code'
> directive accepts an
> argument which acts as an "org" hint for the
> linker. In fact Peter's
> suggestion is wrong, because the "org 0" takes
> the assembler out of
> relocatable mode and back to absolute, so it makes no sense
> to put one
> immediately after a "code" directive.
>
> However, use of the "pagesel" macro is redundant
> on 18F series devices,
> since the "goto" instruction on them has a 24-bit
> range.
Ops, I didn't know it where redundant on 18f's, still I'm new to this whole thing, thanks.
>
> What Lope has not told us, which does matter given the
> errors he
> reports, is what his linker file contains. Also, the dump
> from the chip
> is of far less use than the hex/lst/map files built by the
> linker.
I didn't think of that either, sorry, your completely right though.
The linker script I've been using is the default one.
Now, I solved it yesterdeay at least!.
At some point, I took the PORTB part out, and got back to a "count from 5 to 0 and turn the led on/off" program-model, and started checking with the multimeter pin by pin.
Then I noticed that when I had the + on RB3, and the - in ground, the pic started behaving completely normal, such like if a reset would have taken place.
I then recompiled the program initializing properly the ports I wasn't using and all the problems solved!. Now I can use variables as reliably as I was meant to.
While I can compile and make relocatable code work, still I haven't looked at why .udata_shr doesn't work (probably because the original defaul script needs some addendums), and in absolute mode, still I wouldn't know how to setup a variable of 1 byte, since `res' throws that message, but by now I'll be using relocatable code anyways.
So thanks so much for your help and your attention guys, I might be able to start exploring the pic and the loads of things it comes with (timers, adc, etc).
Regards.
> --
> Rob Pearce
> http://www.bdt-home.demon.co.uk
>
> The contents of this | Windows NT crashed.
> message are purely | I am the Blue Screen of Death.
> my opinion. Don't | No one hears your screams.
> believe a word. |
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ####@####.####
> For additional commands, e-mail:
> ####@####.####
__________________________________________________
Correo Yahoo!
Espacio para todos tus mensajes, antivirus y antispam ¡gratis!
Regístrate ya - http://correo.yahoo.es