Shop OBEX P1 Docs P2 Docs Learn Events
ColorPAL hangs? — Parallax Forums

ColorPAL hangs?

mparkmpark Posts: 1,305
edited 2010-10-18 16:34 in Accessories
I have a ColorPAL and a Prop demo board. I'm running the demo from the ColorPAL object in OBEX. It starts out OK, repeatedly showing a brief multi-colored burst followed by five seconds of solid color, but after a while it just gets stuck displaying the solid color.

I have two ColorPALs and they both hang eventually. Has anyone else encountered this? Is there a fix?

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-10-06 17:44
    Michael,

    Just so we're on the same page here, can you post an archive of the program that's giving you this behavior?

    Thanks,
    -Phil
  • mparkmpark Posts: 1,305
    edited 2010-10-06 21:56
    Archive attached. It's exactly the object from the obex except I changed the pin from 8 to 0.

    I have the thing wired to the demo board's 5V, VSS, and P0. I also tried a 1k resistor instead of the direct connection from P0 to Sig, thinking maybe it needed a little level conversion (grasping at straws), but it didn't help.

    I don't know if this is important, but it seems to take a long time to hang the first time, but subsequent hangs occur much more quickly. My impression, anyway.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-10-06 22:40
    Michael,

    I've had mine running constantly for a half hour now without it hanging. The only thing I could suggest might be to try a slightly lower baud rate, say 6500. You don't need the resistor, BTW. The ColorPAL never drives the I/O line high. It just gets pulled high by the AVR's internal pullups.

    Meanwhile, I'll try to come up with a different demo program.

    -Phil
  • mparkmpark Posts: 1,305
    edited 2010-10-07 09:53
    Looks like your baud rate suggestion did the trick. At 7200 it would hang after a few seconds (I took out the 5s delay); at 6500 it keeps going and going. Thanks a bunch!
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-10-07 10:08
    I'm glad that helped but somewhat disturbed that it was necessary. 7200 baud should be a conservative rate for the ColorPAL. (It will fail at 9600 baud, though.) Just to be sure, are you using a 5 MHz crystal on your Demo Board, or have you replaced it with something higher -- say 6.25 MHz?

    -Phil
  • mparkmpark Posts: 1,305
    edited 2010-10-07 10:09
    I just noticed a bug in ColorPAL.GetBlue: it sends the same string as GetRed ("= R s !"). I changed the R to B.
  • mparkmpark Posts: 1,305
    edited 2010-10-07 10:54
    Oops, missed your post Phil. The crystal says 5.00.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-10-07 11:51
    Here are a couple Spin programs that work with the ColorPAL:
    ColorPAL_sense produces the output required by the PC color matching program available on the ColorPAL product page.
    ColorPAL_vga_demo displays the colors the ColorPAL sees on a VGA screen.

    Both are set for 7200 baud. Try them that way first; then, if they hang, you can always reduce it to 6500.

    -Phil
  • mparkmpark Posts: 1,305
    edited 2010-10-08 00:41
    Wow, thanks Phil! After using the OBEX object, I thought the ColorPAL could only sample < 10 per second—probably too slow for what I had in mind. With yours, I see it can sample much faster—almost 40/s. Also, it hasn't hung @ 7200 with your code (yet).

    (I only tried ColorPAL_sense.)

    Say, any particular reason PAL is all-caps?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-10-08 08:09
    'Glad you got it working! Be sure to try the sense program with its companion PC host, the color matching program downloadable with the BASIC Stamp stuff on the ColorPAL product page.
    mpark wrote:
    Say, any particular reason PAL is all-caps?
    It was just an arbitrary stylistic decision, not any sort of acronym.

    -Phil
  • GeorgeCollinsGeorgeCollins Posts: 132
    edited 2010-10-12 21:34
    It's funny because I found this thread looking for help with my own problem. Thank you Phil for finding the problems with this object. Thanks for finding the problem and explaining it. Thank you also mpark for finding the problem with GetBlue. I also know it has a problem with the voltage supply from an MSR1 board.

    I will fix the problems in the object, but I think Phil just has a better way of doing it.

    I'm using two ColorPALs in an autonomous combat robot at Combots V this month. Thanks to you guys it will work much better.
  • GeorgeCollinsGeorgeCollins Posts: 132
    edited 2010-10-17 21:42
    By the way, here is my robot that uses the ColorPALs, along with Ping Sensors, for autonomous combat.

    http://www.youtube.com/watch?v=00EHdSygMYU

    I am trying to make the blade stick out more. Hopefully it will do well at Combots this weekend.
  • mparkmpark Posts: 1,305
    edited 2010-10-18 16:34
    Wow, your robot really is propeller-powered!
Sign In or Register to comment.