Jump to content

Pic 18 Type Device Issues


Recommended Posts

18F4620 device

Version 2.2 beta of compiler and linker

 

A couple of minor things:

 

tosl isn't declared in the 18F4620 header file.

 

PCLATH and PCLATU don't seem to change in the debugger

 

Finally, I'm having trouble reading the list file and need to understand how the addresses are defined (some strange problem with arrays or structures I have yet to be able to pin down)

 

The following section are from the list file:

 

ORG 0x00003382

3382 _startup

3382 6A3E CLRF gbl_num_nbrs

3384 0ED5 MOVLW 0xD5

3386 6E49 MOVWF gbl_9_LSR

3388 0EC4 MOVLW 0xC4

338A 6E4A MOVWF gbl_9_LSR+D'1'

338C 0EBB MOVLW 0xBB

338E 6E4B MOVWF gbl_9_LSR+D'2'

3390 0EDC MOVLW 0xDC

3392 6E4C MOVWF gbl_9_LSR+D'3'

3394 EF4EF011 GOTO main

 

 

and main is at:

 

ORG 0x0000229C

229C main

; { main ; function begin

229C 0E0B MOVLW 0x0B

229E 6E4F MOVWF main_1_CHANNEL

22A0 6A50 CLRF main_1_j

 

 

I'd like to know how to translate the address in the GOTO assembly statement which I read as 0x0114E into the main address of 0x229C

 

Thanks

 

Regards,

 

Mike

Link to post
Share on other sites

Mike,

 

Another user has reported problems with data structures containing arrays.

This issue should be resolved soon.

 

I can't explain the strange goto main address.

Please send the bad project to support@picant.com and we can then investigate.

 

Regards

Dave

Link to post
Share on other sites

Mike,

 

This is not a bug, the address is in fact correctly generated :)

 

Stored in first opcode, low 9 bits of address (lsb is aways zero)

0x4E << 1 == 0x9C

 

Stored in second opcode, remaining 12 bits of address

0x011 << 9 == 0x2200

 

0x9C + 0x2200 == 0x229C

 

I hope that makes sense, have a look at PIC18 data sheet if not.

 

Regards

Dave

Link to post
Share on other sites

Mike,

 

..... (some strange problem with arrays or structures I have yet to be able to pin down)

 

Some issues regarding arrays in structures have now been fixed, so I would recommend upgrading to SourceBoost V2.2.2

 

Regards

Dave

Link to post
Share on other sites
  • 2 weeks later...

Mike,

 

PCLATH and PCLATU don't seem to change in the debugger

 

These registers only change when written to by the program.

So this is as it should be.

 

Regards

Dave

Link to post
Share on other sites

Join the conversation

You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...