Pin11 issue with MCP3208
MD2010
Posts: 11
I am working with the MCP3208 A/D. I designed my own board placing two 3208 on it. One is working fine and the other one is not. I assembled two boards and I noticed the same problem on both boards. There is no short on the board. I was able to duplicate this issue with the Proto board as well. For some strange reason I cant communicate with the 3208 if I use pin11. I am able to control pin11 using the Blink program so there is nothing wrong with that pin. Is there any limitation using pin11? Communication with the 3208 is fine using other pins.
Comments
What driver are you using?
VAR
byte menu
long stack[60]
long Vo, T1, T2
OBJ
Debug : "FullDuplexSerialPlus"
delay : "timing1722"
DAC : "MCP3208_fast"
DAC1 : "MCP3208_fast"
Num : "Numbers"
SN : "Simple_Numbers"
FS : "FloatString"
FM : "FloatMath"
LCD : "LCD_16x2_4Bit_3208"
PUB LedOn | tch, tcl, V1,Vcal, Vout ' Method declaration
Debug.Start(31, 30, 1, 115200)
LCD.START
LCD.MOVE(1,1)
delay.pause1ms(100)
DAC.start(25,24,26,0) 'in/out, CLK, CS, mode
DAC1.start(12,13,11,0) 'in/out, CLK, CS, mode
delay.pause1ms(100)
LCD.CLEAR
Debug.tx(CLS)
Debug.tx(CR)
repeat
delay.pause1ms(1000)
Debug.str(String("Start"))
delay.pause1ms(10)
Debug.tx(CR)
Vo := DAC.in(1)
Vo := FM.FMul(Vo, 23.00)
Vcal := FM.FMul(Vo, 4.096)
Vout := FM.FDiv(Vcal, 4096)
Debug.str(String("Dac0 ch CH0:"))
debug.str(FS.FloatToString(Vout))
Debug.tx(CR)
delay.pause1ms(10)
Debug.tx(CR)
Vo := DAC1.in(0)
Vo := FM.FMul(Vo, 20.85)
Vcal := FM.FMul(Vo, 4.096)
Vout := FM.FDiv(Vcal, 4096)
Debug.str(String("Dac1 ch CH0:"))
debug.str(FS.FloatToString(Vout))
Debug.tx(CR)
ADC.start(25, 24, 26, %0000_0000_1111_1111)
to enable all the pins (though you should only enable the ones you need)
Though of course I've done it long-hand here, you should probably use positional notation.
A flag for me is an object called LCD_16x2_4Bit_3208. I've written a ton of LCD code, and used the MCP3208 in products that are for sale -- why you're LCD seems tied to the 3208 is a mystery and could explain funny pin interactions. That's speculation, though, because you didn't post the whole project for inspection.
I dont have any issue with DAC.start(25,24,26,0). It is working fine. I cant get DAC1.start(12,13,11,0) to work. As I mentioned before, if I change Pin11 to pin10 or any other pin, DAC1.start(12,13,10,0) works fine. Jeff-o, to get my project running Im sharing pin26. Now I have DAC.start(25,24,26,0) and DAC1.start(12,13,26,0) . This solution seems to work, but it doesnt explain why DAC1.start(12,13,11,0) doesnt work with pin11.