News:

Let's find out together what makes a PIC Tick!

Main Menu

Compiler moving to faster micros?

Started by Ecoli-557, May 09, 2025, 04:36 PM

Previous topic - Next topic

top204

#20
Many thanks Bob.

I have a PICkit4, and it does not support the newer devices (again, the American way, because it would if programmed too, because the circuitry is all there to do so). LOL

It is difficult finding information on supported devices with that ICSP unit, so I do not know if it is suitable. But many thanks. I have a sneaky feeling they have ripped off the mikroelektronika programmer unit, which was absolutely dreadful. But...... It is using a "32-bit Arm" microcontroller operating at hundreds of MHz, so it "must" be good, according to them.

What a load of bullshit.... It is just a 'bloody' device programmer, not a starship navigation unit, navigating to another solar system, and also maintaining life support! :-)

Best regards
Les

Fanie

I have always said that Microchip makes awesome hardware, until it gets handed over to the software ....
But, it's not just them, Arduino does the same.  Espressif makes a very nice programmer, but do you think you can write a hex file into a micro ?  And just try to find the programmer.  They want you to buy a 3rd party board to write your code into a micro.

What is in the pickit4 that does not allow newer pics to be programmed ?
Can it be an external file created for a micro that prevent in it the programmer from using it ?

Fanie

#22
QuoteI have a PICkit4, and it does not support the newer devices (again, the American way, because it would if programmed too, because the circuitry is all there to do so). LOL

pickit 5 vs pickit 4  - The only functional differences are the use of the USB-C connector (instead of the older micro-B USB) and Bluetooth connectivity.

MPLab IPE is supposed to upload the micro selected files so you can program that one.
What is a bit retarded is that if you select a "slower" micro is you have to tell the IPE to program slower.

It is possible that since Microchip buy other micro's up with different structures that a problem can arise from that.

https://packs.download.microchip.com/DeviceDoc/Device_Support.pdf


Stephen Moss

Quote from: Fanie on May 20, 2025, 03:13 PMWhat is in the pickit4 that does not allow newer pics to be programmed ?
It may just be a software issue, in that Microchip stop updating the firmware with support for new devices, thus you have to purchase their latest PICkit incarnation to program newer devices.
They did the same with the PICkit 2 & 3, when the PICkit4 came out, hence why myself and others started using software like PICKitPlus/PICkitMinus as that allows us to program the newer devices with the older programmers. It has been a while since I did any PIC work so if you are having problems programming a particular device it may be worth checking them out to see which programmers and devices they currently support.

Fanie

#24
Quote from: Stephen Moss on May 22, 2025, 08:06 AMIt may just be a software issue, in that Microchip stop updating the firmware with support for new devices, thus you have to purchase their latest PICkit incarnation to program newer devices.
They did the same with the PICkit 2 & 3, when the PICkit4 came out, hence why myself and others started using software like PICKitPlus/PICkitMinus as that allows us to program the newer devices with the older programmers. It has been a while since I did any PIC work so if you are having problems programming a particular device it may be worth checking them out to see which programmers and devices they currently support.

I discussed the programmer issue with my brother, and he said that the firmware is supplied by Microchip.  I think if you re-install the MPLab IDE it could perhaps solve the problem with newer devices.  Apparently the PICkit4 still have sufficient hardware to support any of the newest pics.
This file https://packs.download.microchip.com/DeviceDoc/Device_Support.pdf indicate the PICkit4 program all the pics and is listed at the end of the document.

If you search any micro using Everything, you will see the list of files associated with that micro.

It is possible that the PICkit2 & 3 did not support certain functions required for the newer larger micro's, perhaps the size of the SD card that can be saved to for programmer-on-the-go or another issue like program speed.

My brother said the 33AK Les mentioned has some very nice peripherals and he used it in a project.

JonW

Many programmers today rely on brute-force approaches—cranking up clock speeds and throwing more processing power at problems—rather than developing deeper technical skills. While good compilers certainly help, nothing beats understanding your target hardware architecture, its instruction set, and designing efficient code flow. This combination delivers blazing performance that raw speed alone can't match.

Breaking complex operations into small, efficient tasks and measuring execution times seems foreign to many younger developers. There's an excellent YouTube video demonstrating L1 cache optimization and how C programmers often overlook that a single bit declaration can consume 64 bits of memory, or that bitwise operations sometimes require floating-point routines depending on the allocation  of memory and the compiler.

Take the humble Padauk microcontroller—costing under 10 cents—with its multiple FPPA (Field Programmable Processor Array) or time-sliced soft cores. For simple real-time processes, these chips outperform ARM Cortex-M3 processors. This illustrates how understanding underlying processes, rather than simply increasing clock speeds, can reduce costs, improve reliability, and simplify code.

While I'm not a full-time programmer, I believe I can write more efficient code using devices that cost and consume a fraction of what others typically employ. My experience with the RP2040 and ESP32 was disappointing—30KB of code just to blink an LED was excessive. Arduino-based WiFi projects quickly exhausted device memory. I achieved the same functionality using a Wiznet chipset and an 8-bit PIC microcontroller in under 4KB.

This reminds me of Bill Gates' infamous comment about 512KB being sufficient for any task. Now my phone probably uses several megabytes just to boot up—a testament to how far we've drifted from efficient programming practices.

Oskar-svr

#26
When I started this whole adventure, I did it with INTEL microprocessors, such as the 8080, 8088, and the glorious Z80. I understood the topology of the architecture of interfaces such as memory and peripherals, among many other things. It was very important to understand how a microprocessor and a microcontroller work, in machine language, learn the instruction set of each device, understand how the instructions work and what they are for, take into account the clock cycles that each instruction executes, and with this, calculate the time each instruction takes in a programming line.
For example, if you wanted to create a 500 ms delay, you had to know what the set of instructions you needed was, and when you started the program, this depended on how many programming lines were needed, and we calculated all the clock cycles that all the instructions used took to reach the optimal delay—not easy at all.

Nowadays, it's very easy to use with the compiler POSITRON; just type the DELAYMS 500 instruction and that's it, your delay is ready.
In truth, knowing the instruction set in machine language helped us optimize the code due to the limitations of an EPROM memory.

Today, the new generations want it very easy, like in the case of Arduino and all those new systems, everything is based on libraries that make life easier, and as JONW says, they don't understand or don't know how to optimize a program. I don't mean to say that I'm against the new high-speed chips, but few understand what I mentioned before.
I don't know if they know what a clock cycle is, as a note, and with this, how to choose an 8, 16, or 32-bit device to carry out a project and even how to determine so that the cost is not high. In my experience, in a project I advised, people wanted to use a Spartan FPGA, and when I explained the differences in cost and functionality, they leaned toward a PIC16F877.
Speed ��is not the solution as it says. JONW

Fanie

QuoteSpeed ��is not the solution as it says. JONW
Says all the guys with slow bikes  ;D

RGV250

QuoteSays all the guys with slow bikes
I have an RGV250 and I am not complaining about the lack of top speed as it is faster round corners and much more fun :)  :)  :)  :)

And the lovely 2 stroke noise !

top204

#29
You are correct Fanie. I updated the MPLABX to version 6.25, and the MPLAB IPE software now has the dsPIC33AK devices in it. Many thanks. :-)

There are so many wise, and intelligent, people on this forum, and following this post shows how rational and down-to earth you all are.