This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem on reading pin.

I use a LCD 1261B and I don't know why I can both read and write to the LCD in ASM but I can only write but not read from LCD(even I set bit to make the pin ready to read).Do any of you have any idea or solution to my problem?.

Parents
  • If you need to produce precise timing by counting instruction cycles, you must do it in assembler. You simply do not have that level of control in 'C' - that is the whole point of high-level languages!
    117% agreed. an addition: After I got on trouble once stealing my own code for another project I now surround all timing defines with a define of the oscillator frequency

    #ifdef CLOCK49M
    #define DELAY_1_COUNT 47
    #endif

    Erik

Reply
  • If you need to produce precise timing by counting instruction cycles, you must do it in assembler. You simply do not have that level of control in 'C' - that is the whole point of high-level languages!
    117% agreed. an addition: After I got on trouble once stealing my own code for another project I now surround all timing defines with a define of the oscillator frequency

    #ifdef CLOCK49M
    #define DELAY_1_COUNT 47
    #endif

    Erik

Children
  • #ifdef CLOCK49M
    #define DELAY_1_COUNT 47
    #endif
    [Rant]
    It would be SOOooooooooooooo useful if uVision made the Crystal Frequency value from its config dialogue available to the Compiler; eg, via a predefined macro like __XTAL__

    Similarly for other options in the Project dialogues...
    [/Rant]