Shop OBEX P1 Docs P2 Docs Learn Events
Receiving serial data and sending serial data using PASM — Parallax Forums

Receiving serial data and sending serial data using PASM

SiriSiri Posts: 220
edited 2008-09-05 00:52 in Propeller 1
I am learning Propeller Assembly so far I seem to have some idea of the logic control but I have no idea how
one send and receive serial data from sensors and other peripherals.Do I need to write a serial periheral interface or can I use
a spin objects if so how.
What I like accomplish is to send serial data to an Serial LCD and also capture serial data sent to the propeller from a serial devise
to a variable to manipulate that data.

Siri

Comments

  • TimmooreTimmoore Posts: 1,031
    edited 2008-09-04 20:55
    Take a look at this object http://obex.parallax.com/objects/181/, its an example of talking to the Parallax serial LCD.
  • SiriSiri Posts: 220
    edited 2008-09-04 21:18
    Tim,
    I have used that object in SPIN programs - How do I use it in a Assembly program - How do I call the routines using assembly.

    Siri
  • TimmooreTimmoore Posts: 1,031
    edited 2008-09-04 21:23
    You can't call spin from pasm. The choices you have are
    1. Have pasm write to hub variables and have spin code that polls those variables and sends them to the serial port.
    2. Write the serial port code in pasm and embed into your other pasm code
  • Paul BakerPaul Baker Posts: 6,351
    edited 2008-09-04 21:35
    Option 1 is the easiest route, option 2 is faster.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Paul Baker
    Propeller Applications Engineer

    Parallax, Inc.
  • Cluso99Cluso99 Posts: 18,069
    edited 2008-09-04 23:58
    Have you seen the FullDuplexSerial.spin object?

    While it uses spin to load up the PASM object, you could drive it directly from your own PASM code. Alternately, copy the PASM serial section into your code.

    You can use PST (Propeller/Parallax Serial Terminal) on the PC to see what is happening (debug) - switch between PropTool and PST windows. Note Hyperterminal will reset your Prop using DTR!

    Postedit: Sorry I misread SPI as serial. Please ignore.

    Post Edited (Cluso99) : 9/5/2008 12:57:32 AM GMT
  • SiriSiri Posts: 220
    edited 2008-09-05 00:52
    Thanks for the advise - May be I will borrow the SPI code so I dont have to re- invent the wheel.

    Siri
Sign In or Register to comment.