Problem with sample files for PIC16F183xx series

18 views
Skip to first unread message

FraserSmith51

unread,
Sep 27, 2021, 6:00:30 PM9/27/21
to jallist
I think there may be a problem with the way the Blink a LED internal oscillator Sample files for the PIC16F183xx series chips have been created. The value of OSCFRQ_HFFRQ is given as 0b010. The data sheet shows it as a 4 bit value. If the value of 0b010 is looked up in the Data Sheet it shows the frequency as as Reserved. Running the program with the data sheet value of 0b0011 for 4MHz gives flashes twice as fast as calculated and that must be due to the oscillator running twice as fast as the 4MHz stated. This is most likely because there is no value given for NOSC although that combination is reserved. With NOSC = 0b000 the 2xPLL is enabled for 8, 12 & 16MHz to give 16, 24 & 32MHz clock speed. If a clock of 4MHz is required then HFFRQ should be 0b0011 and NOSC should be set as 0b110.
Cheers
Fraser

Rob CJ

unread,
Sep 28, 2021, 12:51:55 PM9/28/21
to jal...@googlegroups.com
Hi Fraser,

Thanks for reporting this. I will have a look at it.

I am also looking at your JAL for Mac request and made some progress (not yet compiling the compiler). If I will manage I will let you know.

And as Sunish already mentioned, Visual Studio also runs on Mac (I hope I am not offending anybody here) and you could use the JAL VS code extension that Sunish made. Currently I am always using VS code since it has some nice features that make JAL programming easier.

Kind regards,

Rob


Van: jal...@googlegroups.com <jal...@googlegroups.com> namens FraserSmith51 <fra...@cairntoul.net>
Verzonden: dinsdag 28 september 2021 00:00
Aan: jallist <jal...@googlegroups.com>
Onderwerp: [jallist] Problem with sample files for PIC16F183xx series
 
I think there may be a problem with the way the Blink a LED internal oscillator Sample files for the PIC16F183xx series chips have been created. The value of OSCFRQ_HFFRQ is given as 0b010. The data sheet shows it as a 4 bit value. If the value of 0b010 is looked up in the Data Sheet it shows the frequency as as Reserved. Running the program with the data sheet value of 0b0011 for 4MHz gives flashes twice as fast as calculated and that must be due to the oscillator running twice as fast as the 4MHz stated. This is most likely because there is no value given for NOSC although that combination is reserved. With NOSC = 0b000 the 2xPLL is enabled for 8, 12 & 16MHz to give 16, 24 & 32MHz clock speed. If a clock of 4MHz is required then HFFRQ should be 0b0011 and NOSC should be set as 0b110.
Cheers
Fraser

--
You received this message because you are subscribed to the Google Groups "jallist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallist+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallist/f32c44b2-db7c-42ef-a378-ee676321d772n%40googlegroups.com.

FraserSmith51

unread,
Sep 29, 2021, 2:36:58 AM9/29/21
to jallist
Thanks Rob

It looks like the big brother families, the PIC16F184xx, PIC16F188xx and PIC16F191xx are also likely to be affected.

Thanks for the news on Mac progress. My friend will carry on using his old PC for for JAL until he can move over to the Mac.

Your comments above about Visual Studio making things easier is very interesting. Some information on the things that you find easier by VS would be very useful. I installed VS but missed being able to open the include files from the Code Explorer in JAL Edit. I didn't see a way to do that in VS.

Thanks again

Fraser

Rob CJ

unread,
Sep 29, 2021, 2:06:34 PM9/29/21
to jallist
Hi Fraser,

I never used the code explorer. I mainly like VS Code feature to be able to split screens when you want to edit a file in two places at the same time. 

But some good news. I managed to create a JAL compiler for the Mac!

Still preliminary but I compiled one simple sample file and the produced hexfile is correct.

I will send you the version directly (using your e-mail adres) using Wetransfer.

Please give it a try and let me know if it works.

Kind regards,

Rob


Verzonden: woensdag 29 september 2021 08:36
Aan: jallist <jal...@googlegroups.com>
Onderwerp: Re: [jallist] Problem with sample files for PIC16F183xx series
 

rob...@hotmail.com

unread,
Oct 4, 2021, 2:30:19 PM10/4/21
to jallist
Hi Fraser,

I fixed the error in the blink-sample file for the  PIC16F183xx series chips. I also changed the script in such a way that it will produce an HS sample, an INTOSC sample and a USB sample (only if possible). This resulted in 560 new INTOSC blink sample files.

 I will do some checks this week and if OK, I will upload all (it is easier for my to upload all blink sample files than a selection of 560) blink sample file so that the fixes and the new ones will be part of the next bee-package.

Kind regards,

Rob


Op woensdag 29 september 2021 om 20:06:34 UTC+2 schreef rob...@hotmail.com:

rob...@hotmail.com

unread,
Oct 8, 2021, 12:56:37 PM10/8/21
to jallist
Hi Fraser,

This issue is fixed. I also uploaded about 560 new blink_intosc sample files for PICs that did not yet have them. They will be part of the next bee package. 

As you may understand I did not test these 560 sample files. Normally I do a test when I release a new device file using a blink sample. For your specific PIC I only tested the HS version, and not the INTOSC version that's why I did not find your problem. Next time I will test both HS and INTOSC. So if you or somebody else runs into an issue with the blink sample files let me know.

BTW. It may take some time before device files for new PICs will be added. I ordered some samples at Microchip: Delivery takes 364 days!.

Kind regards,

Rob


Op maandag 4 oktober 2021 om 20:30:19 UTC+2 schreef rob...@hotmail.com:

FraserSmith51

unread,
Oct 10, 2021, 2:04:31 AM10/10/21
to jallist
Hi Rob,


Thanks for doing that. I coped with it but there would be those who couldn't that might get put off JAL completely because of that.

Yes, the supply of PICs is not great these days. I know someone who was looking for the surface mount version of the 16F18313 and that's on a February next year delivery at the moment.

Thanks again for your efforts here

Fraser
Reply all
Reply to author
Forward
0 new messages