I want to understand, why most (or all?) examples for MCP2100 (by the way very useful) are for the Thumb mode? The main resource of the LPC2129, which has not an external memory support, most attractive for designers, I think, is speed, the Flash size is the second or third. Maybe there is some misunderstanding, and Thumb is better than ARM both by size and performance? Then why ARM? Great thanks in advance, Varuzhan
Here are two statements from Philips LPC2000 users manuals: - THUMB code is able to provide up to 65% of the code size of ARM, and 160% of the performance of an equivalent ARM processor connected to a 16-bit memory system. - For critical code size applications, the alternative 16-bit Thumb Mode reduces code by more than 30% with minimal performance penalty. These statements are somehow confusing, but you need to keep in mind that instruction fetching is slower than code execution. Effectively more Thumb mode instructions are required compared to ARM mode, but in Thumb mode code size is less and therefore more instructions can be executed in the same time. When LPC2000 devices execute code from on-chip Flash at maximum clock (= 60MHz) the Flash sub-system delivers 128 bits (4 ARM or 8 Thumb instructsion) at a rate of 20MHz. ARM code that executes sequencial requires no stalls. But, real code contains branches (conditional or sub-routine calls). For Thumb code more instructions can be fetched at the same time which requires less stalls. We do not have comparisons yet for Thumb vs. ARM speed, however Philips told us to focus on Thumb mode. The assumption is that the speed penalty is less than 10% (compared to 35% size reduction). High-speed interrupts may be coded directly in ARM mode (and the code may be stored in RAM using the __ram compiler attribute). Therefore extreme time-critical stuff still uses highest ARM execution speed whereas the majority of the code uses the Thumb mode for maximum code efficiency with minimal speed reduction. Reinhard
Dear Reinhard, Thank you very much. I have seen this 160%,that is why I especially mentioned the part without external memory. The 10% less speed assumption is, maybe not too large, but if not all flash is used, why sacrifice this 10% for unused 35%. Best regards, Varuzhan
If code size is not an issue, just use ARM mode and you are fine. Our focus is code size, since on-chip Flash ROM is limited (and most programs tend to required more functionality than estimated in the beginning) . With other words: use Thumb and purchase an 32KB LPC2131 instead of an 512KB LPC2138. Then spend the saved moeny for a good dinner with your girl friend.