- Tue Feb 23, 2010 1:10 am
#94228
I made a test board using a PIC and an LCD screen to basically readout the values of the DS touchscreen. I set X1 and X2 to Gnd and Vdd, and Y2 floating, and Y1 as analogue input, then wait 1ms, then read through ADC, then flip it so Y1 and Y2 are Gnd and Vdd and X2 is floating and X1 is analogue input then wait 1ms and read.
I repeat this over and over and output the ADC results on the screen. The board is all SMD, with the DS connector only 2mm away from the PIC with all traces nice and tidy and short. There is a 5V Vreg for battery power and an ICSP connector to program it.
When it is powered through the ICSP by my PICKit it reads 0,0 when nothing is pressed, and then the correct values when pressed for the X and Y. However, when I remove the ICSP and power it from a 6V battery (4x AA) through the Vreg, when nothing is pressed it reads out approximately the center position reading of the screen, but when you press anywhere the readings are still correct, it is just that when on battery power and not pressed the readings are 340x370 approx (which if I touch the center of the screen that is what it reads). Any ideas why this is?
I have a 0.1uF cap right over the PIC power pins which is also right by the DS and I have tried it with and without made no difference. There is also a 0.33uF cap on the input of the reg and a 0.1uf on the output.
Its not really that big of an issue as I intend to use it powered from USB so hopefully it wouldn't have this issue, but I would like to know why this is happening as it may signify a problem with my method.
Luke
I repeat this over and over and output the ADC results on the screen. The board is all SMD, with the DS connector only 2mm away from the PIC with all traces nice and tidy and short. There is a 5V Vreg for battery power and an ICSP connector to program it.
When it is powered through the ICSP by my PICKit it reads 0,0 when nothing is pressed, and then the correct values when pressed for the X and Y. However, when I remove the ICSP and power it from a 6V battery (4x AA) through the Vreg, when nothing is pressed it reads out approximately the center position reading of the screen, but when you press anywhere the readings are still correct, it is just that when on battery power and not pressed the readings are 340x370 approx (which if I touch the center of the screen that is what it reads). Any ideas why this is?
I have a 0.1uF cap right over the PIC power pins which is also right by the DS and I have tried it with and without made no difference. There is also a 0.33uF cap on the input of the reg and a 0.1uf on the output.
Its not really that big of an issue as I intend to use it powered from USB so hopefully it wouldn't have this issue, but I would like to know why this is happening as it may signify a problem with my method.
Luke