Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

PIC24, the 16bit PIC variant, is much imporved in this respect. You have 16 working registers (though one of these is used for the stack), four of these are shadowed for fast store/restore (eg, so the registers can be used in an interrupt handler), memory is directly accessible (most instructions can operate on both memory and registers equally) and the instruction set is very simple and regular.

I have not used it with C (I have so far written my code in PIC assembly), but they claim the instruction set is very compiler friendly and at a guess, I'd say they're right since the memory access is very regular and most instructions also come in convenient three-operand forms.

I'm not sure if the instruction set for the PIC24 is basically a 16bit variant of the PIC32 (have not looked into these in detail yet), but from the code samples I've seen, it seems to be. So PIC24, like PIC32, seems to be a RISC-based core.

I actually like the PIC24. Besides the painful lack of (assembly) documentation outside the datasheet and various reference manuals (I guess nobody programs them in assembly these days? I suppose the same problem probably exists for other newish microcontorllers too?), it is very nice and easy to work with. The assembly language is very simple and easy to use. But, since the Cortex-M3 is similarly priced, but is faster (~100MHz vs 40MHz for a PIC24H), is 32bit, has a ton of features and peripheral support, its hard to choose PIC over these. I will probably look into switching to CM3 for my next project.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: