Shop OBEX P1 Docs P2 Docs Learn Events
I2C VP for the sx28? — Parallax Forums

I2C VP for the sx28?

Brian CarpenterBrian Carpenter Posts: 728
edited 2006-01-18 15:34 in General Discussion
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!!

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-13 15:55
    You do not need any VPs running to make SX/B instructions work -- in fact, some instructions may be adversely affected by VP code. The syntax example you give is for the BS2p, not the SX using SX/B, that's where you need to make adjustments. The help file shows how to communicate with a small EEPROM, start with that.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2006-01-16 14:14
    where is this help file located

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-16 14:34
    It gets installed with the IDE. Select "SX/B Help" from the SK-Key IDE's Help menu.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2006-01-16 15:24
    I dont understand why i can not wrap my mind around this.· i know for a fact that i can do this with a basic stamp but my project really is screaming for something much smaller.· size is a big concern.· This will be controlling 2 MAX6953's Via the I2c· bus.· I just dont understand how to set up the chip to talk.· Once set up I DO know what to tell it.· Any suggestions.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
    LOKI.bmp 872.6K
  • BeanBean Posts: 8,129
    edited 2006-01-16 15:42
    You need to switch the SCL and SDA pins.
    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."
    ·
  • Brian CarpenterBrian Carpenter Posts: 728
    edited 2006-01-16 16:30
    i cant seem to find it in my help files. i even downloaded the latest. Any ideas?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔


    It's Only A Stupid Question If You Have Not Googled It First!!
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-16 16:49
    What version of the SX-Key IDE are you running?· If not 3.1 you can get it here:

    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
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-01-18 15:34
    LASTLY -- If you truly want an I2C VP in Assembler, Gunther's text has a whole chapter explaining it.
    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
Sign In or Register to comment.