Have you looked at the data sent from the ADC chip to the micro with either an O'scope or a Logic Analyzer to verify that the ADC chip is sending the correct data, and that, therefore, the problem is within the micro?
Is the input to the ADC filtered and noise free, (at least for your initial testing)?
It is helpful to know, with certainty, where the problem originates, before trying to track it down.
Hello friends, With past suggestions i have completed first task to get data from two SPI based 12BIT ADC, MAX189. Now, while attempting to receive uninterrupted values from the ADC's, I get a undefined jump in between the ADC value, like first ADC provide output as 3035, which remains for there with very slight change to 3039, then suddenly it jumps to a value of 1181, then come back to 3039. Throughout this process i never changed the input for ADC. I am unable to find the cause to this problem? Here is the code: [code:1:ac55cb2941]$crystal = 16000000 $hwstack = 32 $regfile = "m32def.dat" $swstack = 10 $framesize = 40 '$baud = 9600 '$sim Config Timer1 = Pwm , Pwm = 8 , Compare A Pwm = Clear Down , Compare B Pwm = Clear Down , Prescale = 1024 Config Lcdpin = Pin , Db7 = Portc.2 , Db6 = Portc.3 , Db5 = Portc.4 , Db4 = Portc.5 , E = Portc.6 , Rs = Portc.7 Config Lcd = 20 * 4 Cursor Off Noblink 'Config Adc = Single , Prescaler = Auto 'Stop Adc Ss Alias Portb.1 Ss1 Alias Portb.3 Dout Alias Pinb.2 'Dout1 Alias Pind.2 Clock Alias Portb.0 'Clock1 Alias Porta.0 Config Ss = Output Config Ss1 = Output Config Portd.6 = Output Config Portd.4 = Output Config Portd.5 = Output Config Portd.3 = Output 'Config Pind.2 = Input Config Pinb.4 = Input Config Pinb.5 = Input Config Pinb.6 = Input Config Pinb.7 = Input Dim V As Word , V1 As Word Dim Fat As Single , Fat1 As Single , Fat3 As String * 5 , Fat4 As Single Dim A As Word , B As Word , Fat5 As Single
'Set Ss1 Pwm1a = 255 Reset Ss Waitms 5 Do Loop Until Dout = 1 Shiftin Dout , Clock , V , 0 , 16 Shift V , Right , 4 'Lcd "V= " ; V Set Ss Waitms 200
Do B = 255 Pwm1b = B Pwm1a = 255 Portd.6 = 0 Cls Lcd "READY" If Pinb.6 = 0 Then B = 25 Portd.6 = 1 Waitms 200 A = 75 Pwm1a = A Wait 1 Waitms 100 A = 255 Pwm1a = A Waitms 200 Portd.6 = 0 Waitms 100 Do If Pinb.5 = 0 Then B = B + 1 If Pinb.4 = 0 Then B = B - 1 Pwm1b = B Set Ss1 Waitms 50 Reset Ss Waitms 5 Do Loop Until Dout = 1 Shiftin Dout , Clock , V , 0 , 16 Shift V , Right , 4 Set Ss Wait 1 Set Ss Waitms 50 Reset Ss1 Waitms 5 Do Loop Until Dout = 1 Shiftin Dout , Clock , V1 , 0 , 16 Shift V1 , Right , 4 Set Ss1 Waitms 100 Cls Lcd "ADC1=" ; V Lowerline Lcd "ADC2=" ; V1 Thirdline Lcd "PWMB=" ; B Waitms 200 Loop Until Pinb.7 = 0 Waitms 100 End If loop[/code:1:ac55cb2941] Kindly provide some more guidance over this topic.
[b:ac55cb2941][color=red:ac55cb2941](BASCOM-AVR version : 18.104.22.168 , Latest : 22.214.171.124 )[/b:ac55cb2941][/color:ac55cb2941]
Glad you got it working, it's a quite cheap and usable display! I compared the datasheets of the controllers, but could not find any difference in control sequences/commands. It may be possible that they are not 100% compatible, even the datasheet of the ILI controller obviously differs from the real IC...
I have problem with tt_fonts I use xmega128 and fonts Timesnewroman_10pt when I use [code:1:ef1e6cd690]Lcd_tt_text "0" , 1 , 10 , Color[/code:1:ef1e6cd690] then display show 03 , when [code:1:ef1e6cd690]Lcd_tt_text "1" , 1 , 10 , Color[/code:1:ef1e6cd690] thendisplay shows 13 when [code:1:ef1e6cd690]Lcd_tt_text "Hello" , 1 , 10 , Color[/code:1:ef1e6cd690] thendisplay shows H33333, always shows only first letter and number
Hello dear reader, so far no success in installing 2078 In a new folder I have 3 files: "bascom-avr-2078.lic" , "bscavrl.dll" (which I assume is the license dll) and "UpdateWiz.exe". Upon starting UpdateWiz.exe a small window opens "MCS Auto Update Wiz 126.96.36.199", clicking "Setup" opens "Update Wizard Setup" asking for Proxy Data (all fields empty, except Proxy Port "0" and Time Out "0"). Clicking "Next" opens "Product Selection" with "BASCOM-AVR 188.8.131.52" in the select box. Clicking "Next" creates a small window "MCS Auto" with "Bad request" and upon "OK" I'm back at an empty "Available Updates". Obviously I'm doing something wrong. Any idea? Thanks Ernst