Ok, this is the old application:

-- JAL 2.4i  - Windctrl.jal
-- purpose                : Windmill controller with 12F675
-- author                 : Vasile Guta Ciucur
-- date                   : 03-MAY-2009
-- used: Jallib package 0.2.0 (http://code.google.com/p/jallib/)

include 12f675
-- set fuses
pragma target clock       4_000_000
pragma target OSC         INTOSC_NOCLKOUT
pragma target WDT         DISABLED
pragma target PWRTE       DISABLED
pragma target MCLR        INTERNAL
pragma target CPD         DISABLED
pragma target CP          DISABLED
pragma target BROWNOUT    DISABLED
--pragma target BG          HIGHEST_BANDGAP_VOLTAGE

-- variable declarations
var word Volt

-- ADC settings
const ADC_hardware_Nchan      = 2         -- number of selected
channels
const ADC_hardware_NVref      = 0         -- number of external
references
const ADC_hardware_Rsource    = 10_000    -- maximum source resistance
(10K)
const ADC_hardware_high_resolution = true -- true = high resolution =
10 bits
                                          -- false = low resolution =
8 bits
var volatile byte ADCON1 is adcon0

-- -- get the library, after defining the constants
include adc_hardware

-- define transmission settings
const Serial_SW_Baudrate = 4800
const Serial_SW_invert   = false

-- define the software transmit pin
var volatile bit  Serial_SW_tx_pin is GPIO_GP0

-- use following line to deactivate rx if you don't need it
var volatile bit Serial_SW_rx_pin

include Serial_Software
include format

-- registers_setup (INIT routine in assembler)
assembler
  -- ========================
  bsf _status, _rp0 -- bank 1
  -- ========================
  call  0x3ff   -- get the factory calibrated OSC value
  movwf osccal  -- for accurate timing
  -- ------------- start -------------------
  -- gp0, gp1, gp2 as output
  -- gp3, gp4 and gp5 as input
  movlw 0b_0011_1000
  movwf trisio
  -- ------------- end ---------------------
  clrf wpu      -- wpu = 0
  -- -------===-- start ---------
  -- an0(gp0), an1(gp1) and an2(gp2) set as digital
  -- an3(gp4) as analog
  movlw 0b_0011_1000
  movwf ansel
  -- ------------ end -----------
  -- ========================
  bcf _status, _rp0 -- bank 0
  -- ========================
  clrf gpio     -- init gpio
  -- -------===-- start ---------
  movlw 0b_0000_0111 -- 7 decimal,
  movwf cmcon   -- that mean comparator off
  -- ------------ end -----------
  -- we don't set adcon0 register because is
  -- set by adc_read() routine
end assembler
-- end registers_setup

-- initialize the AD converter according to the above parameters
ADC_init
-- start initializations if functions are used
Serial_SW_init

forever loop
  -- read data
  Volt   = adc_read(3) -- (GP4)
  -- see if charging/diverting is needed
  if Volt > 571 then -- 14.3V
    GPIO_GP1 = 0
  end if
  if Volt < 558 then -- 13V
    GPIO_GP1 = 1
  end if
  if Volt > 557 then -- 13V
    GPIO_GP2 = 0
  end if
  if Volt < 545 then -- ~11V
    GPIO_GP2 = 1
  end if
  -- sending to PC the digital value of battery voltage measurement
  -- for calibration purposes
  format_word_dec(serial_sw_data, Volt, 4, 0)
  -- carriage return and line feed
  serial_sw_write(13)
  serial_sw_write(10)
  --
end loop


And the result is:

jal 2.4n (compiled Jun  2 2010)
0 errors, 0 warnings
Code area: 485 of 1024 used (words)
Data area: 43 of 62 used
Software stack available: 19 bytes
Hardware stack depth 4 of 8
[Warning] (lib/adc_hardware.jal) [Line 58]  "adc_hardware is being
deprecated, you should consider using new adc.jal library"


On Jan 5, 2:34 pm, Sebastien Lelong <[email protected]>
wrote:
> Hi Vasi,
>
> Instead of providing links to images, please provide source code and
> compiler output in text format for both on your examples.
>
> TIA
> Cheers,
> Seb
>
> 2011/1/5 funlw65(Vasi) <[email protected]>
>
> > Hi guys,
>
> > I tried to recompile the application from here
>
> >https://sites.google.com/site/funlw65/electronics/windmill-controller...
> > and, because compiler reported the use of a deprecated library (the
> > old adc lib), I changed it to use the new one. The code resulted is
> > huge. See the two images for comparison.
>
> > - the old one:
>
> >http://lh6.ggpht.com/_Z3E9awpWQh4/TSRZmpSPTjI/AAAAAAAAJU0/kVp3lxYU0uc...
>
> > - the new one:
>
> >http://lh6.ggpht.com/_Z3E9awpWQh4/TSRZm64SfZI/AAAAAAAAJU4/KOgxErr9UX0...
>
> > Fortunately, the old lib is still here (and maybe, the Bert's
> > package).
>
> > Vasi
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "jallib" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected]<jallib%[email protected]>
> > .
> > For more options, visit this group at
> >http://groups.google.com/group/jallib?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to