I plan to build a MB-6582-SID + a Midibox-FM into 1 box and want to drive both on 1 4x40 LCD
Here my theory :
The LCD have 2 E-Pins…
Will this be possible to drive 2 Cores with the LCD-Ports on this LCD ? Need I some diodes to save each Core-LCDoutput from the other outgoing/incoming Signals ?
As far as i can understand the problem is that the core is sending data to the data lines all the time therefore whenever an lcd is going to read some data it ll get it from both the core = garbage
hardware wise we ll need a 8 line logical switch triggered by the core… ahahah too crazy
software wise we ll need
1 as tilted mentioned, having the cores properly linked
2 tell the core to stop sending data to lcd every second cycle and offset the second core of 1 cycle
now i am not so sure if the following is right but i think that the data is sent at 40Khz, that s the PIC s cpu clock at least; if this is the case then it won t work, you need logic ICs, but i am just guessing, anybody?
There are faster switches you know, that one isn’t etched in stone, it’s just the first one I saw, posted it to demonstrate… That’s why I left the google search in there…
Anyway it doesn’t have to switch with every byte sent to the display, only switch at the beginning of sending the bytes.
My original search was for logic BTW, but I didn’t find anything quite so suitable. Let’s see about the truth table… We have three inputs and an output… In3 is the control of which core has locked the buss, In1 is from the first core’s output, In2 is from the second core, output goes to the LCD
In3 In1 In2 Out
0 X 1 1
0 X 0 0
1 1 X 1
1 0 X 0
So what is that, logic wise? I’m at work, only posting this cause I need to restart my browser and close the tab… If someone doesn’t nut this out before I get back from work I’ll actually apply thought
Regardless, I think a switch will do the trick… And it’s bidirectional which is good for my own case (but not relevant for MTE)
Uhm… how so? That’d be about the most complex answer I could think of…
The more I think about it, the more a switch makes sense here. If you think about what the aim is, it’s just a simple matter of *switching* the LCD from one core to another…
i just wanted to point out that i was horribly wrong on my post
mm
turn on time 145 ns
turn off time 175 ns
now i am not so sure if the following is right but i think that the data is sent at 40Khz, that s the PIC s cpu clock at least; if this is the case then it won t work, you need logic ICs, but i am just guessing, anybody?
those are nano seconds while the PIC runs at 25 microseconds so no probs from that side.So that chip is ok for our purpose.
True but my point is, it doesn’t matter if it switches a little slowly, it doesn’t have to switch for every byte sent, only when you switch your CS from SID to FM mode… Worst case is that you have to throw a couple of NOP in there to make the core wait a bit for it to switch. BTW, you could make the enable lines to throw the switch, no extra pin required there.
I fooled around with the logic and it’s not particularly pretty Lots of gates and diodes required…
But still, you have to have some form of negotiation between the cores as to which one is controlling the LCD right now… I guess you could use a spare pin on each PIC, which are both connected *, and when the core wants the LCD, it checks that the pin is high, and if it is, it sets it low, before writing to the LCD. This way, if the other core wants the LCD, it will test that pin, see it low, and know that the LCD is busy right now.
* I’m sure that if they were directly connected there would be a risk of a short circuit, if one pin was high and the other low. Also, if they were both set as inputs (to arbitrate access to the LCD) at the same time, then they would be susceptible to noise. I’m sure a pullup resistor is the trick here but I’m not that good with analog…anyone?
And… do you think there’s enough code space and ram available for these additions?
Edit: uh oh, too late… Hope you feel better soon MTE!
Hm I dont understand how LCDs are working but Ill study this now in the next weeks…my idea was to use the 1st and 2nd line for the SID, 3rd & 4th for the FM (or vice versa), yesterday Ive had a small discussion with doc at icq about it, he means , that the LCD will get broken fast when you turn it on/off in fast intervalls…so I think itll be imppossible to drive such LCD with 2 Cores…but let me see this after a bit of studying, for now I have many time for this, with notebook in the bed ;D ;D
MTE wants to drive line 1 and 2 of the LCD with MBFM and line 3 and 4 with MBSID
S1 wants to drive the LCD either with MBSID or MBFM (or whatever he s going to use)
wow, i think that both ideas are quite attractive and if we get one going the other will be a piece of cake, i ll take care of dusting properly the cake with dirt