Page 1 of 1

recent compiler problems

Posted: Tue Jul 20, 2021 7:54 am
by richardb
Hi I hope someone can help me.

I've recently been having compiler problems with the code being erratic sometimes working and sometimes not even the oscillator running. I have used this pic before in other projects without issue. I'm not using usb it's just quite a small pic.

anyway i thought i would see if there was an updated version of the compliler and there was v2.2.2.5 icc 1.1.6.4. so i updated it and now i'm getting the following errors


Code: Select all

Device = 18F14k50
Clock = 48
' configuration...
Config CPUDIV = NOCLKDIV
Config USBDIV = OFF
Config FOSC = HS          
Config PLLEN = ON
Config PWRTEN = ON
Config BOREN = OFF
Config WDTEN = OFF  

Include "SetDigitalIO"
Dim LED As PORTC.5

SetAllDigital
Output(LED)

While TRUE
	DelayMS(50) 
	LED = Not LED
Wend
End
Capture.PNG
Capture.PNG (35.65 KiB) Viewed 4317 times
thanks

Re: recent compiler problems

Posted: Tue Jul 20, 2021 9:03 am
by richardb
I've just been throught the process again and it still thinks there is an update available. so updated and still the same.

Re: recent compiler problems

Posted: Tue Jul 20, 2021 9:40 am
by Jerry Messina
The online update should get you V2.2.3.6.

After that, download https://www.sfcompiler.co.uk/wiki/wiki- ... 2_2021.zip
Unzip the file to a folder and run SF_UPDATE_2_22_2021.exe

That will get you completely up to date with v2.2.3.6, ICC v1.2.0.7, and device files.

Re: recent compiler problems

Posted: Tue Jul 20, 2021 10:34 am
by richardb
Thanks again Jerry for the quick reply.

Si it didn't update to that version using the "help/about way. So I uninstalled it and re downloaded the full version on the sf site.

that reported the the previous version did the help/about update and now it has updated to ver2.2.3.6 then i ran your linked exe and that seems to have worked.

And it now compiles the basic test


Thanks again.

I just need to try and see if my original problems are still there.


Rich

Re: recent compiler problems

Posted: Tue Jul 20, 2021 11:48 am
by Jerry Messina
Great, Rich.

Let us know if you still have issues

Re: recent compiler problems

Posted: Wed Jul 21, 2021 8:13 am
by richardb
I do still have issues, my work computer seems to have some erratic issues with compiling/programming i'm starting to think our IT company have locked the machine down more than they should have..


Anyway even on my home computer i'm having some issues, I have used this pic before doing comms at 9600baud with no obvious extra register tweaking and i'm pretty sure it worked. if i run the following code i get a measured baud rate of 52.3kbaud.

Code: Select all


Device = 18F14k50
Clock = 48
' configuration...
Config CPUDIV = NOCLKDIV
Config USBDIV = OFF
Config FOSC = HS          
Config PLLEN = ON
Config PWRTEN = ON
Config BOREN = OFF
Config WDTEN = OFF  

Include "utils.bas"
Include "usart.bas"

Dim LED As PORTC.5

SetAllDigital

Output(LED)
Output(PORTB.7)

USART.SetBaudrate(br9600)


While TRUE
	DelayMS(50) 
	LED = Not LED
	USART.Write(85)
Wend
End
19200,34800,57600 all work as expected with low error
if i use "Mister e pic multicalc" and cut and paste the values.




RCSTA = $90 ' Enable serial port & continuous receive
TXSTA = $24 ' Enable transmit, BRGH = 1
SPBRG = 225 ' 9600 Baud @ 0.0%
SPBRGH = 4
BAUDCON.3 = 1 ' Enable 16 bit baudrate generator



it works.

but I'm sure i haven't done this previously..

It would be good to know if I'm doing something stupid, could i have the wrong device define?

i should point out that at home I'm using 2.2.3.5 icc 1.2.0.4

Re: recent compiler problems

Posted: Wed Jul 21, 2021 10:25 am
by Jerry Messina
There've been some changes to the usart modules to add support for new devices, so it's possible that has inadvertently changed something and it's not picking the right combination of settings anymore.

Try adding this to your 'include' section:

Code: Select all

#option USART_BRG16 = true
Include "usart.bas"
With SF 2.2.3.6 and ICC 1.2.0.7, that matches the Mister E calc settings for 9600 @ 48MHz

Re: recent compiler problems

Posted: Wed Jul 21, 2021 11:50 am
by richardb
that fixes it.

Thanks Jerry.

I did check one of the other pcb's with the preaviously used 14k50 and the baud rate was correct at 9600 . so i'm pretty sure something changed.

I must admit I don't normally use that low a baud rate but it was needed for historical reasons.
Rich

Re: recent compiler problems

Posted: Wed Jul 21, 2021 12:15 pm
by richardb
bizarrly my install of swordfish has stopped working again with asm errors

and on checking its back to ver 2.2.5 icc1.1.6.4

is this likely to my our it company reverting to a pervious setup?

Re: recent compiler problems

Posted: Wed Jul 21, 2021 12:43 pm
by Jerry Messina
so i'm pretty sure something changed
That's odd... I check USART.bas going all the way back to v2.2.3.0 ICC 1.2.0.0 and it's pretty much the same,
so I don't think the baudrate settings should be any different.
and on checking its back to ver 2.2.5 icc1.1.6.4
is this likely to my our it company reverting to a pervious setup?
You'd have to ask them.
Our IT dept has things so locked down I can't even install SF on my work machines anymore.

Re: recent compiler problems

Posted: Thu Jul 22, 2021 5:59 am
by richardb
it is odd, thanks for checking Jerry.

I'll see if there's anything that I've missed.