Shop OBEX P1 Docs P2 Docs Learn Events
clkmode + rs232 issue — Parallax Forums

clkmode + rs232 issue

rtowlerrtowler Posts: 29
edited 2007-03-13 18:27 in Propeller 1
I have a prop attached to a max3232 in the same fashion as the prop stick. I've done this a number of times w/o issue. Today I assembled a board and while I can program the prop via the RS-232 interface, I am having issues tx/rx data from it.

I have narrowed down the issue to the clock frequency of the prop. If I run at 5 MHz * 16 (_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000) I only see the first few characters and some gibberish. If I slow the stamp down to 5*8 everything works fine.

This is on a tested pcb design. There aren't any visible problems. Components are (in theory) identical to the other 2 boards that have been built on the same design and are working w/o issue. I'm a bit stumped. Of course I chose to solder the prop onto the board instead of using a socket so I can't easily swap it. sad.gif

I actually can run these at 5*8, I don't need to run at 80MHz. But I would like to understand the issue so I can avoid (or deal with) the issue in the future.

Any thoughts?

Comments

  • parts-man73parts-man73 Posts: 830
    edited 2007-03-13 00:29
    How about the code? If the hardware is not to fault... that leaves only software.

    I had a similar issue a few months ago. I issued the serial "stop" command before the data had a chance to be transmitted. You must either not use the stop command, or make sure the serial tx buffer is empty before using it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Brian Meade

    "They who dream by day are cognizant of many things which escape those who dream only by night" - Edgar Poe
  • rtowlerrtowler Posts: 29
    edited 2007-03-13 05:34
    I don't have the code here at home but here it is (I may have the name of the extended serial object wrong). FWIW, this code works fine on the other two boards I have built.

    
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
    
    OBJ
      Serial : "ExtendedFD_Serial"
    
    PUB Start
    
      waitcnt(80_000_000 * 5 + cnt)
      Serial.start(31,30,0,9600)
    
      Repeat
        Serial.str(string("Testing 1.2.3.", 13,10))
        waitcnt(80_000_000 * 2 + cnt)
    
    
    



    When I run this, I get output like this in hyperterm:

    Test Tes~Te% Tes@
    
    



    (although the ~@% characters are random and may be any printable or non-printable chars)

    If I change _clkmode to "xtal1 + pll8x" it runs fine.
  • rtowlerrtowler Posts: 29
    edited 2007-03-13 17:34
    I should re-title this, how much I need to learn about power supply...

    I left out one detail last night, previously I had been running the boards off NiMH batts. I don't have those anymore and I just grabbed a 12v 600ma wall wart power supply from the closet and used that. For reasons unknown to me, I have this serial rx/tx problem with the AC/DC converter. I grabbed a 10v AA battery pack and powered the board with that and everything works fine. I'm using the LM1086-3.3 reg with a couple of 10uF caps (one in, one out).

    Anyways, I dug out another 12v power supply and using it, everything works.

    Sorry for the confusion.

    -Rick
  • Mike GreenMike Green Posts: 23,101
    edited 2007-03-13 17:44
    Yes, it did look like you were getting repeated resets or brown-outs for some reason. 12V is a bit high to use with a 3.3V regulator since an unregulated wall-wart will tend to run higher in voltage than it's full-load rated voltage and everything above 3.3V has to be dissipated as heat. Admittedly, the Propeller doesn't draw much by itself, even with a MAX3232 attached, but any current drawn is with a 9-10V voltage drop.
  • rtowlerrtowler Posts: 29
    edited 2007-03-13 18:27
    Mike Green said...
    12V is a bit high to use with a 3.3V regulator since an unregulated wall-wart will tend to run higher in voltage than it's full-load rated voltage and everything above 3.3V has to be dissipated as heat.

    Understood. I'm also powering an 8.4v reg for another device. 12v was as close as I could get from the pile of power supplies I have in the closet. Both regulators are heat sinked and the 1086 is just warm to the touch. When deployed this will run off batteries, this is just for testing and programming on the bench.

    -Rick
Sign In or Register to comment.