CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

MAX134 driver

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
cool121



Joined: 16 Mar 2011
Posts: 10
Location: US

View user's profile Send private message

MAX134 driver
PostPosted: Wed Mar 16, 2011 1:00 pm     Reply with quote

can anybody give me a driver file to work with Maxim MAX134 DMM ic?
cool121



Joined: 16 Mar 2011
Posts: 10
Location: US

View user's profile Send private message

PostPosted: Wed Mar 16, 2011 10:27 pm     Reply with quote

No one there to help me Rolling Eyes Rolling Eyes
ALPL



Joined: 29 Mar 2009
Posts: 30

View user's profile Send private message

PostPosted: Thu Mar 17, 2011 7:44 am     Reply with quote

Hi, seems like you have to write your own code Crying or Very sad . Also the internet does not reveal anything. From my experience with MAXIM-products I advise to be very careful with the timing in the communication functions. It can be very nasty ...

If there is no MUST for you to use this rather old IC I suggest to use the PICs internal AD-module and maybe a MAX7219 or MAX7221 to drive the LCD. You will find a lot of code-examples for this combination.
Ttelmah



Joined: 11 Mar 2010
Posts: 19504

View user's profile Send private message

PostPosted: Thu Mar 17, 2011 8:22 am     Reply with quote

The big advantage it has is the internal support for ranging. The sequence looks pretty basic. Something like:
Code:

#define ALE PIN_A0 //to suit
#define READ PIN_A1 //again to suit your hardware
#define WRITE PIN_A2
#define CS PIN_A3
//Using A4 to A7 for data/address
#use fast_io(A)
#define RDTRIS 0b11110000
#define WRTRIS 0b00000000

void init(void) {
    set_tris_a(RDTRIS);
    output_high(CS);
    output_high(READ);
    output_high(WRITE);
    output_low(ALE);
}

void write_register(int8 register,int8 val) {
    set_tris_a(WRTRIS); //set bus to output
    output_b(register<<4); //output the register address
    output_high(ALE);
    delay_us(1);
    output_low(ALE); //Latch the register address
    delay_us(1);
    output_b(val<<8); //send value
    output_low(WRITE); //select bus direction
    output_low(CS); //select chip
    delay_us(1);
    output_high(CS);
    output_high(WRITE);
}

int8 read_register(int8 register) {
    int8 local;
    set_tris_a(WRTRIS); //set bus to output
    output_b(register<<4); //output the register address
    output_high(ALE);
    delay_us(1);
    output_low(ALE); //Latch the register address
    //Now turn the bus round
    set_tris_a(RDTRIS);
    output_low(READ); //select bus direction
    output_low(CS); //select chip
    delay_cycles(1); //100nSec minimum before data is valid
    local=input_b()>>4;
    output_high(CS);
    output_high(READ);
    delay_cycles(1); //Make sure chip has released bus before going to TX
    set_tris_a(WRTRIS); //setup ready for next cycle
    return local;
}

No guarantees, these are just basic read/write register routines based on the data sheet.

Best Wishes
cool121



Joined: 16 Mar 2011
Posts: 10
Location: US

View user's profile Send private message

PostPosted: Thu Mar 17, 2011 10:00 am     Reply with quote

thank you Ttelmah
I will try this
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group