can anybody give me a driver file to work with Maxim MAX134 DMM ic?
cool121
Joined: 16 Mar 2011 Posts: 10 Location: US
Posted: Wed Mar 16, 2011 10:27 pm
No one there to help me
ALPL
Joined: 29 Mar 2009 Posts: 30
Posted: Thu Mar 17, 2011 7:44 am
Hi, seems like you have to write your own code . 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: 19481
Posted: Thu Mar 17, 2011 8:22 am
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 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.
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