Posts: 5
Threads: 2
Joined: May 2013
2013-05-01, 19:07:06
(This post was last modified: 2013-05-02, 19:55:45 by Mikael Gustavsson.)
Hi,
I am using Mplabx 1.51 with Hi-tech c 9.83. My device is a PIC16F1827.
I have put the code offset in the linker options.
My problem is that there is no goto 0x007f40 at address 0 in program memory view.
Does anyone know how to fix this?
Any help will be appreciated.
Posts: 623
Threads: 0
Joined: Nov 2009
Hi,
For what reason have you set a code offset?
Posts: 5
Threads: 2
Joined: May 2013
(2013-05-01, 19:25:10)Mikael Gustavsson Wrote: Hi,
For what reason have you set a code offset?
Well for some reason I have just realized that the bootloader is at the end of the memory.I have just removed the code offset option. Now the Goto is located at address 0X01 as shown below:
Posts: 5
Threads: 2
Joined: May 2013
(2013-05-01, 19:41:20)portafreak Wrote: (2013-05-01, 19:25:10)Mikael Gustavsson Wrote: Hi,
For what reason have you set a code offset?
Well for some reason I have just realized that the bootloader is at the end of the memory.I have just removed the code offset option. Now the Goto is located at address 0X01 as shown below:
I got it working by setting the OSCON bit in user_code:
; Set internal oscillator to 4MHz (1101)
banksel OSCCON
bsf OSCCON, IRCF3 ;1
bsf OSCCON, IRCF2 ;1
bcf OSCCON, IRCF1 ;0
bsf OSCCON, IRCF0 ;1
bsf OSCCON, SCS1 ;1 System Clock Select bits
bcf OSCCON, SCS0 ;0