Shop OBEX P1 Docs P2 Docs Learn Events
newbie- any serial (rs232) drivers for propeller using Catalina — Parallax Forums

newbie- any serial (rs232) drivers for propeller using Catalina

ciamociamo Posts: 5
edited 2010-07-20 10:43 in Propeller 1
Hi Im new to Catalina, does anyone have any serial communication drivers for use with Catalina compiler and the demo board?

Post Edited (ciamo) : 6/29/2010 1:22:10 AM GMT

Comments

  • RossHRossH Posts: 5,519
    edited 2010-06-29 02:27
    Hi ciamo,

    I have a general purpose serial I/O package under development, but it is not ready for release yet.

    In the meantime you can use the PC HMI option - this redirects stdin and stdout to a serial port implemented on whatever is defined as SO_PIN and SI_PIN in Catalina_Common_Input.spin (pins 30 & 31 on most platforms, inlcuding the DEMO board). For example:
    catalina test_suite.c -lc -D DEMO -D PC
    



    If you need to change the baud rate (default is 115200 baud) you will have to change it in both Catalina_PC_Text.spin and Catalina_PC_Keyboard.spin - each implements one half of the full-duplex serial link.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
  • ciamociamo Posts: 5
    edited 2010-06-29 18:59
    Thanks a lot Ross, i think im getting to like c programming for propeller
  • ciamociamo Posts: 5
    edited 2010-07-16 06:41
    Can anyone advice on how i can get a second serial port, I intend on capturing data from a serial device connected to the propeller on 1 end and then send the data to the PC on the other end, so this requires 2 serial ports. Is it there a way to duplicate the first serial but have a second tx pin and second rx pin on the propeller using the Catalina_PC_Text.spin or any other option?

    Post Edited (ciamo) : 7/18/2010 4:16:32 AM GMT
  • ciamociamo Posts: 5
    edited 2010-07-20 10:02
    If I need 2 serials is it worth it to define my board as a MORPHEUS board, inorder to be able to communicate with two different serial devices?
  • RossHRossH Posts: 5,519
    edited 2010-07-20 10:43
    @ciamo,

    I don't have a general purpose serial driver ready for release yet. You will have to create a new plugin to use a second serial port. You can create one from one of the existing Parallax serial drivers (which will typically occupy one cog) - but this process would be a little complex.

    It might be better to simply duplicate the existing PC HMI plugin infrastructure. To do this you will need to copy the PC HMI plugin files (call them something different) configure them for the different pins the second port is to use, and (most importantly!) assign the whole thing a new plugin type. You will then have to modify the Catalina target to launch the new driver (copy the way the existing PC HMI is loaded and launched).

    From within your C program you can communicate with the port quite easily by using normal Catalina plugin requests (see catalina_plugin.h for details, or the various Catalina HMI library functions for examples). The only problem with this approach is that a second full duplex serial port will consume 3 cogs!

    Ross.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Catalina - a FREE C compiler for the Propeller - see Catalina
Sign In or Register to comment.