Shop OBEX P1 Docs P2 Docs Learn Events
protocol converter — Parallax Forums

protocol converter

stefstef Posts: 173
edited 2008-07-25 09:20 in Propeller 1
Hi

This is a biginners question. I have some experiance with the sx but nothing with the propeller. I would like to build a protocol converter that is lissening to a serial connection (2400 baut) and when something arraive convert it to somthing else and send it out on a second serial line (4800 baut). The protocols for lissening and sending are known by me, so dont' botther on that. Is that doable with a propeller??
Do I need an external cristal or is the internal accurate enough?
Do I need the 32K eprom?
The final goal are stand allone pcb's that are powerd up and start to work. Without user intervention.

Is al that doable or do I need to stich at the sx. It is a challange for me and I want to learn the propeller.

Stef
·

Comments

  • LeonLeon Posts: 7,620
    edited 2008-07-24 15:29
    I built something like that once with a PIC16F88, using a hardware UART and a software UART. You don't really need a Propeller.

    Leon

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Amateur radio callsign: G1HSM
    Suzuki SV1000S motorcycle
  • ColeyColey Posts: 1,110
    edited 2008-07-24 15:36
    Hi stef,

    Leon is quite right, it's probably overkill to use a Propeller but it would be a good introduction into learning how to use one.
    There a several objects in the object exchange which will do the job for you, you just need to peice them together.

    To answer your original question, I would go for a crystal myself as the internal oscillator is ~12MHz and I wouldn't trust it myself for 100% reliability with serial comms.
    You will defiantely need the eeprom as the Propeller boots it's code from it as there is no onboard flash.

    Regards,

    Coley

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    PropGFX Forums - The home of the Hybrid Development System and PropGFX Lite
  • Mike GreenMike Green Posts: 23,101
    edited 2008-07-24 15:38
    Very doable.

    You need an external crystal. The problem with the internal oscillator is that there's a lot of variation from part to part. If you were to calibrate each Propeller individually, the internal clock would be fairly stable. It's still temperature sensitive, but, if you operate it in an office or home environment, there's not a wide range of environmental temperature. It's also supply voltage sensitive, but that's normally addressed with a voltage regulator anyway.

    You need the 32K EEPROM to hold the program during startup so you can have a system that just starts up when power is applied.
  • stefstef Posts: 173
    edited 2008-07-25 06:12
    Hi



    Thanks all for the advice. I'll give it a try.

    stef
  • Cluso99Cluso99 Posts: 18,069
    edited 2008-07-25 08:01
    Just to confirm - yes and it's easy - use the FullDuplexSerial object in the object exchange.

    Load 2 identical objects in a cog each and use a spin program to convert between the 2 in a third cog (it's the easiest way). There is help in this forum if you have any problems.

    You could do more than 2 if you wanted smile.gif

    If you have to control RTS, CTS, DSR and DTR then it's a little bit more complicated.

    Remember, this part is 3.3V. If you may need RS232 levels you will need something like a MAX3232 ? chip(s) (think this is the right part).

    This would be a great project for an intro for you. The hardest part for you will be converting the protocols.
  • stefstef Posts: 173
    edited 2008-07-25 08:22
    Hi Cluso99

    Thanks for the advice. I will give it a try.

    Actualy it is not a rs232 but an rs485. I use a SN75176 as driver but the pic is seeing that as serial communication. I already did some projects for reading and writing in the 2 protocols with an sx ship. They are working so the protocol will be no problem. Now I want to do the same but I like the challange of the propeller. Thier is a lot of diffrence. sx is 5V, propeller is 3.3 V, sx has no need off external eeprom, propeller yes.

    I don't need the rts,cts,... The first is only using rx and the second is only using the tx. as they are converted to rs485, the other devices don't look at rts, cts.

    I don't quit understand de way of working with the cog's (it is not in the sx) but your explanation seems logic. I'll give it a try.



    Stef
  • Cluso99Cluso99 Posts: 18,069
    edited 2008-07-25 09:20
    If the baud rate is the same in both tx and rx then you will only need 1 cog (a single processor) to do the serial and another to do the conversion. I am aware RS485 is only different voltage levels (think differential isn't it?).

    And to debug your code just start another cog with the FullDuplexSerial and each character you read (or write) can be placed into this as well (using pins 30 & 31) and sent to your PC over the USB using PST (Propeller Serial Terminal).
    I have built a 5 channel opto isolated NMEA receiver for one of my props. Yet to combine all into one output string - got sidetracked with another Prop project.

    Note also 2 cogs and a few resistors and a connecter will drive a VGA screen - once again, code on the object exchange (and at the same time as above).

    As you can see, I love the Prop - only had mine a few months smile.gif You will too smile.gif
Sign In or Register to comment.