Just a quick glimpse thru this, I'm wondering whether the destination on = the=20 "incf INDF" instruction makes a difference? Cheers, -Neil. On Tuesday 19 August 2003 02:59, Jim Tellier scribbled: > Sorry guys, I should have said that B1_ARRAY index is "1-based", so Yes= , it > is correct that it is the same address as B1_COUNT. > Another way to say the same thing is that this is a "counted array": th= e > 0th element contains the # of entries in the array. (Of course that on= ly > works for 1-based indexing of elements). > Jim > ----- Original Message ----- > From: "Ken Pergola" > To: > Sent: Monday, August 18, 2003 5:32 PM > Subject: Re: [PIC:] Addressing Bank 1 data space > > > Hi Jim, > > > > Took a quick glance: > > > > Are B1_COUNT and B1_ARRAY aliases on purpose (since they are the same > > location 0xA0) or was that just a typo? > > > > Regards, > > > > Ken Pergola > > > > > > -----Original Message----- > > From: pic microcontroller discussion list > > [mailto:PICLIST@MITVMA.MIT.EDU]On Behalf Of Jim Tellier > > Sent: Monday, August 18, 2003 8:19 PM > > To: PICLIST@MITVMA.MIT.EDU > > Subject: [PIC:] Addressing Bank 1 data space > > > > > > OK, I've got an "interesting" bug-hunt going on, and it's about time = I > > asked > > > a couple of sanity-check questions! I was going to post the entire > > .asm, but perhaps that's not (yet) necessary... we'll see! > > > > Using '16F877. I've set up a data structure in Bank 1: > > B1_COUNT equ 0xA0 > > B1_ARRAY equ 0xA0 > > B1_OTHERDATA equ 0xC3 > > B1_MOREDATA equ 0xC4 > > > > ; A method "foo" is called twice by my main program logic. > > ; > > foo > > banksel B1_COUNT > > ; This is the ONLY reference to B1_COUNT anywhere: > > incf B1_COUNT > > movlw B1_ARRAY > > addwf B1_COUNT, W > > movwf FSR > > incf INDF > > return > > > > The interrupt service saves and restores FSR (and W, STATUS, PCLATH) = in > > the > > > "standard" manner. (FSR *is* used in the intsvc to store characters > > received from serial port, but it is set > > to point to a buffer space in Bank 0). > > > > THE PROBLEM: sometime well after "foo" is called (exactly twice), whe= n I > > go > > > to read the contents of B1_COUNT.... it's sporadically incorrect! > > I note that ALL of what I expect to see elsewhere in both Bank 0 and = Bank > > 1 > > > data space is correct... except for this one address! > > > > Is there anything "odd" about what I'm doing? I can't seem to think = of > > new > > > ways to look at this one! > > (Oh, BTW, this one's not easily simulated, due to the need for RS232 = and > > I2C > > > I/O.. :^( > > Thanks for any helpful thoughts you might have! > > Jim > > > > > -- > > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > > > -- > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body > > > > -- > > http://www.piclist.com#nomail Going offline? Don't AutoReply us! > > email listserv@mitvma.mit.edu with SET PICList DIGEST in the body -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu