Re: [jallib] adc average

2021-11-13 Thread vsurducan
Yes indeed it was a simulation. Still very valuable as long as it replaces nasty debugging... I've solved the issue. The problem was the length of the ADC procedure. It's good to know/remember that if use only four ADC channels from 23 available (PIC18F25k50): - all registers which can be set prio

Re: [jallib] adc average

2021-11-13 Thread 'Oliver Seitz' via jallib
Am Samstag, 13. November 2021, 12:27:04 MEZ hat vsurducan Folgendes geschrieben: "Old jal (Wouter's) had a feature for testing computation at the compile time. I realized it was very useful even if using constants for testing math routines." If that is the case, it's still no part

Re: [jallib] adc average

2021-11-13 Thread vsurducan
ore > reading it and enable it again as soon as you have read the word. > > Kind regards, > > Rob > > -- > *Van:* jallib@googlegroups.com namens vsurducan > > *Verzonden:* zaterdag 13 november 2021 12:26 > *Aan:* jallib@googlegroups.com &

Re: [jallib] adc average

2021-11-13 Thread Rob CJ
@googlegroups.com Onderwerp: Re: [jallib] adc average Hi Kiste, this is the way I'm debugging right now, not on LCD but on PC via USB (that's because I'm using the USB ). Old jal (Wouter's) had a feature for testing computation at the compile time. I realized it was very useful eve

Re: [jallib] adc average

2021-11-13 Thread vsurducan
d, 0 errors > 0 skips checked, 0 errors > writing result > d:\PIC\Compiler\Test\2021\ADC_in_array\Test.jal:6: "i is not defined" > 1 errors, 0 warnings > The terminal process "c:\jallib\compiler\jalv2_64.exe > 'd:\PIC\Compiler\Test\2021\ADC_in_array\Test.jal', '-s', 'c

Re: [jallib] adc average

2021-11-13 Thread 'Oliver Seitz' via jallib
jal', '-s', 'c:\jallib\lib'" terminated with exit code: 1. So not sure why this happens but is seems to be not OK. Kind regards, Rob Van: jallib@googlegroups.com namens vsurducan Verzonden: zaterdag 13 november 2021 08:08 Aan: jallib@googlegroups.com Onderwerp: R

Re: [jallib] adc average

2021-11-13 Thread Rob CJ
jalv2_64.exe 'd:\PIC\Compiler\Test\2021\ADC_in_array\Test.jal', '-s', 'c:\jallib\lib'" terminated with exit code: 1. So not sure why this happens but is seems to be not OK. Kind regards, Rob Van: jallib@googlegroups.com namens vsurduca

Re: [jallib] adc average

2021-11-12 Thread vsurducan
>ch0_adc_value = adc_read_high_res(0) ; compute result >voltage1_a [i] = ch0_adc_value ; store sample >voltage1 = voltage1 + voltage1_a[i] ; do a sum of all samples each i > step > end loop > > > > -- > *Van:* jallib@googlegroup

Re: [jallib] adc average

2021-11-12 Thread Rob CJ
n: vrijdag 12 november 2021 07:38 Aan: jallib@googlegroups.com Onderwerp: Re: [jallib] adc average Hi Rob, If I replace the ADRESH and ADRESL content with fixed values, it looks like computation is ok, however this is not the real situation when reading ADC. How can a computing error be repo

Re: [jallib] adc average

2021-11-11 Thread vsurducan
nden:* donderdag 11 november 2021 13:47 > *Aan:* jallib@googlegroups.com > *Onderwerp:* [jallib] adc average > > Hi all ( aka Kiste and Rob&Rob ?) :) > > One possible solution to take 8 adc average values is below (and does not > work): > > const sample_nr = 8 ; bu

Re: [jallib] adc average

2021-11-11 Thread Rob CJ
. Kind regards, Rob Van: jallib@googlegroups.com namens vsurducan Verzonden: donderdag 11 november 2021 13:47 Aan: jallib@googlegroups.com Onderwerp: [jallib] adc average Hi all ( aka Kiste and Rob&Rob ?) :) One possible solution to take 8 adc average va

[jallib] adc average

2021-11-11 Thread vsurducan
Hi all ( aka Kiste and Rob&Rob ?) :) One possible solution to take 8 adc average values is below (and does not work): const sample_nr = 8 ; buffer size dimension var word voltage1_a[sample_nr] ; sample array var word one_ch_ad_read var word voltage1 = 0 ; the average value we need const word c2