Shop OBEX P1 Docs P2 Docs Learn Events
Needing help with the I2C command to talk to the MAX6953 chip — Parallax Forums

Needing help with the I2C command to talk to the MAX6953 chip

Brian CarpenterBrian Carpenter Posts: 728
edited 2006-01-30 15:44 in General Discussion
I recieved some very good help form jonathan.· He sent me this information to talk to the Max chip form (i believe) a pic.

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

Note that line 5 is the one that displays the word "INIT" using the internal font. Lines 1 -3 init the display.

Hope this helps. If you have any other questions, mail directly to jpeakall@madlabs.info, I will respond faster that way.

So i wrote mine like this.


Start: 
' Max6953 I2C Initialization 
I2CStart SDA 'Set Intensity 
I2CSend SDA, TopSlaveID 'Addresses the top Max Chip 
I2CSend SDA, $01 
I2CSend SDA, [noparse][[/noparse]$FF,$FF] 
I2CStop SDA 
I2CStart SDA 'Show all 4 characters 
I2CSend SDA, TopSlaveID 
I2CSend SDA, $03 
I2CSend SDA, $01 
I2CStop SDA 
I2CStart SDA 'Config Byte 
I2CSend SDA, TopSlaveID 
I2CSend SDA, $04 
I2CSend SDA, %00001001 
I2CStop SDA 
I2CStart SDA 'Clear Screen 
I2CSend SDA, $60 
I2CSend SDA, [noparse][[/noparse]" "," "," "," "] 
I2CStop SDA


I cant get past the
I2CSend SDA, [noparse][[/noparse]$FF,$FF] 

in the debug window.· Is i because i need to do a seperate entry for each item.· ie..

'
Max6953 I2C Initialization 
I2CStart SDA 'Set Intensity 
I2CSend SDA, TopSlaveID 'Addresses the top Max Chip 
I2CSend SDA, $01 
I2CSend SDA, $FF 
I2CSend SDA, $FF 
I2CStop SDA 

Will that make it work and does it mean the same thing as the samlpe pic code sent to me?

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


It's Only A Stupid Question If You Have Not Googled It First!!

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-01-30 15:44
    One of the things you want to keep in mind is that I2C commands actually expand out to several instructions so you may want to wrap them into subroutine shells -- this will also give you the ability to add features to the commands.· I've attached a program that wraps the I2C instructions like this; it should help you convert your program.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.