Help with 4-bit display please?

Hi all,

I'm wanting to build a temperature dependent fan controller for my brother-in-law's workshop, which will run from solar-charged batteries.

I'm using a 20M2 and with monitoring the battery voltage, and reading the DS18B20, I'm limited on particular pins that I can use, hence I thought I'd try the 4-bit method.

My questions are:


  • does it matter which Picaxe pins I use e.g. B.1, B.2, B.3, B.4, instead of starting with B.0*?
  • if so, is it the dirsB mask which makes this ok?
  • Or, is it possible to spread over ports B and C and use full 8-bit mode?

My main confusion is not being able to understand for certain how I instruct the Picaxe which pins the data are being sent out of! (I'm thinking it's the dirs command, but I'm not sure)

I could of course solve this by using multiple chips, or an I2C backpack, but I'd like to fill in the gaps in my knowledge first! I've found loads of examples of 4-bit LCD use, and plenty of mentions on this forum with helpful code. But, nothing that answers my (possibly dumb) question..!

Thanks in advance for any help,
Kindest regards,
Craig.



*I'll need B.0 for monitoring the battery voltage via a potential divider.
 

inglewoodpete

Senior Member
Hi Racer, Have a look at the universal LCD driving code that I posted here a few years ago. It allows you to use any four pins in any order to pass the data into your LCD.

It is quite modular too, allowing you to select any 6 pins for data(4), Enable(1) and Register Select(1). Of course, you need to add ground (0v) and Vsupply to make it work:).
 
Top