Shop OBEX P1 Docs P2 Docs Learn Events
Interfacing ColorPal Sensor in ASM on 8051 — Parallax Forums

Interfacing ColorPal Sensor in ASM on 8051

electronlude97electronlude97 Posts: 5
edited 2010-10-07 14:19 in Accessories
Hey, has anyone interfaced a Parallax Colorpal color sensor for the 8051 MCU in ASM. I am trying to do that and i am stuck due to the Parallax Colorpal's 1-wire serial setup. The 8051 is not made for that. And i am unsure if i need a start bit to be sent to the colorpal from the sensor to get it to sample colors and output them on the signal line.

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2010-10-04 20:19
    See this post for interfacing the ColorPAL to non-Parallax micros:

    http://forums.parallax.com/showthread.php?p=890040

    And, yes, you do need to provide both start and stop bits.

    -Phil
  • electronlude97electronlude97 Posts: 5
    edited 2010-10-05 06:30
    Thank you for your help. But i have it set up to use on the software uart. The thing is, how would i get or what command should i use to get the sensor to start sampling.
  • FranklinFranklin Posts: 4,747
    edited 2010-10-05 08:27
    You would use the same one you would use if it was connected to a stamp. The colorpal does not care what sends the command as long as it gets it. How you send that is something for those that program 8051s in assembly to answer.
  • electronlude97electronlude97 Posts: 5
    edited 2010-10-05 08:28
    For example, i have to write to register R7, which will send its data to the port to the colorpal. What do i have to write there to get the colorpal to start sampling? Hex, binary, etc.?
  • FranklinFranklin Posts: 4,747
    edited 2010-10-06 16:02
    That would be the part where you would tell us since that would be 8051 code and parallax does not use one of those.
  • electronlude97electronlude97 Posts: 5
    edited 2010-10-07 08:35
    I just need some help on how to use the colorpal in assembly as a RGB color sensor. I need the program to do a specific routine based on one of the three color detected from the colorpal.
  • FranklinFranklin Posts: 4,747
    edited 2010-10-07 13:50
    Like I said above, the people here use Parallax products and Parallax microcontrollers to do the things they want. None of the Parallax products use 8051 assembly so, if you want answers on how to program in assembly look for a forum that does that. They should be out there but this is not one of them, sorry.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2010-10-07 14:19
    For example, i have to write to register R7, which will send its data to the port to the colorpal. What do i have to write there to get the colorpal to start sampling? Hex, binary, etc.?

    It appears from the ColorPal datasheet that the examples are using the BASCI Stamp. It is sending the commands as ASCII characters to the ColorPal. So, just figure out the ASCII value for those characters and send those.

    No mater what is is going to end up in binary but I believe in most assemblers you can specify bytes as Hex, Binary, or ASCII which the assembler will translate for you....

    Robert
Sign In or Register to comment.