Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
05/28/07 21:10
Read: times


 
#139945 - some answers...
Responding to: ???'s previous message
Chico Magalhães said:
Hi David, thank you for your answer. I'm now starting to understand all this... I'm using AT89S52, i think it has 8k of memory, in other words, lots and lots (*Im with a smile in the face)

Nice :)

Im using Asem51 as assembler.
You mean, that, MOVC reads a code memory location as value not as code/command?

Yup, that's right. movc will function like a mov except that it will mov the value stored in the address which dptr points to (assuming you've cleared a).


Never heard about cseg, what is?


cseg is a directive to tell your assembler/linker where a code segment is versus say a data segment. There are other directives like bseg, dseg, and iseg. Cseg is just a directive to say "code lives here." Check out the A51 manual for more info.


Every time i go read something i need to clear A, right?

I assume you're talking about using movc to read from code memory here. If that's the case, yeah you'll probably have to clear a ever time and inc the dptr. It's not always a necessity depending on what you want to do, but I'm guessing in your case you should.


Can the MCu write to itself flash memory? By now, i dont need any reservation, since my program will be very small.


Yes, depending on your microcontroller. I'm not familiar (beyond datasheet browsing) with Atmel parts, but I'm sure that there are some (probably yours included) that can write to their own flash. When you do this though you'll probably have to erase an entire page of flash as typically writes can only make a bit 1 so if you want to change something like 010 to 101 you would need to erase it all first (make it 000) and then write 1x1). Often when you do this you can't write a zero. Long story short, yeah you should be able to do it.


You helped me a lot, thanks. But i will bother you a bit more (lol).


no problem :)


List of 24 messages in thread
TopicAuthorDate
How to store data in 8051/DB command            01/01/70 00:00      
   More Detail            01/01/70 00:00      
      Data            01/01/70 00:00      
         DB            01/01/70 00:00      
            1k in db            01/01/70 00:00      
               depends            01/01/70 00:00      
                  starting to understand            01/01/70 00:00      
                     Yes            01/01/70 00:00      
                        better?            01/01/70 00:00      
                           Example ?            01/01/70 00:00      
                              need...            01/01/70 00:00      
                                 Thats it            01/01/70 00:00      
   some answers...            01/01/70 00:00      
      I got MOVC!            01/01/70 00:00      
         The datasheet is the cuestion            01/01/70 00:00      
         store the A contents away...            01/01/70 00:00      
   cant debug a problem...            01/01/70 00:00      
      First step            01/01/70 00:00      
         a skywriter...            01/01/70 00:00      
            well, if you copy crap,, you get crap            01/01/70 00:00      
      I always thought.....            01/01/70 00:00      
   Cant debug, explained + Code            01/01/70 00:00      
   I THINK i found the problem            01/01/70 00:00      
      Long lines            01/01/70 00:00      

Back to Subject List