RE: pic18f4455 - ACCESS flag on the device working or not?
Sivaram Gowkanapalli <[email protected]> Fri, 3 Jun 2011 02:42:34 -0400
| Newsgroups | gmane.comp.hardware.microcontrollers.gnupic |
|---|---|
| Message-ID | <[email protected]> |
--_674a0337-9dbb-422f-a7a8-e5a347452b03_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello=2C Please excuse the earlier email. The formatting ended up being a mess. This piece of code is not working on the pic18F4455. It has been compiled withXINST =3D ON and with the --extended flag of gpasm. The expected result of _temp is 0xf+1+1+1=2C but it stays at 0xff=2C the value from the instruction at address 180. As you can see that _temp has anaddress of 0x3 and it should not be affected by the BSR. I am not sure if this has to do with the extended instruction set or if it could be something else. It seems to be something simple that I am missing as the below case is toostraightforward to be a bug. Is this how the instructions would be=2C with XINST=3D ON? It works perfectly fine on gpsim. I see the value of _temp =3D 0xf+1+1+1. It is only on the device that it is not working. from the .lst file: 00017e 0eff movlw 0xff movlw 0xff 000180 cfe8 movff 0xfe8=2C 0x3 movff WREG=2C_temp 000182 f003 000184 0e0f movlw 0xf movlw 0x0f 000186 6e03 movwf 0x3=2C 0 movwf _temp=2CACCESS 000188 2a03 incf 0x3=2C 0x1=2C 0 incf _temp=2CF=2CACCES= S 00018a 2a03 incf 0x3=2C 0x1=2C 0 incf _temp=2CF=2CACCES= S 00018c 2a03 incf 0x3=2C 0x1=2C 0 incf _temp=2CF=2CACCES= S from the hex file which was downloaded from the pic (to confirm that the hexfile was written to the pic correctly=2C fromgpdasm -y -p p18f4455 from-pic.hex | less) : 000180: cfe8 movff 0xfe8=2C 0x3 000182: f003 000184: 0e0f movlw 0xf 000186: 6e03 movwf 0x3=2C 0 000188: 2a03 incf 0x3=2C 0x1=2C 0 00018a: 2a03 incf 0x3=2C 0x1=2C 0 00018c: 2a03 incf 0x3=2C 0x1=2C 0 output from gpsim when stepping through the code: 0x0000000000002FE9 p18f4455 0x017E 0x0EFF movlw 0xff Wrote: 0x00FF to W(0x0FE8) was 0x0008 0x0000000000002FEB p18f4455 0x0180 0xCFE8 movff W=2CREG003 Read: 0x00FF from W(0x0FE8) Wrote: 0x00FF to REG003(0x0003) was 0x0000 0x0000000000002FEC p18f4455 0x0184 0x0E0F movlw 0x0f Wrote: 0x000F to W(0x0FE8) was 0x00FF 0x0000000000002FED p18f4455 0x0186 0x6E03 movwf REG003 Read: 0x000F from W(0x0FE8) Wrote: 0x000F to REG003(0x0003) was 0x00FF 0x0000000000002FEE p18f4455 0x0188 0x2A03 incf REG003=2Cf=2C0 Read: 0x000F from REG003(0x0003) Wrote: 0x0010 to REG003(0x0003) was 0x000F Wrote: 0x0002 to status(0x0FD8) was 0x0004 0x0000000000002FEF p18f4455 0x018A 0x2A03 incf REG003=2Cf=2C0 Read: 0x0010 from REG003(0x0003) Wrote: 0x0011 to REG003(0x0003) was 0x0010 Wrote: 0x0000 to status(0x0FD8) was 0x0002 0x0000000000002FF0 p18f4455 0x018C 0x2A03 incf REG003=2Cf=2C0 Read: 0x0011 from REG003(0x0003) Wrote: 0x0012 to REG003(0x0003) was 0x0011 Wrote: 0x0000 to status(0x0FD8) was 0x0000 Any thoughts=2C please? Thanks Siva > From: [email protected] > To: [email protected] > Subject: pic18f4455 - ACCESS flag on the device working or not? > Date: Fri=2C 3 Jun 2011 02:28:11 -0400 >=20 >=20 > Hello=2C > This piece of code is not working on the pic18F4455. It has been compiled= withXINST =3D ON and with the --extended flag of gpasm. > The expected result of _temp is 0xf+1+1+1=2C but it stays at 0xff=2C the = valuefrom the instruction at address 180. As you can see that _temp has an= address of 0x3 and it should not be affected by the BSR. I am not sure if t= hishas to do with the extended instruction set or if it could be something = else.It seems to be something simple that I am missing as the below case is= toostraightforward to be a bug. Is this how the instructions would be=2C w= ith XINST=3D ON? > It works perfectly fine on gpsim. I see the value of _temp =3D 0xf+1+1+1.= It is only on the device that it is not working. > from the .lst file: > 00017e 0eff movlw 0xff movlw 0xff000180 cfe8 = movff 0xfe8=2C 0x3 movff WREG=2C_temp000182 f003000184 0e0f= movlw 0xf movlw 0x0f000186 6e03 movwf 0x3=2C 0= movwf _temp=2CACCESS000188 2a03 incf 0x3=2C 0x1=2C 0 = incf _temp=2CF=2CACCESS00018a 2a03 incf 0x3=2C 0x1=2C 0 = incf _temp=2CF=2CACCESS00018c 2a03 incf 0x3=2C 0x1=2C 0 = incf _temp=2CF=2CACCESS > from the hex file which was downloaded from the pic (to confirm that the = hexfile was written to the pic correctly=2C fromgpdasm -y -p p18f4455 from-= pic.hex | less) : > 000180: cfe8 movff 0xfe8=2C 0x3000182: f003000184: 0e0f movlw = 0xf000186: 6e03 movwf 0x3=2C 0000188: 2a03 incf 0x3=2C 0x1=2C 00= 0018a: 2a03 incf 0x3=2C 0x1=2C 000018c: 2a03 incf 0x3=2C 0x1=2C= 0 > output from gpsim when stepping through the code: > 0x0000000000002FE9 p18f4455 0x017E 0x0EFF movlw 0xff Wrote: 0x00FF to W(= 0x0FE8) was 0x00080x0000000000002FEB p18f4455 0x0180 0xCFE8 movff W=2CREG00= 3 Read: 0x00FF from W(0x0FE8) Wrote: 0x00FF to REG003(0x0003) was 0x00000= x0000000000002FEC p18f4455 0x0184 0x0E0F movlw 0x0f Wrote: 0x000F to W(0x0= FE8) was 0x00FF0x0000000000002FED p18f4455 0x0186 0x6E03 movwf REG003 Read= : 0x000F from W(0x0FE8) Wrote: 0x000F to REG003(0x0003) was 0x00FF0x000000= 0000002FEE p18f4455 0x0188 0x2A03 incf REG003=2Cf=2C0 Read: 0x000F from RE= G003(0x0003) Wrote: 0x0010 to REG003(0x0003) was 0x000F Wrote: 0x0002 to = status(0x0FD8) was 0x00040x0000000000002FEF p18f4455 0x018A 0x2A03 incf REG= 003=2Cf=2C0 Read: 0x0010 from REG003(0x0003) Wrote: 0x0011 to REG003(0x00= 03) was 0x0010 Wrote: 0x0000 to status(0x0FD8) was 0x00020x0000000000002FF= 0 p18f4455 0x018C 0x2A03 incf REG003=2Cf=2C0 Read: 0x0011 from REG003(0x00= 03) Wrote: 0x0012 to REG003(0x0003) was 0x0011 Wrote: 0x0000 to status(0x= 0FD8) was 0x0000 > Any thoughts=2C please? > ThanksSiva > =20 = --_674a0337-9dbb-422f-a7a8-e5a347452b03_--