Shop OBEX P1 Docs P2 Docs Learn Events
Questions about PASD — Parallax Forums

Questions about PASD

MazziniMazzini Posts: 58
edited 2011-08-28 08:58 in Propeller 1
Hello again,

I'm trying to write my driver for LCD based on this guide
http://www.8051projects.net/lcd-interfacing/lcd-4-bit-programming.php
my code:
http://pastebin.com/PuyMSDXc


I'am debugging my driver by PASD
Thank to Stefan and Frank I modified my code in LcdDat
but i dont uderstand what pasd is doing, you can see the shot here

These shot describes how call LCDdat ,load 40 DEC on cmd var, copy cmd var to t2
but it doesn't work
PqgRs.jpg
9u2Ws.jpg

any suggestions ?:)
Thanks

Comments

  • kuronekokuroneko Posts: 3,623
    edited 2011-08-28 05:40
    msb                     byte
    lsb                     byte
    cmd                     res 1
    
    msb and lsb don't have a value (just a qualifier) which means they end up in the same place as cmd which will cause confusion (it certainly confuses PASD). Just change them to byte 0 or better long 0 to keep them separate.
  • kuronekokuroneko Posts: 3,623
    edited 2011-08-28 06:12
    Also note that or is cumulative, i.e. you keep or'ing stuff to the data bus (outa[10..13], or outa, t2) which means that once it reaches %1111 you're stuck there.
  • MazziniMazzini Posts: 58
    edited 2011-08-28 06:36
    kuroneko wrote: »
    msb                     byte
    lsb                     byte
    cmd                     res 1
    
    msb and lsb don't have a value (just a qualifier) which means they end up in the same place as cmd which will cause confusion (it certainly confuses PASD). Just change them to byte 0 or better long 0 to keep them separate.

    it works thanks

    [QUOTE=kuroneko;
    Also note that or is cumulative, i.e. you keep or'ing stuff to the data bus (outa[10..13], or outa, t2) which means that once it reaches %1111 you're stuck there.
    [/QUOTE]

    I'am sure you are right because your experience,
    my purpose is update the port without overwrite all bits
    OUTA ----> 101100001111 or
    t2   ----> 000011110000
              ________________
               101111111111
    
    
  • kuronekokuroneko Posts: 3,623
    edited 2011-08-28 06:45
    my purpose is update the port without overwrite all bits
    Understood. But look what happens next:
    OUTA ----> 1011[COLOR="red"]0000[/COLOR]1111 or
    t2   ----> 0000[COLOR="blue"]1111[/COLOR]0000
              ________________
               1011[COLOR="red"]1111[/COLOR]1111
    
    Unless you clear the data portion of outa the next cycle will look like this:
    OUTA ----> 1011[COLOR="red"]1111[/COLOR]1111 or
    t2   ----> 0000[COLOR="blue"]1100[/COLOR]0000
              ________________
               1011[COLOR="red"]1111[/COLOR]1111
    
    Do you see the problem here? Easiest solution is to make a hole just before you add t2 to outa. For example
    andn    outa, CLR
            or      outa, t2
            ...
    CLR     long    %1111 << 10
    
  • MazziniMazzini Posts: 58
    edited 2011-08-28 06:51
    aaaa I feel a bit silly:innocent:

    I understood ...Thanks kuroneko, thank for your time
  • StefanL38StefanL38 Posts: 2,292
    edited 2011-08-28 07:07
    Hi Kuroneko,

    if I do a andn directly with outa as destination am I right that this will result in the involved bits turn to zero and then with the or some of them turn on again?

    If so this should only be done if the logic levels of the connected device are not "taken in" immediatly f.e because there is a "data-valid" or latch-input wich must have a certain state
    to "take in" the logic levels "sended" from the prop-pins.

    In case of logic levels are taken in immediatly into the other device I would have to go the way
    - copying actual state of outa to a temporary long
    - clearing the involved bits
    - oring the new bits to the temporary long
    - writing (not "OR"ing) the new 32bit value to outa

    best regards

    Stefan
  • kuronekokuroneko Posts: 3,623
    edited 2011-08-28 07:14
    @StefanL38: Yes, obviously. But given that talking to the LCD involved an ENable signal I'd argue that you can get away with in-place modification :)
  • frank freedmanfrank freedman Posts: 1,983
    edited 2011-08-28 08:58
    Mazzini wrote: »
    it works thanks



    I'am sure you are right because your experience,
    my purpose is update the port without overwrite all bits
    OUTA ----> 101100001111 or
    t2   ----> 000011110000
              ________________
               101111111111
    
    


    That is why the use of AND or XOR are good to know. But I'm starting to think that the MUXs could become my main bit handlers.

    As to the source for code, have you checked the object exchange OBEX? There are a number of display drivers including those for common LCD panels that may be easier to alter to meet your needs. They may only require minor modifications of say pin selections etc. Easier than starting from a different device.
Sign In or Register to comment.