I'm working on a custom LCD controller and having some trouble figuring out the best way to get all working. My design goals are:
- Standalone controller taking input from another picaxe
- Selectable I2C or serial input from "master" picaxe
- Ability to connect up to 3 LCDs, each up to 2x40 or 4x20
- Typical abilities of an LCD controller
As for the design, I have managed to get 3 LCDs all controlled by a single picaxe using the 8 outputs. I have used standard wiring for the first LCD. Then on the second two, all is the same except I have their 'E' pins connected to outs 0 and 1. My test code was able to initialize each and send commands and data to each properly by pulsing E1, E2, or E3.
My struggles are in the rest of the project. For example, how would I enable it to accept data from I2C or serial? I know roughly how to do each, but I'm not sure about how to make it 'discover' which is connected and being used. Should this be a jumper setting and if so, how might the code look without duplicating it for each method?
My next trouble is the actual 'listening' mode. How would I have the controller listen for data, then execute, then listen again? Would I simply serrxd, check for null, then loop. Once data is seen (not null) send those bytes to LCD, then loop? If so, once data is seen and I begin to send the byte(s) to LCD, will additional data cache, be lost, or what? For example, if the 'master' sends "Hello" will the controller get "H" and begin or "Hello" then begin? If just "H" what happens to "ello"? And how does the controller know when to stop listening and begin execute?
Aside from the multi-LCD output, the remainder seems to be standard for LCD controllers so I'm guessing it's not that out of reach, though it's a larger project than I've tackled before and covers a few subjects I haven't learned fully yet. Any help would be great!
- Standalone controller taking input from another picaxe
- Selectable I2C or serial input from "master" picaxe
- Ability to connect up to 3 LCDs, each up to 2x40 or 4x20
- Typical abilities of an LCD controller
As for the design, I have managed to get 3 LCDs all controlled by a single picaxe using the 8 outputs. I have used standard wiring for the first LCD. Then on the second two, all is the same except I have their 'E' pins connected to outs 0 and 1. My test code was able to initialize each and send commands and data to each properly by pulsing E1, E2, or E3.
My struggles are in the rest of the project. For example, how would I enable it to accept data from I2C or serial? I know roughly how to do each, but I'm not sure about how to make it 'discover' which is connected and being used. Should this be a jumper setting and if so, how might the code look without duplicating it for each method?
My next trouble is the actual 'listening' mode. How would I have the controller listen for data, then execute, then listen again? Would I simply serrxd, check for null, then loop. Once data is seen (not null) send those bytes to LCD, then loop? If so, once data is seen and I begin to send the byte(s) to LCD, will additional data cache, be lost, or what? For example, if the 'master' sends "Hello" will the controller get "H" and begin or "Hello" then begin? If just "H" what happens to "ello"? And how does the controller know when to stop listening and begin execute?
Aside from the multi-LCD output, the remainder seems to be standard for LCD controllers so I'm guessing it's not that out of reach, though it's a larger project than I've tackled before and covers a few subjects I haven't learned fully yet. Any help would be great!