TCS230 Connectivity
scassin
Posts: 4
Hello,
·
I was looking over the documentation provided on the TCS230 website and was wondering about its connectivity for a BS2e education board using the DB expander.
Color Me Tickled Page 3 of 17 shows that S1 and S0 are not connected.· Also, output enable is hooked up to ground.
The DB-Expander Daughterboard-to-SIP Page 3 of 5 shows that S0 and S1 should be connected to A & B respectively.
·
Interestingly, the TCS230DB_demo(DB-Expander).bs2 sample code which is used to read in RGB values to be stored in the EEPROM uses S1 and S0 in the program code:
' =========================================================================
'
'·· File...... TCS230DB_demo(DB-Expander).bs2
'·· Purpose... To extract color data from the TCS230-DB via the DB-Expander
'·· Author.... Parallax, Inc.
'·· E-mail.... support@parallax.com
'·· Started... 8 November 2007
'·· Updated...
'
'·· {$STAMP BS2}
'·· {$PBASIC 2.5}
'
' =========================================================================
·
'
[noparse][[/noparse] Program Description ]
·
' This program is used to get and output color data from the TCS230-DB
' color sensor daughterboard when connected to a BS2 via the DB-Expander.
·
'
[noparse][[/noparse] I/O Definitions ]
·
' Change the "BS2" pin designators as needed.
·
' Sig········ BS2·· DB-Expander
' ---········ ---··
· S0···· PIN·· 0··· '··· A
· S1···· PIN·· 1··· '··· B
· OUT··· PIN·· 2··· '··· C
· LED··· PIN·· 3··· '··· D
· S2···· PIN·· 4··· '··· E
· S3···· PIN·· 5··· '··· F
·
'
[noparse][[/noparse] Constants ]
·
' Define count periods for each color. Adjust these for readings just under
' 255 for a white sheet of paper.
·
pRED···· CON·· 12···· 'Red reading period.
pGREEN·· CON··· 8···· 'Green reading period.
pBLUE··· CON··· 6···· 'Blue reading period.
·
'
[noparse][[/noparse] Variables ]
·
RED····· VAR·· Word·· 'Red color reading.
GREEN··· VAR·· Word·· 'Green color reading.
BLUE···· VAR·· Word·· 'Blue color reading.
·
'
[noparse][[/noparse] Initialization ]
·
· HIGH· S0··········· 'Maximum output rate.
· HIGH· S1··········· '······· "
· HIGH· LED·········· 'Turn on LED.
·
'
[noparse][[/noparse] Program Code ]
·
DO
· GOSUB· Color······· 'Get the color data, and output to DEBUG.
· DEBUG· "R", DEC3 RED
· DEBUG· " G", DEC3 GREEN
· DEBUG· " B", DEC3 BLUE
· DEBUG· CR
LOOP
·
'
[noparse][[/noparse] Subroutines ]
·
' Color: Read all three color components.
·
Color:
· LOW· S2·················· 'Address the red output.
· LOW· S3
· COUNT· OUT, pRED, RED···· 'Read the red component.
· HIGH· S3················· 'Address the blue output.
· COUNT· OUT, pBLUE, BLUE·· 'Read the blue component.
· HIGH· S2················· 'Address the green output.
· COUNT· OUT, pGREEN, GREEN 'Read the green component.
· RETURN
·
I was wondering if anyone could provide some clarification about the connectivity of TCS230 to the education board?
·
Thanks,
steve
·
I was looking over the documentation provided on the TCS230 website and was wondering about its connectivity for a BS2e education board using the DB expander.
Color Me Tickled Page 3 of 17 shows that S1 and S0 are not connected.· Also, output enable is hooked up to ground.
The DB-Expander Daughterboard-to-SIP Page 3 of 5 shows that S0 and S1 should be connected to A & B respectively.
·
Interestingly, the TCS230DB_demo(DB-Expander).bs2 sample code which is used to read in RGB values to be stored in the EEPROM uses S1 and S0 in the program code:
' =========================================================================
'
'·· File...... TCS230DB_demo(DB-Expander).bs2
'·· Purpose... To extract color data from the TCS230-DB via the DB-Expander
'·· Author.... Parallax, Inc.
'·· E-mail.... support@parallax.com
'·· Started... 8 November 2007
'·· Updated...
'
'·· {$STAMP BS2}
'·· {$PBASIC 2.5}
'
' =========================================================================
·
'
[noparse][[/noparse] Program Description ]
·
' This program is used to get and output color data from the TCS230-DB
' color sensor daughterboard when connected to a BS2 via the DB-Expander.
·
'
[noparse][[/noparse] I/O Definitions ]
·
' Change the "BS2" pin designators as needed.
·
' Sig········ BS2·· DB-Expander
' ---········ ---··
· S0···· PIN·· 0··· '··· A
· S1···· PIN·· 1··· '··· B
· OUT··· PIN·· 2··· '··· C
· LED··· PIN·· 3··· '··· D
· S2···· PIN·· 4··· '··· E
· S3···· PIN·· 5··· '··· F
·
'
[noparse][[/noparse] Constants ]
·
' Define count periods for each color. Adjust these for readings just under
' 255 for a white sheet of paper.
·
pRED···· CON·· 12···· 'Red reading period.
pGREEN·· CON··· 8···· 'Green reading period.
pBLUE··· CON··· 6···· 'Blue reading period.
·
'
[noparse][[/noparse] Variables ]
·
RED····· VAR·· Word·· 'Red color reading.
GREEN··· VAR·· Word·· 'Green color reading.
BLUE···· VAR·· Word·· 'Blue color reading.
·
'
[noparse][[/noparse] Initialization ]
·
· HIGH· S0··········· 'Maximum output rate.
· HIGH· S1··········· '······· "
· HIGH· LED·········· 'Turn on LED.
·
'
[noparse][[/noparse] Program Code ]
·
DO
· GOSUB· Color······· 'Get the color data, and output to DEBUG.
· DEBUG· "R", DEC3 RED
· DEBUG· " G", DEC3 GREEN
· DEBUG· " B", DEC3 BLUE
· DEBUG· CR
LOOP
·
'
[noparse][[/noparse] Subroutines ]
·
' Color: Read all three color components.
·
Color:
· LOW· S2·················· 'Address the red output.
· LOW· S3
· COUNT· OUT, pRED, RED···· 'Read the red component.
· HIGH· S3················· 'Address the blue output.
· COUNT· OUT, pBLUE, BLUE·· 'Read the blue component.
· HIGH· S2················· 'Address the green output.
· COUNT· OUT, pGREEN, GREEN 'Read the green component.
· RETURN
·
I was wondering if anyone could provide some clarification about the connectivity of TCS230 to the education board?
·
Thanks,
steve
Comments
Welcome to the forum! As a preliminary, there are some things you need to be aware of:
1. It's better to post using a much smaller font. That way more of your post can be read without scrolling.
2. When you post code, enclose it in
tags.
3. If you need to post a long program, attach it as a file rather than displaying it as part of the post.
Okay, on to business. The N&V article used an earlier-model TCS230 board that had some differences from the current TCS230-DB. These are:
1. There was an /OE pin that needed to be pulled low to get an output. This pin is pulled low internally on the TCS230-DB.
2. The signal to turn on the LEDs was active low. In the TCS230-DB, it's active high.
In both boards, S0 and S1 are pulled high by default, so you can leave them unconnected.
-Phil
Post Edited (Phil Pilgrim (PhiPi)) : 4/3/2009 4:22:49 PM GMT
Thanks for your suggestions about future posting. I currently have the sensor connect without S0 and S1 so I will simply carry on with its current setup. Thank you for clarify that issue for me.
Cheers,
steve