Shop OBEX P1 Docs P2 Docs Learn Events
Prop chip newbie questions. — Parallax Forums

Prop chip newbie questions.

Mike B.Mike B. Posts: 31
edited 2010-06-19 20:23 in Propeller 1
I'm starting to see the light on the Spin language. (I'm on a dark road, heavy fog, one headlight out and trying to see a birthday candle at 1 mile.scool.gif )

First question:· Let's say I am using an object from the exchange that has 15-20 methods in it but I am only using one of the methods in my application.· At compile time does the ENTIRE object get compiled into the Prop or just the method(s) I actually use get compiled?

Second question:· I have been playing with the Parallax serial driver and have it workig for my Scott Edwards 4 X 20 LCD display. (really easy to do, I love that!).· Now I want to hook up a 4 X 4 serial keypad and display the button pressed on the LCD.· My question is this.· The driver says it must be init'ed before use.· The LCD is on pin 24 and the keypad is on 16.· Does calling the init method with the LCD pin(24) also set up the keypad pin(16) so that all I do is call charin(16,9600,N#inv,8) or do I have to do something· different to input on one pin and output on another??

Keep in mind that I have never spoken Spin so keep any replys SIMPLE for me!!· smhair.gif

Thanks, Mike B.

Comments

  • MagIO2MagIO2 Posts: 2,243
    edited 2010-06-19 15:00
    Yep, the whole object is added to your program. If you don't need some functions and you run out of RAM you can remove unneeded stuff. I think one of the third party compilers is also optimizing.
    Does the keyboard really need no input connection? You should read the specs of the keyboard. Normally·a keyboard also has an input line for switching on the num-lock and caps-lock lights.

    ** after re-read: oh keypad ... no keyboard ;o) so, maybe no input **

    2·things you can do alternatively:
    1. define 2 objects using the same serial driver. For example:
    obj
    kb: "FullDuplexSerial"
    lcd: "FullDuplexSerial"
    2. or use the serial driver that allows to have 4 serial interfaces. I think it's named FDSerial4P or something alike.

    With·FullDuplexSerial you can setup·Tx and Rx on any pin you want. But of course the·baud-rate must be the same.

    Post Edited (MagIO2) : 6/19/2010 3:14:04 PM GMT
  • Cluso99Cluso99 Posts: 18,069
    edited 2010-06-19 15:13
    2. Use the FDX (FullDuplexSerial) object. You can find the the format of the calling routine...
    PUB start(rxpin, txpin, mode, baudrate) : okay
    

    This means you would do

    start.fdx(16,24,0,9600)
    

    Of course, this presumes both devices are set to 9600 baud and there is no inversion.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Links to other interesting threads:

    · Home of the MultiBladeProps: TriBlade,·RamBlade,·SixBlade, website
    · Single Board Computer:·3 Propeller ICs·and a·TriBladeProp board (ZiCog Z80 Emulator)
    · Prop Tools under Development or Completed (Index)
    · Emulators: CPUs Z80 etc; Micros Altair etc;· Terminals·VT100 etc; (Index) ZiCog (Z80) , MoCog (6809)·
    · Prop OS: SphinxOS·, PropDos , PropCmd··· Search the Propeller forums·(uses advanced Google search)
    My cruising website is: ·www.bluemagic.biz·· MultiBlade Props: www.cluso.bluemagic.biz
  • Mike B.Mike B. Posts: 31
    edited 2010-06-19 20:23
    SUCESS!! Thanks guys for the reply. I fooled around with fullduplex serial and indeed have been able to get a keypressed to display correctly on the LCD. I have to press each key twice but I am sure I will eventually figure out why it does that and then I will use the OBJ the right way!! lol.

    Now to make a keypad entry play one of the sound files in my quadravox chip corder..

    Thanks again. Mike B.
Sign In or Register to comment.