MCP3208 Obejct?
Jim Fouch
Posts: 395
I was wondering if anyone has use the MCP3208 object that is in the samples?
I modified it to be used with a MCP3304 and it works great. However, I need to be able to access it's values (ADC Readings) from more than one cog. In my design I will start the MCP3304 object and have it run continuously. In my main cog I will set up an array and pass the pointer to the MCP3304. Other objects will be started that will also receive a pointer to this Array. This way the other objects will be able to see what values the MCP3304 is reading.
My only problem is I can't figure out where in the assembly of the MCP3304 code I should copy the new readings into the global array.
I have attached a copy of my current MCP3304 driver.
thanks,
Jim
I modified it to be used with a MCP3304 and it works great. However, I need to be able to access it's values (ADC Readings) from more than one cog. In my design I will start the MCP3304 object and have it run continuously. In my main cog I will set up an array and pass the pointer to the MCP3304. Other objects will be started that will also receive a pointer to this Array. This way the other objects will be able to see what values the MCP3304 is reading.
My only problem is I can't figure out where in the assembly of the MCP3304 code I should copy the new readings into the global array.
I have attached a copy of my current MCP3304 driver.
thanks,
Jim
spin
7K
Comments
Where exactly was the original 3208 object posted? I can’t find it in the exchange.
I just created the array for the readings in the Main cog, then sent the address to the MCP3304 driver and it uses that address to store it's readings in. I then also sent that same address to the other two cogs that needed to access the readings. This way they all share access to a common area of RAM. I will need to add code that will lock access to the readings while the MCP3304 driver is writing to it.
Graham
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
Jim pointed this out to me privately.
My eyes must be growing dim with old age!
Mike
What is Parallax's position with customers modifying existing examples and posting the code for other customer to use? I just ask because of the copyright notice at the top of the examples.
I'm not sure if others could use my modified version, but it would be nice to know I could post it.
Thanks,
Jim
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.