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

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
02/24/05 08:42
Read: times


 
#88286 - *ALL* Compilers!
Responding to: ???'s previous message
Lee Kien said:
i'm trying to use Timer 2, but it seems that my compiler can't understand/recognise what is T2CON, TR2, ET2, etc. I'm using MCS-51 asembler and linker.

That's an Assembler - not a Compiler!

A Compiler compiles high-level source code (eg, 'C');
An Assembler assembles low-level assembly source code.

That's why it's called "MCS-51 asembler" - not "MCS-51 Compiler"

Anyhow, any 8051 Assembler or Compiler will support Timer 2 - or any other peripheral, for that matter.

This is because there are no special instructions involved in using Timer 2; or any other peripheral, for that matter - it's just a matter of writing the right value(s) to the right SFR(s).

Your problem is in assuming that your tools will automatically see the symbols T2CON, TR2, ET2, etc and just "know" that these are SFR addresses - this is not necessarily the case!

You need to read your Manuals to find if there are any predefined SFR symbols. You may need to use a command-line option, or an Include File

List of 21 messages in thread
TopicAuthorDate
Which Compiler supports Timer 2            01/01/70 00:00      
   do by hands            01/01/70 00:00      
      Keil?            01/01/70 00:00      
         Alternative            01/01/70 00:00      
         indeed            01/01/70 00:00      
            Nothhing to do with Modern!            01/01/70 00:00      
               then maybe "user's friendly"?            01/01/70 00:00      
                  (in)Convenience            01/01/70 00:00      
               right            01/01/70 00:00      
                  Ah yes...            01/01/70 00:00      
         workaround?            01/01/70 00:00      
      Hands            01/01/70 00:00      
   *ALL* Compilers!            01/01/70 00:00      
   Re:Which Compiler            01/01/70 00:00      
      sure, but why - and it is risky            01/01/70 00:00      
         SFR            01/01/70 00:00      
            agreed            01/01/70 00:00      
   a plethora of derivatives            01/01/70 00:00      
      more on Keil asm            01/01/70 00:00      
         Keil - NOMOD51            01/01/70 00:00      
   define it            01/01/70 00:00      

Back to Subject List