??? 04/20/07 04:07 Read: times Msg Score: +2 +2 Good Answer/Helpful |
#137586 - Duhh! Responding to: ???'s previous message |
Mike, Have you actually read any documentation on the 8051? You talk about fandamental things as if they're revelations. For example the internal ram - it starts at 0x00 and continues until 0x7f (on a real 8051). You have 4 banks of registers in this area also, whether you want to use all four banks is up to you. So, you ram for variables can start at 0x08 if you're only using 1 register bank. Now, if you want to save some cycles in your ISRs, you can allocate a register bank for exclusive use in your ISR. So, your variables might start at 0x10. You also have to have your stack in there somewhere also. So being able to 'reliably' use ram from 0x30 is not entirely correct. Besides, you violate that by having a pointer in 0x08! As for my code overwriting SFRs - again, you haven't read the documentation! The SFRs are only accessed by direct addressing, not indirect addressing, so if you're using a 8052 architecture device, you get an extra 128 bytes from 0x80 to 0xff. As for my code not detecting if it hits 0x7f - there was a comment "add in test for end of buffer". If you're worried about internal ram - just use the external ram! Sure you get a small performance hit - 8051's weren't optimised for handling large memory structures! If you're worried about performance - either drop the baud rate or get a faster cpu! Besides, have you proven you don't have enough spare cpu cycles? Do you expect the serial data to be streaming in without any breaks? Don't create impossible situations for yourself. Personally, if I was doing TCP/IP via serial, I'd have my receive buffer in external ram and probably at least 1 MTU (1500+ bytes)in size. If my cpu was not fast enough to cope with 56kbaud, I'd drop the baud rate - there's nothing saying you must use 56K. AND I'd be writing my code in 'c', then optimising critical sections in assembler as required. You still haven't done my Pepsi challenge with the LCD code I posted yet have you? You like to learn, so you're letting a good learning experience pass you by. Next time, don't be too quick to tell me my code won't work - I've been doing this stuff for many years now, hopefully I have a least some clue about how it all works. At least I've been able to convince my employers of this. |
Topic | Author | Date |
if I could crunch my code... | 01/01/70 00:00 | |
Optimisation | 01/01/70 00:00 | |
the original 8051 is the problem... | 01/01/70 00:00 | |
Duhh! | 01/01/70 00:00 | |
again, I want to "crunch my code" | 01/01/70 00:00 | |
starg with something that works. | 01/01/70 00:00 | |
Did You Look at Movx @R0 ? | 01/01/70 00:00 | |
Thanks (after I tried it LOL) | 01/01/70 00:00 | |
data sheet | 01/01/70 00:00 | |
Hidden P2 Register?![]() | 01/01/70 00:00 | |
Simple,but no simpler | 01/01/70 00:00 | |
Problem? | 01/01/70 00:00 | |
save a few bytes by using JBC | 01/01/70 00:00 | |
an alternative | 01/01/70 00:00 | |
WRONG | 01/01/70 00:00 |