Have you substituted an LCD for your VFD? You have posted two broken links that contain timing diagrams that are essentially identical to one another and to those for all other LCDs. Why are you not using the timing diagram for your VFD? The timing diagrams for your VFD are very similar to those of LCDs in terms of the signal sequence but the times are significantly different. At least one of the parameters specified on the VFD diagram does is not show up on the LCD diagrams.
In any case your basic problem is that you still do not understand the relationship between whichever Timing Diagram you choose to follow and the code that you are attempting to use to implement that diagram. Specifically, you do not understand how the delays in the program relate to the information on the Timing diagram. This is evident by the values used in and the comments accompanying these two statements:
delay_us(41000); // Enable high for 41 ms for LCD module to run a command.
...
delay_us(100); // Delay 100us between commands sent.
Take a look at the comments (not the values) in the corresponding statement in the the 'After' code shown in Reply #14. You must compare those comments to the Timing Diagram that I used, the one for the VFD, for them to make any sense. After you do that you should be able to fix the errors that still exist and find out what is missing.
.........
Your reply #17 above shows two functions that should be identical except for one statement (well, two statements the way you have implemented things). The timing for the 'write' operation is identical for instructions (the correct name for what you are calling commands) and for data.
Quiz: Why does the timing diagram show specific levels for E and R/W while the same diagram shows simultaneous high and low levels for RS?
.........
You obviously haven't used the 'code' tags correctly. Here's how:
- Enter your text.
- Copy and paste your code in the appropriate location.
- Highlight the code portion.
- Click on the 'code' button which looks like '#'.
You also obviously didn't check your links before submitting your post. You should do this while you are previewing your post so you can correct any problems before you submit the post.
Don