MCP3004 Program
Here is some test code I dreamed up for the MCP3004.· Can some one take a look at it, especially the shiftin/shiftout statements, and see if it is correct?
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
bse
![](/plugins/FileUpload/images/file.png)
1K
Comments
You've left off the start bit (has to be a "1") from the beginning of your command: ch0 should be %11100. And I believe this should be shifted left by two, rather than four. Also, you're sending ten clocks with the command, which is fine, but I think seven would suffice. The best bet is to try it with a known input and see if the right data comes out.
-Phil
CH0· CON· %1100
SHIFTOUT Do, clk, MSBFIRST,·[noparse][[/noparse]%00000001\2]
or
SHIFTOUT Do, clk, MSBFIRST, [noparse][[/noparse]1\2]
and
SHIFTOUT Do, clk, MSBFIRST, [noparse][[/noparse]%1100_0000_0000_0000\16]
or
SHIFTOUT·Do, clk, MSBFIRST, [noparse][[/noparse]CH0<<12\16]
Or am I reading something wrong?
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
You don't have to break it into bytes. Just send the exact number of clocks necessary to get the command in and the data out.
-Phil
SHIFTOUT Do, clk, MSBFIRST, [noparse][[/noparse]CH0<<4\8]
SHIFTOUT Do, clk, MSBFIRST, [noparse][[/noparse]0\8]
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
Plugged my MCP3004 module into the Proto Board and it is working perfectly.· Had a little problem adjusting the raw·count to display the true temperature.· The */ operator is not available in Spin but I was able to get within about .3 of a degree using raw count*32/27.· Now I can log the temperature with a date/time stamp into the upper half of my EEPROM.
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Good going! I got the board you sent me. Many thanks! Your mill does really clean work, and the board looks nice. Can you post a photo of the finished module?
-Phil
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com