Shop OBEX P1 Docs P2 Docs Learn Events
CPU Speed Questions — Parallax Forums

CPU Speed Questions

Peter J. FischelPeter J. Fischel Posts: 28
edited 2009-02-04 17:59 in Propeller 1
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]

·

Comments

  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2009-02-03 13:35
    Peter J. Fischel said...
    So in the top of my program I put...

    CON
    _CLKMODE = XTAL1 + PLL16X
    _XINFREQ = 5_000_000

    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
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-02-03 13:40
    I am not able to comment upon the state of your present or future mental condition rolleyes.gif (love those emoticons)
    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*
  • Peter J. FischelPeter J. Fischel Posts: 28
    edited 2009-02-03 13:42
    The board I am using is the USB proto Board (Item Code 32812) which has a 5Mhz crystal.

    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.
  • LeonLeon Posts: 7,620
    edited 2009-02-03 13:46
    Which LCD display are you using?

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • Peter J. FischelPeter J. Fischel Posts: 28
    edited 2009-02-03 14:08
    the display is the Parallax 27976 2x16 display.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2009-02-03 14:50
    Info from the data sheet:


    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
  • Peter J. FischelPeter J. Fischel Posts: 28
    edited 2009-02-03 14:59
    I stand corrected, its a 27977 (the one with the backlight) and wow. I am using 6 NiMh batteries on my boe bot. I would think it could handle it but you might have a point. I can't imagine that thing runnning that much current lol. To kind of verify this, I notice the display still blanks when I switch from safe mode to servo mode (2nd position)... Guess I will just have to rely on my OLED display instead.

    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.
  • JasonDorieJasonDorie Posts: 1,930
    edited 2009-02-03 18:15
    The 3.3v signal coming out of the ports on the Prop is higher than the 2.5v 1/2 way mark that most 5v devices use. 6nimh batteries will put out enough juice for your LCD, assuming that you're not pulling too much else from the 5v reg. Is the display @ 19,200 by default? Garbage symbol output is usually a speed mid-match or a logic level inversion, both of which are easily changed.

    Jason
  • Peter J. FischelPeter J. Fischel Posts: 28
    edited 2009-02-03 21:32
    It turned out to be simply the serial object Simple_Serial was inverting my bits.

    Thanks for the help!
  • schwiegjcschwiegjc Posts: 41
    edited 2009-02-04 17:53
    Back to the clock question. If the crystal is 5Meg Hz and multiplier is set to 16, then the system clock is 80Meg Hz. Does that mean that the execution clock cycles (e.i. 5 cycles mean 5/80Meg) for assembly code is using the 80Meg Hz clock?
  • Mike GreenMike Green Posts: 23,101
    edited 2009-02-04 17:59
    All of the "system clock" cycles described in the Propeller Manual are these "execution clock cycles". For example, the cog counters are updated each system clock cycle. Most instructions take 4 system clock cycles to execute. For the usual 5MHz crystal and PLL multiplier of 16, the system clock is, as you've indicated, 80MHz which comes out to a cycle time of 12.5ns. Most instructions therefore execute in 50ns.
Sign In or Register to comment.