PDA

View Full Version : Emulating a crystal



codeking
02-12-2007, 01:46 AM
I have a graphic LCD that requires a 2kHz crystal. Unfortunately, I don't have a crystal at that speed, so I set up the prop to emulate it. I have a !OUTA[18] at 4kHz. Am I doing this right, because the LCD is acting funny.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Theron Luhn

"There are two things that are infinate: Human Stupidity and the universe. I'm not sure about the latter." - Mark Twain

Harley
02-12-2007, 02:05 AM
codeking said...
I have a graphic LCD that requires a 2kHz crystal. Unfortunately, I don't have a crystal at that speed, so I set up the prop to emulate it. I have a !OUTA[18] at 4kHz. Am I doing this right, because the LCD is acting funny.


Well, does the LCD require both leads of a crystal, or do you mean that it requires a clock of 2 KHz? If so why supply it 4 KHz?

Maybe I don't understand the configuration you need.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Harley Shanko
h.a.s. designn

Dennis Ferron
02-12-2007, 04:21 AM
I imagine he's trying to toggle outa[18] four thousand times per second, which would take two toggles to make one complete cycle, making 2KHz.

There is a frequency synth object on the object exchange. I'm using that to generate my 1 MHz 6502 clock.

I would imagine direct input to the LCD crystal pins would work, but most likely the crystal spans 2 pins and one of them is an input and the other is an output, so you have to get the right one.

Phil Pilgrim (PhiPi)
02-12-2007, 04:28 AM
codeking,

2KHz is REALLY slow for a crystal or resonator. Are you sure it's not supposed to be 2MHz instead? If that's the case, you can still generate the requisite clock using the Propeller. But you'll have to utilize one of the special counter modes to do it. Spin won't be fast enough.

-Phil

bassmaster
02-12-2007, 05:02 AM
what model is the LCD, Can you post a link to the datasheet?

I have played with hundreds and never needed a crystal, and shifting data in with a clock requires may be described as a minimum speed of XXX, most (expletive)ing in is not as speed dependant as the bits falling in the right place of the clock, does it also have a latch pin?

If its shifted serial you should see a figure like this on the datasheet..

clock....
_/|_/|_/|_/|_/|_/|_/|_/|_/|_/|_
_____-___-____-__-__________
data...(Active low)