CPU Speed Questions
Peter J. Fischel
Posts: 28
On my propeller robot, my first task is I wanted to hook up my 2 line lcd display for debugging. I used the Serial object and the·lcd display object.
After trying for hours to get the display to show anything I am at a loss. I init it correctly,· Its on port 0,· I set the direction to output, the speed to 19200. Its all so simple. When I try to send a character to the display, I can tell it is trying to do something from time to time. For instance, it might blank completely out or display a "/" symbol even though I am sending it a putc("9")
I looked into the serial object and it mentions Tested on 80mhz (5 mhz crystal pll 16x). This had me confused.
So in the top of my program I put...
CON
·· _CLKMODE = XTAL1 + PLL16X
·· _XINFREQ = 5_000_000
So, somehow the processor is supposed to run at 80mhz with only a 5mhz clock?· Am I reading this wrong? How?
Has anyone had this issue?· Am I going crazy?· Anyone have advice?
Oh and just so its clear, the rx pin on the 2line LCD is connected directly to the p0 pin. And the display is the Parallax 27976 2x16 display.
Thanks for your help! [noparse]:)[/noparse]
·
After trying for hours to get the display to show anything I am at a loss. I init it correctly,· Its on port 0,· I set the direction to output, the speed to 19200. Its all so simple. When I try to send a character to the display, I can tell it is trying to do something from time to time. For instance, it might blank completely out or display a "/" symbol even though I am sending it a putc("9")
I looked into the serial object and it mentions Tested on 80mhz (5 mhz crystal pll 16x). This had me confused.
So in the top of my program I put...
CON
·· _CLKMODE = XTAL1 + PLL16X
·· _XINFREQ = 5_000_000
So, somehow the processor is supposed to run at 80mhz with only a 5mhz clock?· Am I reading this wrong? How?
Has anyone had this issue?· Am I going crazy?· Anyone have advice?
Oh and just so its clear, the rx pin on the 2line LCD is connected directly to the p0 pin. And the display is the Parallax 27976 2x16 display.
Thanks for your help! [noparse]:)[/noparse]
·
Comments
PLL16X is a multiplier
16 * 5mhz = 80 MHz
First you need to know what value Xtal(crystal) is on your board.
for example if the Xtal was 10_000_000 (10Mhz) you would adjust the multiplier to *8 , 10 Mhz * 8 = 80 MHz. You can consult the manual for other options based on the Xtal value you are using.
edited to add a ref:
Manual pages 179 + 180 + 181
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Aka: CosmicBob
Post Edited (Bob Lawrence (VE1RLL)) : 2/3/2009 1:43:27 PM GMT
Ok, getting serious...
As to advice I have just this:
Have you search the other posts for anyone who has had this issue? (Hint, it could be an "inverting" problem, logic directly into RS232 inverting receiver)
I was going to describe the PLL but I see Bob beat me to it.
*Peter*
Perhaps the 3.3v signal isn't enough to drive the display rx line?
So far it appears I am following all the "Rules" for the serial object to function. Except its not making my display show anything like my Basicstamp did.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Suzuki SV1000S motorcycle
Parallax, Inc. Serial LCD (#27976/2 27977) 09/2004
The table below lists the voltage and current requirements of the Serial LCD, with the backlight turned on
and off. Since the current draw in either case exceeds the capabilities of all of the BASIC Stamps, you
should power the Serial LCD from an external 5V power supply. Make sure the power supply has an
adequate current rating to power the Serial LCD and the BASIC Stamp.
Serial LCD State Voltage Current
Backlight off 5VDC 35mA
Backlight on (only on model 27977) 5VDC 100mA
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Aka: CosmicBob
I was afraid the problem might be the fact the tx ports on the prop would put out 3.3v versus 5v from the basicstamp.
Jason
Thanks for the help!