It's not so slow... you're seeing what it should be.
The 16F isn't any faster. Since the max clock is 32MHz, it'll be half the speed.
If you want the 18F to be faster use LAT as Richard showed.
It's not so slow... you're seeing what it should be.
The 16F isn't any faster. Since the max clock is 32MHz, it'll be half the speed.
If you want the 18F to be faster use LAT as Richard showed.
No I don't mean that. I mean different thing - a lot of code posted here is exclusively for 18F series. When asked, authors say that 16F has no speed to do it. But now it turns out that there is no performance difference per mhz at all?
The PIC18F advantage over the 16F is more instructions. The 18F's ASM "MOVFF" allows transfer of a byte of data directly from one register to another. For the PIC16F, it would take several instructions using the W Register.
Thanks!
So besides more peripherals, like USB host, 2x osc speed and 2x memory, there are no other advantages, right?
Those extra instructions definitely make a difference. It's not just clock speed. If it takes more instructions to do the same thing then that's a disadvantage.
That, plus even though the memory is still banked you don't have the horrible ram arrangement that the PIC16 suffers from, and no program memory page issues.
The 18F has a hardware multiplier, dual-priority interrupts, more FSR registers.
All in all, if you have a choice between 16F and 18F, 18F is the better choice. It'll produce faster code in a lot of instances.
The only reasons I can think of to use a 16F might be price or perhaps power consumption.
Last edited by tumbleweed; - 11th January 2023 at 23:22.
not to mention the flash memory is 16 bits wide allowing for tabled data to be accessed way easier, eliminating any need to pack/unpack data.
bigger faster fonts with less effort, works for me
Warning I'm not a teacher
All that good, but does PBP uses them? The main difference I found is the dimension of arrays and long variables.
Say, average, 500 line PBP code will run significantly faster on 18F or not?
I don't care for banks or whatever with 16F - compiler takes care of.
Price is also not an issue - 18F45K80 and 16F1939 (which I most often use) have same price in china - around $3 new, $1 - 2nd hand.
Bookmarks