17 ms·
A Guide to Pic Microcontroller Paging
- lmilcin 6y agoCan somebody explain why anybody would want to put up with PIC in 2020 when ARMs are so cheap and energy efficient and development tools got to a point where you get working toolchain with no time or money expense (for example with stm32cubeide and st-link)?
- analog31 6y agoI was about to say that only PIC chips come in 8- and 6-pin packages, but I see that I'm wrong about that. Microchip's patent must have run out fairly recently. I gave up on the PIC platform quite some time ago.
- zokier 6y agoATtinys have been available in 8 pin packages for about 2 decades, and in 6 pin packages for 1 decade. What patents are you referring to?
- analog31 6y agoThis one in particular: https://patents.google.com/patent/US5847450A/en https://patents.google.com/patent/US5847450A/en https://www.eetimes.com/microchip-sues-zilog-over-8-pin-microcontrollers/ https://www.eetimes.com/microchip-sues-zilog-over-8-pin-micr... However, it would not shock me if someone were to take a critical look at the validity of Microchip's patents.
- lmilcin 6y agoSome STM32s are available in WLCSP packages which are 2.5x2.5mm and have 36 pins. https://electronics.stackexchange.com/questions/144005/wlcsp-mcus-what-hardware-is-needed-for-programming-these-tiny-chips https://electronics.stackexchange.com/questions/144005/wlcsp...
- alex7o 6y agoThere is no good commercial reason to go with a pic, there are cheaper 8bit MCU s like 0.01$ cheap or even less, or as you said arm ones that are much faster, with free tooling and good JTAG/swd debugging. However there are millions of PICs that are still used so it is useful to know these things.
- m-ee 6y agoI haven’t looked into the ultra cheap stuff in a while, are you talking about other 8 but mcus from major manufacturers or the ultra cheap no name alibaba stuff? PICs historically have good data sheets which is worth a non trivial amount of money
- joshvm 6y agoPIC extreme low power (xlp) is ridiculously low - at least an order of magnitude lower sleep current (9nA) than ARM equivalents. They also have very low uA/Mhz, but some ARM chips are approaching or exceeding that (eg SAM L). There's also something to be said for simplicity and ease of hardware development, as opposed to a race to the bottom on price. Do you necessarily need all that ARM grunt? 8 bit micros tend to need very little support circuitry and can have very low pin counts - eg the PIC10F322 is 6 pin, 20nA sleep current and comes in a DFN package. There are also applications where having a DIP package chip is useful (easy replacement, for example).
- zozbot234 6y agoRISC-V will probably be more of a competitor to PIC once suppliers really get going. There's even a standard RV32E spec that's limited to 16 registers, which should make for tiny area footprint even in old process nodes.
- joefourier 6y agoThat's the mentality that leads to toasters running Linux. For many applications there's absolutely no need for ARM MCUs and all their added complexity. Plus for the hobbyist at home, PIC still comes in DIP formats which is handy for breadboarding or soldering without the added difficulty of SMT.
- lmilcin 6y agoI make my own breadboardable ARMs using cheap converters. I only need a couple for prototyping. ARMs from ST can run for years on a single AA battery and have nowadays very easy tools. Probably you are missing understanding of whole range of ARM chips, these start from couple kB of flash and hundreds of bytes of memory.
- bitbckt 6y agoI couldn’t agree more with the parent. Further, PIC isn’t the only “non-ARM” in this space. Your average RainBird type water timer likely uses an MSP430, for example. The idea that ARM should be used in any/all situations is naive.
- exmadscientist 6y ago> The idea that ARM should be used in any/all situations is naive. I mean, sure, this is true. MSP430s are great when you need the lowest power, and AVRs are tiny and cheap for lowest cost. But... I do this for a living, and there's a reason our go-to is the Cortex-M series. M3 or M4 if you need a lot of CPU power, or M0/M0+ if you need small. They're just so, so much easier to program that the trivial additional cost of the microcontroller washes away in the noise. And it's not like this leads to Linux toasters; the M0 is not a microprocessor, it's a microcontroller. It's got a two-stage "pipeline" and absolutely no memory protection! There are tricks to get the larger M3s to run Linux, but it's hacky and not something you'd want to ship. PICs are essentially obsolete, and none of us would ever consider them for new development. They're annoyingly constrained hoary old beasts.
- bitbckt 6y ago
- sitzkrieg 6y agolegacy momentum is still a factor too for sure. its easier to move an old, industrially in use 16F84 to eg 16F18xxx or pic18F or smaller faster modern low power pics with minimal code changes. and MCC is pretty good ive seen a lot of critical timing code down to using the 4 clock instruction timing have to stay on similar devices to save rewrite effort etc
- rasz 6y ago-inertia -legacy designs -expertise -corporate politics
- cushychicken 6y agoLegacy code support. Very low power consumption. Aggressive pricing (if you've got the volume). Ace technical support. (Again - if you've got the volume.)
- fisherjeff 6y agoToolchain masochism?
- indigo945 6y agoTechnically, the second block of code is not 100% equivalent. Why? Well, it uses more instructions (so more memory and also takes longer to execute) but it also sets ALL bits of the Program Counter, not just the ones that a goto or call can. We could use the second block of code to goto to a correct page, but it would be annoying to use in practice because it would mangle the W register. Does the code even work at all? I don't know anything about PIC microcontrollers, but I would have expected that writing to PCLACH would cause a jump immediately, meaning that the write to the low bits in PCL would never even happen.
- grantla 6y agoPCLATH is not actually the program counter; the real PC is only updated at GOTO/CALL time, and then PCLATH will be copied over.
- roamingryan 6y agoPCLATH stands for Program Counter LATch High (byte). In this case latch refers to the digital design technique where you have a register that holds bit(s) until some other event happens. The event in this case is a write to PCL. Once the event occurs, PCLATH is transferred to PCH synchronously/atomically with the write to PCL.
- Jetroid 6y agoWe can write to PCLATH without causing a jump. PCLATH is only read when we goto somewhere, or call a routine, or write to PCL.