chipKIT® Development Platform

Inspired by Arduino™

ChipKit Max32 and MAX1295

Created Sat, 14 Jan 2012 02:00:26 +0000 by jmp2612


jmp2612

Sat, 14 Jan 2012 02:00:26 +0000

Hi i was wondering if any of you could help me,

Im using the development board from ChipKit Max32, it has a PIC32MX795F512L, and im trying to use an ADC from Maxim model Max1295, i made a pcb board that you could mount the adc and communicate it with it, this is a picture of the complete board connected to the Max32

[attachment=0]IMG00149-20120113-1821.jpg[/attachment]

The code I’m doing for pic32 (the code is in C, the compiler is microchip MPLab). The problem is that for a month or so I have been trying to create a code that can communicate and get the data out of the MAX1295 and for some reason I can't find to do it. I haven't been able to communicate with the ADC (MAX1295). I followed the time diagram and the pic is doing what I’m asking it to do.

The function of the code is to give the ADC a command to convert a channel in this case channel 0, and then it waits for the interrupt to occur. When this happens it converts the data to ascii and starts all over again. The problem is that I never see that it enters the interrupt.

I’m also using PWM pin to do the clock and it is set around 0.8MHz.

As far as the general connections this is how im doing it.

[attachment=1]connections.PNG[/attachment]

as attachments im adding the code i explained early, im using the interrupt of the external pin 0, PWM that i found in this forum to simulate the clock, and a litle routine to convert the hex to ascii.

Thanks in advance, im from Venezuela so sorry for my english, im doing this as a part of my Thesis.


Jacob Christ

Thu, 19 Jan 2012 08:29:54 +0000

Is the interrupt firing and the PIC just not entering the ISR? Have you probed the interrupt line with a scope?

Jacob


jmp2612

Thu, 19 Jan 2012 12:46:50 +0000

The pic interrupt is working if i do it manually with a cable i create the pulse (that was the way i test it). But the problem im seeing is that the ADC isnt responding, i put the data into the ADC port and then it has to produce the interrupt with the data. That interrupt the ADC doesnt do, so what im thinking is that im not configing well the ADC or at least the times.

Thanks for your response


Jacob Christ

Thu, 19 Jan 2012 16:12:56 +0000

Yes indeed. I have used the MAX1295 so if the chip is configured incorrectly I'll be of little help. Is the chip configured over SPI? If so make sure you clock and data polarity and phase are correct. Check to see if there are any registers you can read back that would indicate you have SPI configured correctly.

Jacob


jmp2612

Thu, 19 Jan 2012 16:24:59 +0000

But the MAX1295 has a parallel conection not spi. I have attached the datasheet so you can take a look of what im saying.

The data is sent by parallel mode of 8 bits or 1 byte, you have 3 control pins (CS, WR, RD) and also the INT pin that is the one that gives you the interrupt that i have asociate it to the INT0 interrupt of the PIC32.


Jacob Christ

Fri, 20 Jan 2012 01:00:07 +0000

I personally don't have time to dig into this datasheet. All I can offer is tips, like make sure your communications with the chip is working (like being able to read back a register that would have an expected value out of power up. This will let you know if your port is connected correctly. If you can't read out a register then your probably not writing to it correctly.

Jacob