We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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?.
I have a strange feeling of deja-vu! Have you not asked this question before? You could at least post your code that is giving trouble. Have you tried looking at the compiler listing and comparing it with the asm code?
"I can both read and write to the LCD in ASM" If it works in ASM, why not just leave it in ASM? Why waste time messing with faulty 'C', when you already have perfectly good, working ASM? Just call the ASM routine(s) from 'C'. The 'C' code that you posted last time you asked this same question was littered with _nop_() calls. This suggests that you are trying to achieve precise timing at the 'C' source level: this is a futile exercise! 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!
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