Out B.x for an 18M2

gerrymcc

New Member
This seems such a simple problem that I feel embarrassed about asking it, but I cannot solve my problem. A few years ago, I did several projects using 28X1 chips. These projects included 2 row by 16 character displays. I wrote my own program to drive this display. Now, I want to do a project which also uses this display. I decided to update to using an 18M2. I also bought an 18-pin project board to save hand wiring my own board. I expected it to be easy to transfer the display software over to the new chip. Following advice here, I also started using PE5 instead of PE6. Initially, I tried to get the display to work, but failed. I therefore decided to make sure I could set bit patterns on the port first. This is where I have come unstuck. I find that I cannot address the B-port as an output 8-bit port.

I have printed all of Manual 2 (thanks employer!) and searched through it, and also tried searching around the Forum. I have tried several variants and ideas. I find several references to this port being input by default, and how to set it as an output. I have tried several of these, in different ways, but without success. I find that I can set single bits using "high B.1", as shown by the Simulator, and confirmed with a multimeter. I cannot get something using "%10101010" to give this output bit pattern. I find that only B.0 seems to be set. This is shown on the Simulator and confirmed with the multimeter. That I can set a single bit High tells me that pull-up resistors are not required. Seems such a basic question. Where have I failed? Can someone give me any ideas? Thank you
 

gerrymcc

New Member
Thank you both for replying so quickly. Appreciated. I had not included the "dirsB = %11111111" at the top of my efforts. Doh!!! I am sure that will solve this difficulty. Thanks for the comment regarding the darlington output. In fact, I have made up an 18 pin DIL plug using perf board and 2x 9 pin single row header pins, and soldering the ribbon directly from the display to this DIL plug. Plugs into the L293 socket. Should work well.

Since you have kindly included a reference to using the HD44780 module, let me record here the reference I originally used to work out how to program this display chip. "Everyday Practical Electronics", Part 1 (February 1997) and Part 2 (March 1997). I found this article via a Google search. I found these articles particularly useful, since they start by describing using the module with a protoboard and a few switches (and debounce circuit) to easily set up the module. Shows how old and initially well thought out these modules are, if they are still being used and designed in, 17 years later.
 
Top