I2C VP for the sx28?
Brian Carpenter
Posts: 728
Hey guys.· I have a chip that i am trying to talk to via I2C.· I found a VP on the sx list but i dont understand it.· do i need all of it inorder to make this code work?·
Init_Display:
i2cout dispSDA,dispSCL,dispDev,$01,[noparse][[/noparse]$FF,$FF] ' Set Intensity
i2cout dispSDA,dispSCL,dispDev,$03,[noparse][[/noparse]$01] ' Show all 4 chars
i2cout dispSDA,dispSCL,dispDev,$04,[noparse][[/noparse]%00001001]' Config Byte
i2cout dispSDA,dispSCL,dispDev,$60,[noparse][[/noparse]" "," "," "," "]' Clear display
i2cout dispSDA,dispSCL,dispDev,$60,[noparse][[/noparse]"INIT"]',fail
pause 1000
i2cout dispSDA,dispSCL,dispDev,$60,[noparse][[/noparse]" "," "," "," "]' Clear display
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
Init_Display:
i2cout dispSDA,dispSCL,dispDev,$01,[noparse][[/noparse]$FF,$FF] ' Set Intensity
i2cout dispSDA,dispSCL,dispDev,$03,[noparse][[/noparse]$01] ' Show all 4 chars
i2cout dispSDA,dispSCL,dispDev,$04,[noparse][[/noparse]%00001001]' Config Byte
i2cout dispSDA,dispSCL,dispDev,$60,[noparse][[/noparse]" "," "," "," "]' Clear display
i2cout dispSDA,dispSCL,dispDev,$60,[noparse][[/noparse]"INIT"]',fail
pause 1000
i2cout dispSDA,dispSCL,dispDev,$60,[noparse][[/noparse]" "," "," "," "]' Clear display
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
The SX/B I2C commands require that SCL be the next HIGHEST bit on the same port as SDA. And you specifiy the SDA pin in the I2C command.
See the I2C commands in the help file.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"SX-Video·Module" Now available from Parallax for only $28.95
http://www.parallax.com/detail.asp?product_id=30012
"SX-Video OSD module" Now available from Parallax for only·$49.95
http://www.parallax.com/detail.asp?product_id=30015
Product web site: www.sxvm.com
"Ability may get you to the top, but it takes character to keep you there."
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
It's Only A Stupid Question If You Have Not Googled It First!!
http://www.parallax.com/sx/downloads.asp
This will install the SX/B compiler and its help file.
There is also a sticky post at the top of this forum that has the latest updates -- but the sticky post hasn't been updated since the release of 3.1.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
But it is not SX/B, it is Assembler.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan