PIC18F4620 Compiles but does not Run
PIC18F4620 Compiles but does not Run
My habitual PICs are 18F452 and 18F4620 . I convert to 4620 when I need more memory.
Now I find that PIC18F4620 devices compile but do not run or run and hang. I use EasyPic6 for prototype development so that is the hardware.
My atrocious environment is Win 8.1 having been bullied of XP.
I am tempted to reload PascalPro - however I would be interested to hear of reasons why the 18F4620 should become a problem when the 18F452 compiles and runs as expected(Identical code).
I may have done something less than clever but MPP does very occasionally crash under Win8.1 which I never ever experienced under XP. I cannot put my finger on it.
Very many thanks,
Amfortas
Now I find that PIC18F4620 devices compile but do not run or run and hang. I use EasyPic6 for prototype development so that is the hardware.
My atrocious environment is Win 8.1 having been bullied of XP.
I am tempted to reload PascalPro - however I would be interested to hear of reasons why the 18F4620 should become a problem when the 18F452 compiles and runs as expected(Identical code).
I may have done something less than clever but MPP does very occasionally crash under Win8.1 which I never ever experienced under XP. I cannot put my finger on it.
Very many thanks,
Amfortas
Re: PIC18F4620 Compiles but does not Run
Hello Amfortas
Could you please provide more info on this?
Such as, which version of compiler are you using?
Which version of MikroProg suite are you using?
Can you post your code here?
Best Regards
Could you please provide more info on this?
Such as, which version of compiler are you using?
Which version of MikroProg suite are you using?
Can you post your code here?
Best Regards
My hobby is collecting MikroElektronika products.
Gotta catch them all!
Gotta catch them all!
Re: PIC18F4620 Compiles but does not Run
Hi MaGik,
My MikroProg Suite is 2,27 has worked fine on PIC18F4620. I am simply running the Library LED program which has previously worked fine. (I have also tried a very simple LED flashing prog.).
I a using the EasyPIC6 built in MikroFlash - the program loads and verifies as expected. Also use MikroProg on product hardware which first showed the problem. The program does nothing so I assume it hangs before running.
Appears to behave perfectly on all PIC18F452 progs.
I would have to deduce that there is something wrong with the PIC18F4620 header file but simply wondered whether anyone else had a similar experience. Probably coincides with my downgrading to WIN8.1 !
Thanks for responding,
Regards,
Amfortas
My MikroProg Suite is 2,27 has worked fine on PIC18F4620. I am simply running the Library LED program which has previously worked fine. (I have also tried a very simple LED flashing prog.).
I a using the EasyPIC6 built in MikroFlash - the program loads and verifies as expected. Also use MikroProg on product hardware which first showed the problem. The program does nothing so I assume it hangs before running.
Appears to behave perfectly on all PIC18F452 progs.
I would have to deduce that there is something wrong with the PIC18F4620 header file but simply wondered whether anyone else had a similar experience. Probably coincides with my downgrading to WIN8.1 !
Thanks for responding,
Regards,
Amfortas
Re: PIC18F4620 Compiles but does not Run
Hello amfortas
Latest version of (MikroProg suite) software is V2.30.
Could you please install it from the following link and try again?
http://www.mikroe.com/mikroprog/pic-dspic-pic32/
Please let me know if that didn't solve your issue
Best Regards
Latest version of (MikroProg suite) software is V2.30.
Could you please install it from the following link and try again?
http://www.mikroe.com/mikroprog/pic-dspic-pic32/
Please let me know if that didn't solve your issue
Best Regards
My hobby is collecting MikroElektronika products.
Gotta catch them all!
Gotta catch them all!
Re: PIC18F4620 Compiles but does not Run
The problem you are describing is usually a configuration setting.
Go to the "edit project" screen and check your oscillator settings. The 18f4620 is very different
than the 18f452 when it comes to the oscillator.
Go to the "edit project" screen and check your oscillator settings. The 18f4620 is very different
than the 18f452 when it comes to the oscillator.
Re: PIC18F4620 Compiles but does not Run
Thanks Mikromark,
Interestingly I have always used identical Osc settings at 4x8 PLL=32MHz with no problem for both 4620 and 452.
I have the added problem now that programs compile perfectly and run outside the IDS but the RUN menu will only access the debug options ! Cannot run anything in the IDS.
Re-installed from Mikroelectronica site and problems persist. Maybe something has stuck in the registry and not been cleared during uninstal.
Any ideas on this would be extremely welcome !
I appreciate your reply.
Regards,
Amfortas
Interestingly I have always used identical Osc settings at 4x8 PLL=32MHz with no problem for both 4620 and 452.
I have the added problem now that programs compile perfectly and run outside the IDS but the RUN menu will only access the debug options ! Cannot run anything in the IDS.
Re-installed from Mikroelectronica site and problems persist. Maybe something has stuck in the registry and not been cleared during uninstal.
Any ideas on this would be extremely welcome !
I appreciate your reply.
Regards,
Amfortas
Re: PIC18F4620 Compiles but does not Run
Hi MaGik,
I have been wasting your time ! I was immersed in Delphi 7 and took on a totally wrong expectation for the MikroPascal RUN menu. Have reloaded the clean version which works fine although I still have to check out the PIC18F452/4620 issue.
Please accept y apologies !
Regards,
Amfortas
I have been wasting your time ! I was immersed in Delphi 7 and took on a totally wrong expectation for the MikroPascal RUN menu. Have reloaded the clean version which works fine although I still have to check out the PIC18F452/4620 issue.
Please accept y apologies !
Regards,
Amfortas
Re: PIC18F4620 Compiles but does not Run
Hi,
Please, can you tell me more details of this issue that you are having, maybe attach a minimal project that demonstrates it ?
Regards,
Filip.
Please, can you tell me more details of this issue that you are having, maybe attach a minimal project that demonstrates it ?
Regards,
Filip.
Re: PIC18F4620 Compiles but does not Run
Hello amfortas
There are no need for any apologies
I'm glad that it worked out for you.
Best Regards
There are no need for any apologies
I'm glad that it worked out for you.
Please let me and Filip know if that issue kept happening and do as Filip suggested so that we can try to helpamfortas wrote:I still have to check out the PIC18F452/4620 issue.
Best Regards
My hobby is collecting MikroElektronika products.
Gotta catch them all!
Gotta catch them all!
Re: PIC18F4620 Compiles but does not Run
Thanks MaGik and Filip,
Still cannot compile 4620 successfully. Now I have lost my registration code for some unexplained reason and running my reg.exe does not restore registration even though I loaded latest version and registered a few days ago ! Awaiting a replacement key to hopefully get back to business.
I will get back once all is restored and if the 4620 problem remains. I have not used the debugger since I have always used "gotchas" to trace program bugs. Strangely the 4620 code compiles but simply hangs in one case where I use inline assembler which runs fine in the 452. I may be doing something crazy but had very few problems under XP. I wondered whether there ight be a bank switching issue with the 4620.
Very many thanks, I value your support which has put me right since I first purchased MMP !
Amfortas
Still cannot compile 4620 successfully. Now I have lost my registration code for some unexplained reason and running my reg.exe does not restore registration even though I loaded latest version and registered a few days ago ! Awaiting a replacement key to hopefully get back to business.
I will get back once all is restored and if the 4620 problem remains. I have not used the debugger since I have always used "gotchas" to trace program bugs. Strangely the 4620 code compiles but simply hangs in one case where I use inline assembler which runs fine in the 452. I may be doing something crazy but had very few problems under XP. I wondered whether there ight be a bank switching issue with the 4620.
Very many thanks, I value your support which has put me right since I first purchased MMP !
Amfortas
Re: PIC18F4620 Compiles but does not Run
Hi,
Please, can you tell me more details of this issue that you are having, maybe attach a minimal project that demonstrates it ?
As for the registration, I have replied to you on the other topic.
Regards,
Filip.
Please, can you tell me more details of this issue that you are having, maybe attach a minimal project that demonstrates it ?
As for the registration, I have replied to you on the other topic.
Regards,
Filip.
Re: PIC18F4620 Compiles but does not Run
Hi Filip und Magik,
Having sorted out more of the Win8.1 insanities, I can isolate this code as functional in the 452 PIC and possibly not functional in the 462 PIC.
The code extracts data from an ADC register over an SPI link where I chose to use assembler because of various quirks in the Intersil ISL 26104 implementation such as different write and read modes and the need to verify ready-high to low transition.
The code reads data correctly in 452 but returns FF in 4260.
Function Get_Register(AD,Dummy:Byte): Byte;
{var R1:byte;}
begin
SSPCON1:=0;
SSPSTAT:=0x40; { 0 1 0 0 0 0 0 0 }
{ SMP = 0, CKE = 1}
SSPCON1:=0x31; { 0 0 1 0 0 0 1 0 }
{ CKP Idle Low. Clock Fosc/6}
SSPBUF:=AD; { Load Register Address Byte }
Chip_Select:=0;
{Delay_uS(100); }
ASM
{bcf Chip_Select} { Chip_Select =0 }
Char1: btfss SSPSTAT,BF { Check Address in SPI Buffer }
goto Char1
movf SSPBUF,W { If SPI Buffer full then discard }
clrf SSPBUF // Empty SPI Data Buffer
end;
SSPBUF:=Dummy; { Load Register Data Byte }
{Delay_mS(10); }
ASM
Char2: btfss SSPSTAT,BF { Check Data in SPI Buffer }
goto Char2
movf SSPBUF,W { If SPI Buffer full then }
clrf SSPBUF // Empty SPI Data Buffer
movwf _Res1 { pass Data to Res1 }
{bsf Chip_Select}
end;
Delay_uS(50);
Chip_Select:=1;
Result:=Res1;
end;
I do not know whether bank switching is an issue since native assembler does address acknowledging banks and since the inline assembler doe not provide bank switching instructions I have assumed that this is automatically dealt with.
The 4620 has larger memory to this might be the issue ?
Anyway now that the 4620 appears to run, I have a new ball game and much to explore !
I have been diverted by the impression that simple Library routines would run in the 452 and not the 4620 but I need to set up my EasyPIC6 again to switch beteen the two PICs, I have historic inline assembler running in both 452 and 4620 products. If you can see something in the above code which might not run in the 4620 that would be immensely useful.
Please do not spend much time on this. It is something which I must diagnose ! Win 8.1 simply trashes my XP fluency.
Best regards,
Amfortas
Having sorted out more of the Win8.1 insanities, I can isolate this code as functional in the 452 PIC and possibly not functional in the 462 PIC.
The code extracts data from an ADC register over an SPI link where I chose to use assembler because of various quirks in the Intersil ISL 26104 implementation such as different write and read modes and the need to verify ready-high to low transition.
The code reads data correctly in 452 but returns FF in 4260.
Function Get_Register(AD,Dummy:Byte): Byte;
{var R1:byte;}
begin
SSPCON1:=0;
SSPSTAT:=0x40; { 0 1 0 0 0 0 0 0 }
{ SMP = 0, CKE = 1}
SSPCON1:=0x31; { 0 0 1 0 0 0 1 0 }
{ CKP Idle Low. Clock Fosc/6}
SSPBUF:=AD; { Load Register Address Byte }
Chip_Select:=0;
{Delay_uS(100); }
ASM
{bcf Chip_Select} { Chip_Select =0 }
Char1: btfss SSPSTAT,BF { Check Address in SPI Buffer }
goto Char1
movf SSPBUF,W { If SPI Buffer full then discard }
clrf SSPBUF // Empty SPI Data Buffer
end;
SSPBUF:=Dummy; { Load Register Data Byte }
{Delay_mS(10); }
ASM
Char2: btfss SSPSTAT,BF { Check Data in SPI Buffer }
goto Char2
movf SSPBUF,W { If SPI Buffer full then }
clrf SSPBUF // Empty SPI Data Buffer
movwf _Res1 { pass Data to Res1 }
{bsf Chip_Select}
end;
Delay_uS(50);
Chip_Select:=1;
Result:=Res1;
end;
I do not know whether bank switching is an issue since native assembler does address acknowledging banks and since the inline assembler doe not provide bank switching instructions I have assumed that this is automatically dealt with.
The 4620 has larger memory to this might be the issue ?
Anyway now that the 4620 appears to run, I have a new ball game and much to explore !
I have been diverted by the impression that simple Library routines would run in the 452 and not the 4620 but I need to set up my EasyPIC6 again to switch beteen the two PICs, I have historic inline assembler running in both 452 and 4620 products. If you can see something in the above code which might not run in the 4620 that would be immensely useful.
Please do not spend much time on this. It is something which I must diagnose ! Win 8.1 simply trashes my XP fluency.
Best regards,
Amfortas
Re: PIC18F4620 Compiles but does not Run
Nope .amfortas wrote: I do not know whether bank switching is an issue since native assembler does address acknowledging banks and since the inline assembler doe not provide bank switching instructions I have assumed that this is automatically dealt with.
No. Your assembly may work or not, whatever the processor, depending on where Res1 is placed and, if it's not in Access Bank, which memory bank is active just before you use this variable.The 4620 has larger memory to this might be the issue ?
Simply make the assembly independent on banking. And, instead of using additional variable, move contents of W directly to result
Code: Select all
//movwf _Res1 { pass Data to Res1 }
movff WREG,Get_Register_local_result
Re: PIC18F4620 Compiles but does not Run
Thanks Janni,
Yes I just took pot luck with Res1 and accepted on the basis that it worked in the 452. I have to clear in my mind what you are saying but it seems a probable cause and certainly an error in my thinking.
I may not try things out for a day or too but I will come back hopefully with problem solved
Greatly appreciated !
Amfortas.
Yes I just took pot luck with Res1 and accepted on the basis that it worked in the 452. I have to clear in my mind what you are saying but it seems a probable cause and certainly an error in my thinking.
I may not try things out for a day or too but I will come back hopefully with problem solved
Greatly appreciated !
Amfortas.
Re: PIC18F4620 Compiles but does not Run
Hi Janni,
This code still hangs using the 4620 runs fine in the 452 where I have 4 prototypes running.
Function Get_Register(AD,Dummy:Byte): Byte;
{var R1:byte;}
begin
SSPCON1:=0;
SSPSTAT:=0x40; { 0 1 0 0 0 0 0 0 }
{ SMP = 0, CKE = 1}
SSPCON1:=0x31; { 0 0 1 1 0 0 0 1 }
{ CKP Idle Low. Clock Fosc/64}
SSPBUF:=AD; { Load Register Address Byte }
Chip_Select:=0;
{Delay_uS(100); }
ASM
{bcf Chip_Select} { Chip_Select =0 }
Char1: btfss SSPSTAT,BF { Check Address in SPI Buffer }
goto Char1
movf SSPBUF,W { If SPI Buffer full then discard }
clrf SSPBUF // Empty SPI Data Buffer
end;
SSPBUF:=Dummy; { Load Register Data Byte }
{Delay_mS(10); }
ASM
Char2: btfss SSPSTAT,BF { Check Data in SPI Buffer }
goto Char2
movf SSPBUF,W { If SPI Buffer full then }
clrf SSPBUF // Empty SPI Data Buffer
movff WREG,Get_Register_local_result
end;
Delay_uS(50);
Chip_Select:=1;
{Result:=Res1;}
Result:=Result;
Result:=Result;
end;
There must be something very fundamental which I am missing !
I am sticking with the 18F452 just now since is has ample memory for my project. I really need to do more work on this to collect the information but working with the 452 is kind of attractive just now.
Best regards,
Amfortas
This code still hangs using the 4620 runs fine in the 452 where I have 4 prototypes running.
Function Get_Register(AD,Dummy:Byte): Byte;
{var R1:byte;}
begin
SSPCON1:=0;
SSPSTAT:=0x40; { 0 1 0 0 0 0 0 0 }
{ SMP = 0, CKE = 1}
SSPCON1:=0x31; { 0 0 1 1 0 0 0 1 }
{ CKP Idle Low. Clock Fosc/64}
SSPBUF:=AD; { Load Register Address Byte }
Chip_Select:=0;
{Delay_uS(100); }
ASM
{bcf Chip_Select} { Chip_Select =0 }
Char1: btfss SSPSTAT,BF { Check Address in SPI Buffer }
goto Char1
movf SSPBUF,W { If SPI Buffer full then discard }
clrf SSPBUF // Empty SPI Data Buffer
end;
SSPBUF:=Dummy; { Load Register Data Byte }
{Delay_mS(10); }
ASM
Char2: btfss SSPSTAT,BF { Check Data in SPI Buffer }
goto Char2
movf SSPBUF,W { If SPI Buffer full then }
clrf SSPBUF // Empty SPI Data Buffer
movff WREG,Get_Register_local_result
end;
Delay_uS(50);
Chip_Select:=1;
{Result:=Res1;}
Result:=Result;
Result:=Result;
end;
There must be something very fundamental which I am missing !
I am sticking with the 18F452 just now since is has ample memory for my project. I really need to do more work on this to collect the information but working with the 452 is kind of attractive just now.
Best regards,
Amfortas