Please help=ColorPal serial interfacing with 8051 in ASM!

Hey everyone. I am trying to use the parallax ColorPal color sensor with the serial port on the 8051 and i was wondering how i would achieve this? I need it to detect RED, GREEN, and BLUE. And i need some help on how to do this on Assembly language.

Why are you using assembly language? There’s a decent free C compiler for the 8051 called SDCC that I recommend you use C should be a lot easier for you than assembly.

After you decide what language to use, you can learn how to use your serial port by consulting the datasheet for the specific chip you are using. It should tell you what special function registers (SFRs) to write to for configuration and sending/receiving bytes on the UART. You can write to those registers equally well in a C or assembly program.

Once you learn how to use your assembler and/or compiler, and you know how to use the serial port, it should be pretty easy to interface with the ColorPal. Just consult its manual which you can find here. The manual will tell you what baud rate to use and what commands the colorpal will respond to.

–David

Sorry i’m sure C would be better but i actually forced to use ASM for my class. I just don’t understand how to set up a 1-wire serial to my 8051 chip and i don’t understand how to read the difference between red, green, and blue.