Shop OBEX P1 Docs P2 Docs Learn Events
SEROUT using the propeller? — Parallax Forums

SEROUT using the propeller?

Luis_PLuis_P Posts: 246
edited 2011-05-22 12:15 in Propeller 1
Sorry I'm new on the Propeller, is posible to send data out like I do on the BS2? on the stamp I use:
SEROUT 1,$4054,2,[255,85,3,2,0,0,251]
Can I do that with the propeller?

Gracias.

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-22 11:12
    Yes, although it's done differently.

    There's an object in the Object Exchange that implements many of the BS2's I/O functionality using Spin calls including most of SEROUT's functionality. Look at the examples and comments in "BS2 Functions". In your case, you're using a "pace" parameter. You would need to put a pause after sending each character. There's a pause routine in the same object that you can use.
    You'd use:
    OBJ BS2 : "BS2_Functions"
    
    In your initialization code, you'd need:
    BS2.Start(31,30)
    
    Then your SEROUT would look like this:
    BS2.SEROUT_CHAR(1,255,9600,BS2#Inv,8)
    BS2.PAUSE(2)
    BS2.SEROUT_CHAR(1, 85,9600,BS2#Inv,8)
    BS2.PAUSE(2)
    BS2.SEROUT_CHAR(1,  3,9600,BS2#Inv,8)
    BS2.PAUSE(2)
    BS2.SEROUT_CHAR(1,  2,9600,BS2#Inv,8)
    BS2.PAUSE(2)
    BS2.SEROUT_CHAR(1,  0,9600,BS2#Inv,8)
    BS2.PAUSE(2)
    BS2.SEROUT_CHAR(1,  0,9600,BS2#Inv,8)
    BS2.PAUSE(2)
    BS2.SEROUT_CHAR(1,251,9600,BS2#Inv,8)
    BS2.PAUSE(2)
    
  • Luis_PLuis_P Posts: 246
    edited 2011-05-22 11:44
    Mike: I'm very familiar with the BS2 software. In this case I will use the Propeller Tool softawre to program the propeller and I need a little help to start. I will open the softawre V1.2.7, then FILE=> New, then I just paste your code, and then WHAT??

    Gracias
  • Mike GreenMike Green Posts: 23,101
    edited 2011-05-22 12:08
    What I showed you is an example of what can be done. It's not a complete program. You asked "can I do that?" and the answer is yes

    You need to learn to program in Spin. I suggest you start with the "sticky threads" at the top of the thread list in this forum. The Propeller Education Kit Labs are a good introduction even if you have some other Propeller "board". There are other beginner's references there too. The Propeller Tool also has a copy of the Propeller Manual as part of its help files. Most of the objects in the Object Exchange have a demo program (including BS2_Functions) to help you get started. The source code for the objects themselves usually include documentation in the form of comments for each public method call.
  • Luis_PLuis_P Posts: 246
    edited 2011-05-22 12:15
    I'm reading the The Propeller Education Kit Labs thanks!
Sign In or Register to comment.