jalapi

Welcome to jalapi, the jallib API documentation

http://jallib.googlecode.com

Table of Content

adc
adc_channels
adc_clock
adc_hardware
bit_array_1
calendar
can_adapter
can_ascii
can_bicolor_leds
can_legacy
can_mcp2515
canopen
characters
checksum
co2_t6603
constants_jallib
dds_ad9833
debug
delay
ds18b20
ee_25aa02e48
eeprom_24lc02
eeprom_24lc256
fat32
fat32_small
format
glcd_5x7_font
glcd_6x8_font
glcd_8x12_font
glcd_common
glcd_font
glcd_ks0108
glcd_stm032qvt_003
glcd_touch_ad7843
humidity_sht
i2c_hardware
i2c_hw_slave
i2c_hw_slave_isr
i2c_hw_slave_msg
i2c_level1
i2c_software
ir_ranger_gp2d02
jascii
keyboard
large_array_1
large_array_2
large_array_3
large_array_4
lcd_backlight
lcd_dog_m_4
lcd_dog_m_8
lcd_dog_m_spi
lcd_dsm0822a
lcd_hd44780_4
lcd_hd44780_8
lcd_hd44780_common
lcd_hd44780_serial_sw
lcd_sterm_master
math
mcp3424
mcp9800
mp3_decoder_sta015
mp3_decoder_vs1053b
one_wire
pata_hard_disk
period_skip
pic_data_eeprom
pintools
pps
print
profiler
pwm_ccp1
pwm_ccp10
pwm_ccp2
pwm_ccp3
pwm_ccp4
pwm_ccp5
pwm_ccp6
pwm_ccp7
pwm_ccp8
pwm_ccp9
pwm_common
pwm_hardware
queue01
queue02
queue03
queue04
queue05
queue06
queue07
queue08
random
rtc_isr_tmr0
rtc_isr_tmr3
rtcc_hw
sd_card
serial_hardware
serial_hardware2
serial_hw_int_cts
serial_software
servo_rc_master
servo_rc_master_dedicated
seven_segment
slip
smbus_mlx90615
spi_common
spi_master_hw
spi_master_hw2
sram_23k256
stopwatch
temperature_sht
temperature_tc77
timer0_isr_interval
timer0_poll_interval
unittest
usart2_common
usart_common
usb_defs
usb_drv
usb_drv_cdc_class
usb_drv_core
usb_keyboard
usb_serial

adc

ADC hardware, built-in PIC ADC module

Author Stef Mientki, Copyright (c) 2002..2008, all rights reserved.
Adapted-by Sebastien Lelong.
Compiler >=2.4k

Description

library to handle ADC peripheral.
  - support both low and high resolution mode
  - support a large number of PICs, with
      - ADC pin configuration
      - channel selection
      - clock selection
  - support Vref



How to use it ? See http://justanotherlanguage.org/content/jallib/tutorials/tutorial_adc_intro


Notes

this is a heavy refactoring/rewriting of original library from Stef Mientki.
The main changes are about ADC configuration, which are essentially handled in
adc_channels.jal and adc_clock.jal.



About Vref setup:
  - when ADC_NVREF = ADC_NO_VREF : there's no Vref pin used, vref is done
                     internally, using power supply (Vdd, Vss)
  - when ADC_NVREF = ADC_VREF_POS ): there's only one Vref pin, this is Vref+
  - when ADC_NVREF = ADC_VREF_POS_NEG : two Vref pins are used, Vref+ and Vref-
  - when ADC_NVREF = ADC_VREF_NEG : there's only one Vref pin, this is Vref-






A major trigger is when using ADC libs is ADC_DYNAMIC. When declared, several parameters
become dynamic and can be changed at runtime. This includes:
   - ADC_NCHANNEL, the number of ADC channels (when they are dependent channels,
     as independent channels are always selected at runtime with set_analog_pin()
   - ADC_TEMP (careful, computation related to temperature very approximative
   - ADC_RESOLUTION (8-bits or 10-bits)
   - ADC_RSOURCE



The original library can be found:
   - Stef's: http://mientki.ruhosting.nl/pic-tools/jal/libs2/adc_hardware.jal
   - jallib issue tracker: http://code.google.com/p/jallib/issues/detail?id=7


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • adc_read_bytes(byte in adc_chan, byte out adc_hbyte, byte out adc_lbyte)

    Does an AD conversion on the selected channel
    returns the 10-bit result as 2 byte parameters
    It doesn't matter if ADC is set to low or high resolution
    

  • adc_init()

    Initializes the PIC AD-converter,
    by calling the correct routine according to the number of external references
    Settings are done according to the special ADC constants
    Sets all the analog pins to input
    Calculates aquisition time and determines if right or
    left justification is optimal
    

Private

Functions


Related samples

Here are the list of samples which use this library:

12f68312f683_pwm_adc.jal
16f72316f723_adc_independent.jal
16f7316f73_adc_dependent.jal
16f76716f767_pwm_adc.jal
16f7716f77_adc_lowres.jal
16f876a16f876a_adc.jal
16f87716f877_adc_dependent.jal
16f87716f877_adc.jal
16f877a16f877a_adc_dependent.jal
16f8816f88_adc_independent.jal
16f8816f88_adc_lowres.jal
16f8816f88_adc_highres.jal
16f88616f886_pwm_adc_res.jal
16f88616f886_pwm_adc_freq.jal
18f14k5018f14k50_adc_independent.jal
18f245018f2450_adc_dependent.jal
18f455018f4550_adc.jal
18f455018f4550_adc_dependent.jal
18f455018f4550_dynamic_adc.jal



adc_channels

ADC channel configuration.

Author Sebastien Lelong, Copyright (C) 2009, all rights reserved.
Adapted-by
Compiler 2.4n

Description

this library acts as a wrapper. When included, it'll define ways to
configure the number ADC channels. There are 3 different cases:
   1. the number of channels is specified setting/clearing PCFG bits
      => a combination of PCFG bits selects a given number of ADC channels.
         It is not possible to independently select which pins as ADC pins.
         If available (1.a), Vref+ and Vref- are part of these combinations. 
         If not (1.b), either PIC doesn't support voltage reference, or in 
         some few cases, Vref+ and Vref- are handled separately via VCGF bits.
         PCFG bits are in ADCON1, as ADCON1_PCFG
   2. the number of channels is specified clearing PCFG bits (case only found in 18F, I think)
      => pins can be configured independently (you can decide which pin will act as
         an analog pin, and define your own combination
         Vref+/Vref- are configured using VCFG bits.
         PCFG bits are in ADCON0 and ADCON1, and are numbered (eg. ADCON_PCFG5)
   3. the number of channels is set using ANS bits (18F and non-18F)
      => same as case 2., channels can be configured independently
         Vref+/Vref- are configured using VCFG bits.


Notes

this file is generated, don't modify it directly...


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private
  • _adc_vref_adref()

    Configure Voltage reference using ADREF bits
    Found in PICs: 16f722, 16f723, 16f724, 16f726, 16f727, 16lf722, 
                   16lf723, 16lf724, 16lf726, 16lf727,
    Same family, DS 41341B
    

  • _adc_vref_adpref_adnref()

    No documentation found

  • _adc_vref_vcfg()

    Configure Voltage reference using VCFG bits
    


Functions


Related samples

No sample found


adc_clock

ADC block configuration

Author Rob Hamerling , Copyright (c) 2010, all rights reserved.
Adapted-by Rob Hamerling (set ACQT bits to 0b000).
Compiler 2.4n

Description

This library provides a procedure to configure ADC clock
according to ADC constraints about Tad values and PIC's clock speed
.
Selecting the appropriate ADC clocking is critical.
Not all PICs have the same min/max values for Tad.
See the ADC-chapter in the datasheet for the actual limits.
Some PICs can go faster than 20MHz, like 18F. LF-PICs don't follow
the same rules as the F-PICS (see 18F4550 and 18LF4550 for instance).
How to obtain a general rule of thumb? For some popular PICs we find:
For 16F88, and for many other PICs: 1.6 < Tad < 6.4 (microseconds)
For 18F4550 (and other 18F PICs):   0.8 < Tad < 25  (microseconds)
.
The ADC libraries use 2 constants as minimum and maximum Tad values.
The constants should contain a value 10 times as large as these
limits expressed in microseconds.
The following values are used by the library as defaults:
.
for 18F family:     ADC_MIN_TAD = 8      (0.8 us)
                    ADC_MAX_TAD = 250    (25 us)
.
for other PICs:     ADC_MIN_TAD = 16     (1.6 us)
                    ADC_MAX_TAD = 250    (16  us)
.
When these values are not acceptable alternate values may be specified
by the user  *** before *** including the ADC library.
.
The library will select the shortest possible Tad.
A warning will be issued when it is not possible to derive a value
for Tad within the limits of ADC_TAD_MIN and ADC_TAD_MAX with the
current clock speed. In that case the internal RC oscillator of the
ADC module will be selected automatically (Frc). When this is not
desired alternate values for ADC_TAD_MIN and/or ADC_TAD_MAX must be
specified, or an alternate clock speed must be used.


Notes

- This is a rewrite of a previous version of this library.
       - The device files contain a constant ADC_ADCS_BITCOUNT to
         indicate the number of bits of the ADCS variable of 'this' PIC.
         Clock devider selection bits (ADCS) can bit*2 or bit*3 or none.
           - when bit*2: divisor is 2, 8 or 32
           - when bit*3: divisor is 2, 4, 8, 16, 32 or 64
         ADCS bits may be scattered over different registers. When this is
         the case the device file contains a pseudo-variable ADCON0_ADCS
         to hide the scattering.
         Some PICs with ADC module have no ADCS bits at all (10F220/220)!


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

No sample found


adc_hardware

ADC hardware, built-in PIC ADC module

Author Stef Mientki, Copyright (c) 2002..2008, all rights reserved.
Adapted-by Sebastien Lelong.
Compiler >=2.4g

Description

library to use the PIC's AD converter
See 16F87x datasheet (DS30292C, p112)
Number of channels, behind "--" yields only for 16F874 and 16F877
No external Vref: Nchan = 1,3,5 -- 6,8
Only external +Vref: Nchan = 2,4 -- 5,7
Both external +Vref and - Vref: Nchan = 1,2,3 -- 4,6



Analog channels can still be used as digital outputs, by setting
    pin = output



relevant IO pins
 * RA0 = AN0
 * RA1 = AN1
 * RA2 = AN2  or  -Vref
 * RA3 = AN3  or  +Vref
 * RA4 = no analog IO
 * RA5 = AN4
 * next pins only for 16F874 and 16F877
 * RE0 = AN5
 * RE1 = AN6
 * RE2 = AN7






Example PIC-AD


 (if you use JALcc, you can copy the complete example below and "uncomment" it)


 define the AD converter 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
const ADC_hardware_high_resolution = true ;true = high resolution = 10 bits
                                          ;false = low resolution = 8 bits


 get the library, after defining the constants
include adc_hardware





 initialize the AD converter according to the above parameters
ADC_init





 now take a sample 


 read high resolution, channel 0
var_word=adc_read(0)


 read low resolution, channel 0
var_byte=adc_read_low_res(0)  


Sources

I (Stef) mixed the following libraries with my own ideas
 * f877_modules.jal from Javier Martinez
 * janalog.jal from Vasile Surducan


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • adc_read_bytes(byte in adc_chan, byte out adc_hbyte, byte out adc_lbyte)

    Does an AD conversion on the selected channel
    returns the 10-bit result as 2 byte parameters
    It doesn't matter if ADC is set to low or high resolution
    

  • adc_on()

    Turns all ADC channels back on
    

  • adc_init()

    Initializes the PIC AD-converter,
    by calling the correct routine according to the number of external references
    Settings are done according to the special ADC constants
    Sets all the analog pins to input
    Calculates aquisition time and determines if right or 
    left justification is optimal
    

Private
  • _adc_read_low_res(byte in adc_chan, byte out adc_byte)

    Does an AD conversion with low resolution (8 bit) on the selected channel
    

  • _adc_init_2_vref()

    Initializes the PIC AD-converter, when both +Vref and -Vref are present
    Settings are done according to the special ADC constants
    Sets all the analog pins to input
    Calculates aquisition time and determines if right or 
    left justification is optimal
    

  • _adc_init_1_vref()

    Initializes the PIC AD-converter, when only +Vref is present
    Settings are done according to the special ADC constants
    Sets all the analog pins to input
    Calculates aquisition time and determines if right or 
    left justification is optimal
    

  • _adc_init_no_vref()

    Initializes the PIC AD-converter, when no external Vref is present
    Settings are done according to the special ADC constants
    Sets all the analog pins to input
    Calculates aquisition time and determines if right or 
    left justification is optimal
    

  • _ad_init_general()

    Internal routine, that
    calculates aquisition time
    and determines if right or left justification is optimal
    


Functions


Related samples

Here are the list of samples which use this library:

18f14k5018f14k50_usb_hid_generic.jal
18f245018f2450_usb_hid_generic.jal
18f455018f4550_usb_hid_generic.jal



bit_array_1

bit array library

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4m

Description

This library allows creation of bit arrays with
             up to 16383 entries.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions

Private

API details

Global variables/contants

Procedures

Private

Functions

Private

Related samples

Here are the list of samples which use this library:

18f45218f452_bit_array.jal
18f452518f4525_bit_array.jal
18f455018f4550_bit_array.jal
18f462018f4620_bit_array.jal
18f67j5018f67j50_bit_array.jal



calendar

Calendar, takes care of ranges for seconds, minutes, date, month, year

Author Eur van Andel, Copyright (c) 2008, all rights reserved.
Adapted-by
Compiler >=2.4h

Description

This library has only one fuction: calendar(). It assumes the following variables:
var volatile byte seconds (typically updated by an ISR)
var byte hours, minutes, date, month
var word year
It knows the leap years until 2099.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • calendar()

    should be called at least once a minute

Functions


Related samples

Here are the list of samples which use this library:

16f876a16f876a_rtc_lcd.jal
16f877a16f877a_rtc_lcd.jal
16f88616f886_rtc_lcd_20mhz.jal
16f88616f886_rtc_lcd_4mhz.jal
16f88616f886_rtc_lcd_125khz.jal
18f262018f2620_rtc_tmr3.jal



can_adapter

CAN to UART adapter library

Author William Welch Copyright (c) 2010, all rights reserved.
Adapted-by
Compiler 2.4m

Description

bridge/gateway between RS232 and CAN bus. Uses ASCII encapsulation, 
         compatible with the Socket-CAN SLCAN API, and adapters such as
         LAWICEL and VScom USB-CAN.


Sources

Socket-CAN, in particular the SLCAN API. http://developer.berlios.de/projects/socketcan/ 
         also, the LAWICEL CAN-USB and Easylink adapter manuals.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • can_check_uart_rx(volatile byte out device, byte in ch)

    this routine is used to process incoming characters from the UART.
    the data stream is line-oriented ASCII, with a CR(13) terminator.
    sometimes the data is a command, which may need a reply back out
    the UART.  But most of the time, the data is encapsulated CAN messages
    which need to be sent out the CANbus.
    
     device: uart data device, e.g. serial_hw_data
     ch:  received ASCII char from UART
    

Private

Functions


Related samples

Here are the list of samples which use this library:

18f258518f2585_can_serial_adapter.jal
18f258518f2585_canid4_serial_adapter.jal



can_ascii

ASCII encapsulation of CAN messages

Author William Welch Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler 2.4m

Description

ASCII-to-CAN and CAN-to-ASCII routines. The intent is to be compatible with
   the SLCAN API. These routines may be used, for example, to implement a RS232 to CAN adapter


Sources

Socket-CAN, in particular the SLCAN API. http://developer.berlios.de/projects/socketcan/ 
         also, the LAWICEL CAN-USB adapter.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions

Private

API details

Global variables/contants

Procedures

Functions

Private

Related samples

Here are the list of samples which use this library:

18f258518f2585_canid4_monitor.jal
18f258518f2585_can_serial_adapter.jal
18f258518f2585_canid4_serial_adapter.jal
18f258518f2585_can_serial_hw.jal
18f458518f4585_canid4_monitor.jal



can_bicolor_leds

CANbus bicolor LED library

Author William Welch and Eur van Andel Copyright (c) 2010, all rights reserved.
Adapted-by
Compiler 2.4m

Description

implements LED blinks compatible with CANopen spec.


Sources

Cia Draft Recommendation 303, Part 3, Indicator specification


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f458518f4585_canopen_blink.jal



can_legacy

Legacy internal CAN controller

Author William Welch Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler 2.4

Description


 The early 18C/F family had an internal CAN controller that was
very similar to the MCP2515.  More recent devices have an ECAN controller which 
has many enhanced features, but defaults on power-up to a 'legacy' mode.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f258518f2585_canid4_monitor.jal
18f258518f2585_canid4_serial_adapter.jal
18f258518f2585_can_serial_adapter.jal
18f258518f2585_can_monitor.jal
18f258518f2585_can_serial_hw.jal
18f458518f4585_canid4_monitor.jal



can_mcp2515

External mcp2515 CAN controller

Author William Welch Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler 2.4m

Description


 The MCP2515 is an external CAN controller with Slave SPI 
interface.  The controller has 3 transmit buffers and 2 receive buffers.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f81916f819_mcp2515_can_monitor.jal
16f81916f819_canopen_mcp2515_txhb.jal
16f81916f819_mcp2515_canid4_monitor.jal



canopen

CANopen library

Author William Welch Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler 2.4

Description


 a small CAN library compatible with CANopen


Sources

Cia DS 301 version 4.02


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f81916f819_canopen_mcp2515_txhb.jal
18f258518f2585_can_monitor.jal





checksum

Checksum

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4l

Description

This library calculates checksums for data error detection.


Sources

http://www.faqs.org/rfcs/rfc1071.html


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


co2_t6603

T6603_CO2, read values from GE/Telaire T6603 CO2 sensor.

Author Eur van Andel, eur@fiwihex.nl Copyright (c) 2008
Adapted-by Albert Faber
Compiler =2.4m

Description

this library communicates with the T6603 GE/Telaire CO2 sensor.
This sensor uses the Telaire Tsunami-Lite Commnications Protocol 
(no kidding), which is a definition with zero hits on Google. 
available functions are:
get_status() return byte
get_co2_ppm() return word           -- CO2 concentration in ppm 
get_serial_numer() return string[15]
get_elevation_m() return word       -- in meters above sea level


Sources

The brochure is here: www.gesensing.com/downloads/datasheets/920-419A_LR.pdf
Some clippings from the protocol document:


------------ START OF PROTOCOL DOCUMENT CLIPPINGS  ---------------------


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions

  • get_co2_elevation_m() return word

    returns programmed elevation above sea level in meters
    this elevation is uses to calculate CO2 concentration correctly
    

  • get_co2_ppm() return word

    returns a word with CO2 concentration in ppm
    note: if sensor is busy measuring the CO2 values, it will give garbage reply
    reply is checked for garbage and if so, *PREVIOUS* ppm value is returned
    

  • get_co2_status() return byte

    returns status byte. bit_0 = error, bit_1 = warmup, 
    bit_2 = calibration, bit_3 = idle
    


Related samples

Here are the list of samples which use this library:

16f876a16f876a_t6603.jal
16f877a16f877a_co2_t6603.jal



constants_jallib

Common include file for Jallib libraries

Author Rob Hamerling, Copyright (c) 2010, all rights reserved.
Adapted-by
Compiler 2.4n

Description

   Common include file for Jallib libraries


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


dds_ad9833

Analog Devices AD9833 DDS Chip library

Author Tijs van Roon@RedSam, Copyright (c) 2010, all rights reserved.
Adapted-by
Compiler >=2.4m

Description

  Analog Devices AD9833 Direct-Digital-Synthesis (DDS) chip library.



  The library assumes that the AD9833 chip is clocked 25Mhz (MCLK). If not, read the 
last section to know how to change the constants to your needs.
The library is probably a very good start for other Analog DDS chips as well since
all work from the same principal.



Setup:
Assure that you are using a 25 Mhz oscillator on the dds chip. Otherwise change
the constant. See below (in the source) on how to do this.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


debug

Debug via print library

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4n

Description

The debug library has all the same functions as the print library,
             but the user defines constants to turn on and off this
             library and users debug levels.


Sources

The jallib print library


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f455018f4550_debug.jal



delay

Delays procedures at any processor frequency

Author Stef Mientki, Copyright (c) 2002..2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling, Joep Suijs
Compiler >=2.4g

Description

library for delays at any processor frequency.
It's based on the JAL v2 compiler generator _usec_delay.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

10f22210f222_adc.jal
12hv61512hv615_temperature_fan.jal
16f648a16f648a_startersguide.jal
16f648a16f648a_serial_print.jal
16f648a16f648a_random.jal
16f648a16f648a_serial_format.jal
16f648a16f648a_lcd_hd44780_custom.jal
16f648a16f648a_lcd_hd44780_4_4.jal
16f648a16f648a_serial_hardware.jal
16f648a16f648a_serial_hw_int_cts.jal
16f648a16f648a_i2c_sw_l1.jal
16f648a16f648a_lcd_hd44780_4bit.jal
16f648a16f648a_ds18b20_single.jal
16f648a16f648a_sqrt.jal
16f648a16f648a_i2c_sw_l0.jal
16f648a16f648a_lcd_hd44780_4_1.jal
16f648a16f648a_backlight.jal
16f648a16f648a_lcd_dsm0822a.jal
16f67616f676_lcd_hd44780_4_4.jal
16f67616f676_lcd_hd44780_4_1.jal
16f69016f690_lcd_hd44780_4_1.jal
16f69016f690_lcd_hd44780_4_4.jal
16f72316f723_lcd_dsm0822a.jal
16f72316f723_serial_print.jal
16f72316f723_sqrt.jal
16f72316f723_adc_independent.jal
16f72316f723_random.jal
16f72316f723_i2c_sw_l0.jal
16f72316f723_serial_hw_int_cts.jal
16f72316f723_i2c_sw_l1.jal
16f72316f723_startersguide.jal
16f72316f723_serial_hardware.jal
16f72316f723_serial_format.jal
16f72616f726_lcd_hd44780_4_4.jal
16f72616f726_lcd_hd44780_4_1.jal
16f72716f727_lcd_hd44780_8_4.jal
16f72716f727_lcd_hd44780_4_1.jal
16f72716f727_lcd_hd44780_4_4.jal
16f72716f727_lcd_hd44780_8_1.jal
16f7316f73_random.jal
16f7316f73_serial_hw_int_cts.jal
16f7316f73_startersguide.jal
16f7316f73_adc_dependent.jal
16f7316f73_i2c_sw_l1.jal
16f7316f73_lcd_dsm0822a.jal
16f7316f73_i2c_sw_l0.jal
16f7316f73_serial_hardware.jal
16f7316f73_serial_print.jal
16f7316f73_sqrt.jal
16f7316f73_serial_format.jal
16f7716f77_adc_lowres.jal
16f81916f819_ee25aa02e48_lcd.jal
16f81916f819_blink_intosc.jal
16f81916f819_mcp2515_can_monitor.jal
16f81916f819_mcp2515_canid4_monitor.jal
16f81916f819_lcd_hd44780_4_1.jal
16f81916f819_canopen_mcp2515_txhb.jal
16f81916f819_lcd_hd44780_4_4.jal
16f876a16f876a_lcd_hd44780_4_1.jal
16f876a16f876a_adc.jal
16f876a16f876a_lcd_hd44780_4_4.jal
16f876a16f876a_sht.jal
16f876a16f876a_rtc_lcd.jal
16f87716f877_backlight.jal
16f87716f877_i2c_sw_l1.jal
16f87716f877_glcd_ks0108.jal
16f87716f877_period_skip.jal
16f87716f877_serial_format.jal
16f87716f877_seven_segment.jal
16f87716f877_i2c_sw_l0.jal
16f87716f877_lcd_dsm0822a.jal
16f87716f877_serial_hw_int_cts.jal
16f87716f877_adc_dependent.jal
16f87716f877_fat32_small_sd_card.jal
16f87716f877_sqrt.jal
16f87716f877_keyboard.jal
16f87716f877_serial_print.jal
16f87716f877_serial_hardware.jal
16f87716f877_adc.jal
16f87716f877_lcd_hd44780_4bit.jal
16f87716f877_startersguide.jal
16f87716f877_i2c_hw_l0.jal
16f87716f877_lcd_hd44780_custom.jal
16f87716f877_i2c_hw_l1.jal
16f87716f877_pata_hard_disk.jal
16f87716f877_sd_card.jal
16f87716f877_ds18b20_single.jal
16f87716f877_fat32_small_pata_hard_disk.jal
16f87716f877_random.jal
16f87716f877_stopwatch.jal
16f877a16f877a_random.jal
16f877a16f877a_lcd_format.jal
16f877a16f877a_seven_segment.jal
16f877a16f877a_sd_card.jal
16f877a16f877a_pata_hard_disk.jal
16f877a16f877a_stopwatch.jal
16f877a16f877a_keyboard.jal
16f877a16f877a_startersguide.jal
16f877a16f877a_lcd_dsm0822a.jal
16f877a16f877a_adc_dependent.jal
16f877a16f877a_lcd_hd44780_4bit.jal
16f877a16f877a_lcd_hd44780_4_1.jal
16f877a16f877a_i2c_hw_l1.jal
16f877a16f877a_sqrt.jal
16f877a16f877a_i2c_hw_l0.jal
16f877a16f877a_lcd_hd44780_8_1.jal
16f877a16f877a_lcd_hd44780_8_4.jal
16f877a16f877a_23k256.jal
16f877a16f877a_serial_hw_int_cts.jal
16f877a16f877a_glcd_ks0108.jal
16f877a16f877a_ds18b20_single.jal
16f877a16f877a_lcd_hd44780_custom.jal
16f877a16f877a_print_serial_numbers.jal
16f877a16f877a_i2c_sw_l1.jal
16f877a16f877a_i2c_sw_l0.jal
16f877a16f877a_serial_print.jal
16f877a16f877a_serial_hardware.jal
16f877a16f877a_backlight.jal
16f877a16f877a_fat32_small_pata_hard_disk.jal
16f877a16f877a_serial_format.jal
16f877a16f877a_rtc_lcd.jal
16f877a16f877a_serial_software.jal
16f877a16f877a_fat32_small_sd_card.jal
16f877a16f877a_lcd_hd44780_4_4.jal
16f8816f88_lcd_hd44780_4_4.jal
16f8816f88_adc_highres.jal
16f8816f88_lcd_hd44780_4_4_custom.jal
16f8816f88_delay_basic.jal
16f8816f88_random.jal
16f8816f88_ds18b20_single.jal
16f8816f88_backlight.jal
16f8816f88_lcd_hd44780_4_1.jal
16f8816f88_startersguide.jal
16f8816f88_lcd_hd44780_4bit.jal
16f8816f88_serial_format.jal
16f8816f88_adc_lowres.jal
16f8816f88_serial_hardware.jal
16f8816f88_lcd_hd44780_custom.jal
16f8816f88_sqrt.jal
16f8816f88_print_serial_numbers.jal
16f8816f88_i2c_sw_l0.jal
16f8816f88_i2c_sw_l1.jal
16f8816f88_adc_independent.jal
16f8816f88_serial_hw_int_cts.jal
16f8816f88_lcd_dsm0822a.jal
16f8816f88_serial_print.jal
16f88616f886_pwm_adc_freq.jal
16f88616f886_rtc_lcd_20mhz.jal
16f88616f886_math.jal
16f88616f886_pwm_adc_res.jal
16f88716f887_lcd_hd44780_8_1.jal
16f88716f887_lcd_hd44780_8_4.jal
16f88716f887_lcd_hd44780_4_4.jal
16f88716f887_lcd_hd44780_4_1.jal
18f123018f1230_lcd_hd44780_4_1.jal
18f14k5018f14k50_serial_hw_int_cts.jal
18f14k5018f14k50_random.jal
18f14k5018f14k50_serial_hardware.jal
18f14k5018f14k50_i2c_hw_l0.jal
18f14k5018f14k50_i2c_hw_l1.jal
18f14k5018f14k50_usb_hid_mouse.jal
18f14k5018f14k50_adc_independent.jal
18f14k5018f14k50_usb_serial.jal
18f14k5018f14k50_lcd_dsm0822a.jal
18f14k5018f14k50_sqrt.jal
18f14k5018f14k50_i2c_sw_l1.jal
18f14k5018f14k50_usb_hid_keyboard.jal
18f14k5018f14k50_i2c_sw_l0.jal
18f14k5018f14k50_serial_format.jal
18f14k5018f14k50_startersguide.jal
18f14k5018f14k50_usb_hid_generic.jal
18f14k5018f14k50_serial_print.jal
18f232018f2320_lcd_hd44780_4_4.jal
18f232018f2320_lcd_hd44780_4_1.jal
18f245018f2450_lcd_hd44780_custom.jal
18f245018f2450_usb_hid_mouse.jal
18f245018f2450_usb_serial.jal
18f245018f2450_sqrt.jal
18f245018f2450_usb_hid_keyboard.jal
18f245018f2450_adc_dependent.jal
18f245018f2450_startersguide.jal
18f245018f2450_serial_hw_int_cts.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_serial_print.jal
18f245018f2450_serial_hardware.jal
18f245018f2450_random.jal
18f245018f2450_ds18b20_single.jal
18f245018f2450_serial_format.jal
18f245018f2450_lcd_hd44780_4bit.jal
18f245018f2450_i2c_sw_l1.jal
18f245018f2450_i2c_sw_l0.jal
18f245018f2450_lcd_dsm0822a.jal
18f258518f2585_can_monitor.jal
18f258518f2585_canid4_monitor.jal
18f258518f2585_can_serial_hw.jal
18f258518f2585_canid4_serial_adapter.jal
18f258518f2585_can_serial_adapter.jal
18f25k2218f25k22_eusart2.jal
18f262018f2620_rtc_tmr3.jal
18f27j5318f27j53_rtcc_hw_alarm.jal
18f45218f452_fat32_small_pata_hard_disk.jal
18f45218f452_pata_hard_disk.jal
18f45218f452_23k256.jal
18f45218f452_fat32_small_sd_card.jal
18f45218f452_sd_card.jal
18f45218f452_stopwatch.jal
18f452518f4525_fat32_sd_card.jal
18f452518f4525_sd_card.jal
18f452518f4525_mp3_decoder_vs1053b_pata_hard_disk.jal
18f452518f4525_fat32_small_pata_hard_disk.jal
18f452518f4525_pata_hard_disk.jal
18f452518f4525_fat32_pata_hard_disk.jal
18f452518f4525_stopwatch.jal
18f452518f4525_mp3_decoder_vs1053b_sd_card.jal
18f452518f4525_fat32_small_sd_card.jal
18f455018f4550_stopwatch.jal
18f455018f4550_lcd_dsm0822a.jal
18f455018f4550_lcd_hd44780_4bit.jal
18f455018f4550_i2c_sw_l0.jal
18f455018f4550_i2c_hw_l1.jal
18f455018f4550_i2c_hw_l0.jal
18f455018f4550_sd_card.jal
18f455018f4550_ir2serial.jal
18f455018f4550_i2c_sw_l1.jal
18f455018f4550_startersguide.jal
18f455018f4550_usb_hid_keyboard.jal
18f455018f4550_serial_hw_int_cts.jal
18f455018f4550_adc_dependent.jal
18f455018f4550_dynamic_adc.jal
18f455018f4550_adc.jal
18f455018f4550_serial_format.jal
18f455018f4550_sqrt.jal
18f455018f4550_serial_software.jal
18f455018f4550_pintools.jal
18f455018f4550_usb_hid_generic.jal
18f455018f4550_lcd_hd44780_custom.jal
18f455018f4550_glcd_ks0108.jal
18f455018f4550_usb_hid_mouse.jal
18f455018f4550_ds18b20_single.jal
18f455018f4550_serial_print.jal
18f455018f4550_fat32_sd_card.jal
18f455018f4550_fat32_small_sd_card.jal
18f455018f4550_seven_segment.jal
18f455018f4550_serial_hardware.jal
18f455018f4550_23k256.jal
18f455018f4550_random.jal
18f455018f4550_usb_serial.jal
18f458518f4585_canid4_monitor.jal
18f462018f4620_mp3_decoder_vs1053b_sd_card.jal
18f462018f4620_glcd_touch_stm032qvt_003.jal
18f462018f4620_fat32_sd_card.jal
18f462018f4620_fat32_small_pata_hard_disk.jal
18f462018f4620_fat32_pata_hard_disk.jal
18f462018f4620_stopwatch.jal
18f462018f4620_pata_hard_disk.jal
18f462018f4620_sd_card.jal
18f462018f4620_fat32_small_sd_card.jal
18f462018f4620_mp3_decoder_vs1053b_pata_hard_disk.jal
18f468518f4685_lcd_hd44780_8_4.jal
18f468518f4685_lcd_hd44780_8_1.jal
18f468518f4685_lcd_hd44780_4_4.jal
18f468518f4685_lcd_hd44780_4_1.jal
18f631018f6310_lcd_hd44780_8_4.jal
18f631018f6310_lcd_hd44780_8_8.jal
18f631018f6310_lcd_hd44780_4_1.jal
18f631018f6310_lcd_hd44780_4_4.jal
18f631018f6310_serial_hw_int_cts.jal
18f631018f6310_lcd_hd44780_8_1.jal
18f652018f6520_serial_hw_int_cts.jal
18f67j5018f67j50_sd_card.jal
18f67j5018f67j50_fat32_sd_card.jal
18f67j5018f67j50_mp3_decoder_vs1053b_sd_card.jal
18f67j5018f67j50_fat32_small_sd_card.jal
18f67j5018f67j50_fat32_small_pata_hard_disk.jal
18f67j5018f67j50_pata_hard_disk.jal
18f67j5018f67j50_mp3_decoder_vs1053b_pata_hard_disk.jal
18f67j5018f67j50_23k256.jal
18f67j5018f67j50_fat32_pata_hard_disk.jal
18f67j5018f67j50_stopwatch.jal



ds18b20

1 wire library for DS18b20

Author Jean Marchaudon, Copyright (c) 2010..2010, all rights reserved.
Adapted-by And-Tech.pl, Bert van Dam, Jean Marchaudon, Olivier Seit,
Compiler >=2.4m

Description

1 wire routines for the DS18b20 temperature probe
   Read sensor temperature DS18b20 from a specific device using the
   drive's ID


        
use _s_ procedures when there is only one device on the bus.   
use _m_ procedures when there is more than one device on the bus. 


Sources

ds18b20 datasheet (http://datasheets.maxim-ic.com/en/ds/DS18B20.pdf)


Notes

requires 1_wire.jal


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions

Private

API details

Global variables/contants

Procedures

  • ds18b20_m_convert(byte in id[])

    ds18b20_m_convert - start conversion of a specific devices on the bus.
    
    Parameter: 8-byte ID of device to operate on
    
    

  • ds18b20_convert()

    ds18b20_convert - start conversion of all devices on the bus.
    
    This is actually like an _s_ procedure. When it is executed on a bus with 
    multiple ds18b20 devices, all will start conversion.
    
    

  • ds18b20_setup(sbyte in th, sbyte in tl, byte in resolution)

    ds18b20_setup -- !!! UNTESTED !!! 
    
    
    ***** YOU DON'T NEED THIS FUNCTION FOR TEMPERATURE *****
    *****   READING WITH 12 BIT (DEFAULT) RESOLUTION   *****
                                                
    *** PLEASE REPORT IF YOU TESTED THIS FUNCTION (PARTLY OR FULL) ***
    resolution can be 9, 10, 11, 12
    TL = minimum -55
    TH = maximum 124
    
    

Private
  • _ds18b20_skip_rom()

    _ds18b20_skip_rom - activate all devices on the bus
    
    Note: not sure if 'all devices' means all ds18b20 devices or all one_wire
    devices. I guess this is beyond the scope of this library though ;)
    
    

  • _ds18b20_match_rom(byte in id[])

    _ds18b20_match_rom - activate specified device
    
    Parameter: 8-byte ID of device to operate on
    
    


Functions

  • ds18b20_m_temp(byte in id[], sword out temperature) return bit

    ds18b20_m_temp - read temperature from single device on bus
    
    Only use this procedure when there is only one device on the one_wire bus.
    behavior of this procedure (retry, converions) is influenced by 
    constants, see lib header.
    
    return:  true if success (crc okay).
    
    

  • ds18b20_s_read_rom() return bit

    ds18b20_s_read_rom - read ID from single device on bus
    
    Only use this procedure when there is only one device on the one_wire bus.
    result is 8-byte ID in the scratchpad area 
    return:  true if success (crc okay).
    
    

  • ds18b20_s_temp(sword out temperature) return bit

    ds18b20_s_temp - read temperature from single device on bus
    
    Only use this procedure when there is only one device on the one_wire bus.
    behavior of this procedure (retry, converions) is influenced by 
    constants, see lib header.
    
    return:  true if success (crc okay).
    
    

Private
  • _ds18b20_read( byte in nbre_byte ) return bit

    _ds18b20_read - read the requested number of bytes 
    
    The result is stored in scratchpad for further processiong.
    crc of received data is calculated. 
    
    parameter: nbre_byte:   8 when you read rom ID
                            9 when you read the scratchpad
    
    return:  true if success (crc okay).
    
    



Related samples

Here are the list of samples which use this library:

16f648a16f648a_ds18b20_single.jal
16f87716f877_ds18b20_single.jal
16f877a16f877a_ds18b20_single.jal
16f8816f88_ds18b20_single.jal
18f245018f2450_ds18b20_single.jal
18f455018f4550_ds18b20_single.jal



ee_25aa02e48

External SPI bus 2K EEPROM with EUI-48 Node Identity

Author William Welch Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler 2.4

Description


 The 25AA02E48 is pre-programmed with a unique EUI-48 address but also
                allows for user-generated non-volatile storage. 


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f81916f819_ee25aa02e48_lcd.jal



eeprom_24lc02

24LC02 i2c eeprom library

Author Matthew Schinkel, copyright (c) 2010, all rights reserved.
Adapted-by William Welch
Compiler >=2.4m

Description

read and write to 24lc02 i2c eeprom


Sources

http://groups.google.com/group/jallib


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


eeprom_24lc256

24LC256 i2c eeprom library

Author Matthew Schinkel, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4m

Description

read and write to 24lc256 i2c eeprom


Sources

http://groups.google.com/group/jallib


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f87716f877_24lc256.jal
16f877a16f877a_24lc256.jal
18f45218f452_24lc256.jal
18f452518f4525_24lc256.jal
18f455018f4550_24lc256.jal
18f462018f4620_24lc256.jal



fat32

FAT32 library for reading fat32 filesystem (beta version)

Author Matthew Schinkel, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4k

Description

this library reads files & folders from a fat32 formatted media
             such as sd cards & hard disks. BETA VERSION!


Sources

http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx
http://www.pjrc.com/tech/8051/ide/fat32.html
http://en.wikipedia.org/wiki/File_Allocation_Table
http://en.wikipedia.org/wiki/8.3_filename
http://www.ntfs.com/fat-filenames.htm


Notes

This lib does not create file_name's on fat32 partitions, although it may
in the future. Please see this article http://www.desktoplinux.com/news/NS4980952387.html?kc=rss
before you think about implementing writing of file_names into your project.


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

18f452518f4525_mp3_decoder_vs1053b_pata_hard_disk.jal
18f452518f4525_fat32_sd_card.jal
18f452518f4525_mp3_decoder_vs1053b_sd_card.jal
18f452518f4525_fat32_pata_hard_disk.jal
18f455018f4550_fat32_sd_card.jal
18f462018f4620_mp3_decoder_vs1053b_pata_hard_disk.jal
18f462018f4620_mp3_decoder_vs1053b_sd_card.jal
18f462018f4620_fat32_sd_card.jal
18f462018f4620_fat32_pata_hard_disk.jal
18f67j5018f67j50_mp3_decoder_vs1053b_sd_card.jal
18f67j5018f67j50_fat32_pata_hard_disk.jal
18f67j5018f67j50_fat32_sd_card.jal
18f67j5018f67j50_mp3_decoder_vs1053b_pata_hard_disk.jal



fat32_small

FAT32-small sample for reading fat32 filesystem

Author Matthew Schinkel, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4k

Description

This library reads files & folders from a fat32 formatted
             sd card. This small version only supports the first partition,
             and only one file.


Sources

http://www.microsoft.com/whdc/system/platform/firmware/fatgen.mspx
http://www.pjrc.com/tech/8051/ide/fat32.html
http://en.wikipedia.org/wiki/File_Allocation_Table


Notes

1. First format your device with fat32 before using this library.
2. Do not put other files onto the storage device. This library will
   overwrite and erase existing files on the storage device because
   only one file is supported, and no fragments are supported.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f87716f877_fat32_small_sd_card.jal
16f87716f877_fat32_small_pata_hard_disk.jal
16f877a16f877a_fat32_small_sd_card.jal
16f877a16f877a_fat32_small_pata_hard_disk.jal
18f45218f452_fat32_small_sd_card.jal
18f45218f452_fat32_small_pata_hard_disk.jal
18f452518f4525_fat32_small_sd_card.jal
18f452518f4525_fat32_small_pata_hard_disk.jal
18f455018f4550_fat32_small_sd_card.jal
18f462018f4620_fat32_small_pata_hard_disk.jal
18f462018f4620_fat32_small_sd_card.jal
18f67j5018f67j50_fat32_small_pata_hard_disk.jal
18f67j5018f67j50_fat32_small_sd_card.jal



format

Writes formatted values to output device

Author Stef Mientki, Copyright (c) 2002 .. 2006, all rights reserved.
Adapted-by Joep Suijs, Albert Faber, Eur van Andel
Compiler >=2.2

Description

Outputs variables to output device.
Writes formatted signed/unsiged bytes/words to the specified output device.
Decimal (with fraction), Hex and Time formats available.


  
Example:


     
var sword BHL = -684


     
; send the signed word to the LCD display
; total field width 6 chars, including sign and decimal
; with 2 digits behind the decimal point
format_sword_dec(LCD_char,BHL,6,2)


     
; and now send the same signed word to the serial port
format_sword_dec(Serial_HW_data,BHL,6,2)  


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_serial_print.jal
16f648a16f648a_ds18b20_single.jal
16f648a16f648a_serial_format.jal
16f72316f723_serial_print.jal
16f72316f723_serial_format.jal
16f7316f73_serial_print.jal
16f7316f73_serial_format.jal
16f81916f819_mcp2515_can_monitor.jal
16f81916f819_ee25aa02e48_lcd.jal
16f81916f819_mcp2515_canid4_monitor.jal
16f876a16f876a_sht.jal
16f876a16f876a_rtc_lcd.jal
16f876a16f876a_tc77.jal
16f87716f877_serial_format.jal
16f87716f877_ds18b20_single.jal
16f87716f877_serial_print.jal
16f877a16f877a_lcd_format.jal
16f877a16f877a_rtc_lcd.jal
16f877a16f877a_serial_software.jal
16f877a16f877a_ds18b20_single.jal
16f877a16f877a_serial_print.jal
16f877a16f877a_serial_format.jal
16f877a16f877a_print_serial_numbers.jal
16f8816f88_print_serial_numbers.jal
16f8816f88_ds18b20_single.jal
16f8816f88_serial_print.jal
16f8816f88_serial_format.jal
16f88616f886_rtc_lcd_4mhz.jal
16f88616f886_pwm_adc_freq.jal
16f88616f886_rtc_lcd_20mhz.jal
16f88616f886_rtc_lcd_125khz.jal
16f88616f886_pwm_adc_res.jal
18f14k5018f14k50_serial_print.jal
18f14k5018f14k50_serial_format.jal
18f245018f2450_serial_format.jal
18f245018f2450_ds18b20_single.jal
18f245018f2450_serial_print.jal
18f258518f2585_canid4_serial_adapter.jal
18f258518f2585_can_monitor.jal
18f258518f2585_can_serial_hw.jal
18f258518f2585_can_serial_adapter.jal
18f258518f2585_canid4_monitor.jal
18f25j1018f25j10_test_mlx90615.jal
18f262018f2620_rtc_tmr3.jal
18f455018f4550_serial_format.jal
18f455018f4550_serial_software.jal
18f455018f4550_ds18b20_single.jal
18f455018f4550_serial_print.jal
18f458518f4585_canid4_monitor.jal
18f462018f4620_glcd_touch_stm032qvt_003.jal



glcd_5x7_font

5X7 font lookup table for GLCD with pcd8544 controller used in Nokia 3310

Author Andre Miller Copyright (c) 2008..2010, all rights reserved.
Adapted-by Richard Zengerink
Compiler >=2.4m

Description

library 5X7 font lookup table for Nokia 3310 display with pcd8544 controller


Sources

http://www.amontec.com/lcd_nokia_3310.shtml


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f462018f4620_glcd_touch_stm032qvt_003.jal



glcd_6x8_font

6X8 font lookup table for GLCD with pcd8544 controller used in Nokia 3310

Author Richard Zengerink Copyright (c) 2008..2010, all rights reserved.
Adapted-by
Compiler >=2.4m

Description

library 6X8 font lookup table for Nokia 3310 display with pcd8544 controller


Sources

http://www.amontec.com/lcd_nokia_3310.shtml


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f462018f4620_glcd_touch_stm032qvt_003.jal



glcd_8x12_font

8X12 font tables

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4k

Description

This sample can contain any 8X12 size font tables.


Sources

http://www.divshare.com/download/11463401-4a9


Notes

See lib glcd_font.jal for font explanation


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f462018f4620_glcd_touch_stm032qvt_003.jal



glcd_common

glcd_common - generic routines for graphic lcd

Author Stef Mientki, Serkan Ayyýldýz Copyright (c) 2006..2009, all rights reserved.
Adapted-by Joep Suijs, Matthew Schinkel
Compiler >=2.2

Description

Generic routines for graphic lcd
glcd_box
glcd_line



Defines a common API, a common interface, where several parameters and procedures remains
device specific and should be implemented in device library. Once interface is implemented,
many features come for "free". This common API is defined in glcd_common.jal and glcd_font.jal



In order to honor this common interface, and benefit its features, the following must be implemented
in device specific library:
  * GLCD_X_PIXELS: (const) specifies display's width, in pixels
  * GLCD_Y_SIZE: (const) specifies display's height, in pixels
  * GLCD_COLOR_BITS: (const) specifies the number of bits required
    for colors (1 for black & white), (16 for 16 bit color)
  * glcd_pen_color: (var|const) specifies color of the pen
  * glcd_background_color: (var|const) specifies the background color
  * glcd_write_char(x,y,char): (proc) draw "char" at position (x,y). If no
    glcd_write_char is defined in the device specific library, pixel by
    pixel method will be used by default for glcd_font.jal.
  * glcd_write_pixel(x,y): (proc) assuming pen and background color previously set, draw
    a pixel at position (x,y) using defined colors. This is the main procedure used by pixel-related
    features, like drawing a line, circle, etc... In some cases, where glcd_write_char() can't be used
    glcd_write_pixel() can also be used to draw chars. If not implemented, pixel-related features won't
    be available.


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f87716f877_glcd_ks0108.jal
16f877a16f877a_glcd_ks0108.jal
18f455018f4550_glcd_ks0108.jal
18f462018f4620_glcd_touch_stm032qvt_003.jal



glcd_font

FONT library for use with GLCD's

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4k

Description

Main font library.
API: include as many font library as you want, then include this one.
Define which font you want to use during programm execution, calling
glcd_font_use(font_id). Font lookup (retrieving a char) is done using
glcd_font_lookup(idx)


Sources

http://www.divshare.com/download/11463401-4a9


Notes

Fonts have an ID, unique amongst all font libraries. ID goes from
0x01 to 0xFE (0x00 and 0xFF are reserved for internal usage). Fonts which
are part of jallib distribution have their ID starting from 0x01, 
increasing. There are also "slots" for user-defined libraries, starting from
0xFE, decreasing. This way all jallib IDs are consecutive, so are user-defined.
This leaves room for 253 fonts. Each font library addition involves updating
procedures glcd_font_use() and glcd_font_lookup().



Font name usually includes information about its Width x Height (eg. FONT_5X7).
A font library often declares characters, but can also declares other kind of
stuff (like sprites). 



Example: FONT_9X12_TOP_RIGHT_HORIZONTAL_MY_FONT_NAME



Your lcd will most likely only support one font bit order.



This example is 9x12 (font_top_right_horizontal)
const byte FONT_9x12_0_NONAME[] = {0x00,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x00,0x20,0x00,0x00} -- "!"


-horizontal--->
0 0 0 0 0 0 0 0 0   -- 0x00 0x00
0 0 0 0 0 0 0 0 0   -- 0x00 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 0 0 0 0 0 0 0   -- 0x00 0x00
0 0 1 0 0 0 0 0 0   -- 0x20 0x00
0 0 0 0 0 0 0 0 0   -- 0x00 0x00
0 0 0 0 0 0 0 0 0   -- 0x00 0x00



This example is FONT_9x12_7_NONAME (FONT_BOTTOM_LEFT_VERTICAL)
const byte font_table[] = {0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x2F0C 0x0000 0x0000} -- "!"



0      0      0      0      0      0      0      0      0        ^
0      0      0      0      0      0      0      0      0        |
0      0      1      0      0      0      0      0      0        L
0      0      1      0      0      0      0      0      0        A
0      0      1      0      0      0      0      0      0        C
0      0      1      0      0      0      0      0      0        I
0      0      1      0      0      0      0      0      0        T
0      0      1      0      0      0      0      0      0        R
0      0      0      0      0      0      0      0      0        E
0      0      1      0      0      0      0      0      0        V
0      0      0      0      0      0      0      0      0        |
0      0      0      0      0      0      0      0      0        |
0x0000 0x0000 0x2F0C 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f462018f4620_glcd_touch_stm032qvt_003.jal



glcd_ks0108

lcd_ks0108 - Library for KS0108 compatible LCD

Author Serkan Ayyýldýz Copyright (c) 2006..2009, all rights reserved.
Adapted-by Joep Suijs
Compiler >=2.2

Description

Library for KS0108 compatible graphic lcd with 128x64 resolution.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions

Private

API details

Global variables/contants

Procedures

Private

Functions

Private

Related samples

Here are the list of samples which use this library:

16f87716f877_glcd_ks0108.jal
16f877a16f877a_glcd_ks0108.jal
18f455018f4550_glcd_ks0108.jal



glcd_stm032qvt_003

GLCD Library for Color 320x240 stm032qvt-003 TFT display

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4k

Description

Library for Color GLCD 320x240 stm032qvt-003 TFT display.
             Internal TFT GLCD driver is HX8347-A.


Sources

http://www.divshare.com/download/11463401-4a9


Notes

This library must use fonts with horizontal bit alignment


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f462018f4620_glcd_touch_stm032qvt_003.jal



glcd_touch_ad7843

GLCD Touch Controller & A/D Library for ad7843

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4k

Description

Library for GLCD touch controller & A/D device ad7843.
             used with GLCD's such as stm032qvt-003


Sources

http://www.divshare.com/download/11463401-4a9


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f462018f4620_glcd_touch_stm032qvt_003.jal



humidity_sht

SHTxx, for Sensirion humidity and temperature sensors

Author Eur van Andel, eur@fiwihex.nl Copyright (c) 2008
Adapted-by
Compiler =2.4h

Description

The Sensirion SHT1x/SHT7x is a single chip relative humidity and
temperature multi sensor module comprising a calibrated digital output.
It comes in 5 flavors, with different accuracy and package style:
sensor   hum acc  temp acc    package
SHT10    4.5%     0.5C        SMD (LCC)
SHT11    3.0%     0.4C        SMD (LCC) 
SHT15    2.0%     0.3C        SMD (LCC) 
SHT71    3.0%     0.4C        4-pin single-in-line 
SHT75    1.8%     0.3C        4-pin single-in-line 
all consist of the same silicon: the less accurate models are sold cheaper.
My experience is mixed: I've seen some consistent +2C offset in temperature,
but good humidty measurements. The 4-pin package breaks when you touch it.
The SMD package has naked tracks underneath: you can't route under it!
If exposed to >95% RH for 10 minutes, these sensors will go beserk and need 
<60% RH for an hour to recover. You might try heating them. 
protocol is close to I2C, but not the same. Remember to pull up DATA.
0b0000_0011  starts temperature measurement
0b0000_0101  starts humidity measurement
device returns three bytes: MSB, LSB and CRC
this library doesn't perform any CRC check


Sources

http://www.sensirion.com/en/01_humidity_sensors/00_humidity_sensors.htm


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • read_raw_hum_sht(byte out MSB, byte out LSB, byte out CRC)

    read raw 12-bit humidity from SHT
    default value of resolution bit is 12 bit RH
    SHT takes 55 ms for measurement @ 12 bits
    we will wait 70 ms
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every 500ms
    

  • read_hum_word_sht(word out hum)

    read humidity from SHT, result in word precision 0.01%RH
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every 500ms
    

  • sht_get_data(byte out x)

    receive one byte from the SHT
    

  • sht_start()

    send start
          _____         ________ 
    DATA:      |_______| 
              ___     ___ 
    SCK : ___|   |___|   |______ 
    

  • sht_put_ack()

    send ACK
    

  • sht_conn_reset()

    reset SHT interface, must be followed with sht_start and command
    

  • sht_wait_ack()

    pretend to wait for ACK
    

  • sht_reset()

    reset SHT
    

  • read_centicelsius_temp_sht(sword out centicelsius)

    read Celcius temperature from SHT
    with 0.01 C resolution, result is sword type, so -327.68 .. +327.68 C
    SHT takes 320 ms for measurement @ 14 bits
    we will wait 400 ms
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every four seconds!
    

  • sht_put_data(byte in x)

    send one byte to the SHT
    

  • read_celsius_temp_sht(sbyte out celsius)

    read Celcius temperature from SHT
    with 1 C resolution, result is sbyte type, so -126...+127C
    SHT takes 320 ms for measurement @ 14 bits
    we will wait 400 ms
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every four seconds!
    

  • read_hum_sht(byte out hum)

    read humidity from SHT, result in byte precision 1%RH
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every 500ms
    

  • read_raw_temp_sht(byte out MSB, byte out LSB, byte out CRC)

    read raw 14-bit temperature from SHT
    default value of resolution bit is 14 bit temperature
    SHT takes 320 ms for measurement @ 14 bits
    we will wait 400 ms
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every two seconds!
    

Functions


Related samples

Here are the list of samples which use this library:

16f876a16f876a_sht.jal



i2c_hardware

i2c_hardware

Author Stef Mientki, Copyright (C) 2005 Stef Mientki
Adapted-by Joep Suijs, Albert Faber
Compiler >=2.4g

Description

Hardware implementation of I2C (single) master.





 Define i2c pins like:
alias i2c_scl            is pin_c3  ; optional, but good habit ;)
alias i2c_scl_direction  is pin_c3_direction
alias i2c_sda            is pin_c4  ; optional, but good habit ;)
alias i2c_sda_direction  is pin_c4_direction



const word _i2c_bus_speed = 1 ; * 100kHz
const bit _i2c_level = true   ; i2c levels (not SMB)


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • i2c_restart()

    i2c_restart - Sends Restart bit and waits untill finished
    
    

  • i2c_initialize()

    if the device has changed, change the speed if necessary
    
    

  • i2c_stop()

    i2c_stop - Sends Stop bit and waits until finished
    
    

  • i2c_start()

    i2c_start - Sends Start bit and waits untill finished
    
    

Functions

  • i2c_receive_byte(bit in ACK ) return byte

    i2c_receive_byte -
    
    start receiving of a byte and waits till finished
    if param ACK is true, the byte is acknowledged and next bytes can be received.
    if param ACK is false, the byte is nacked and a stop *should be* sent.
    note: this behavior is inverted from the line level and orignal library, but
          consistent with the i2c_software library.
    
    

  • i2c_transmit_byte(byte in data) return bit

    i2c_transmit_byte -
    
    
    


Related samples

Here are the list of samples which use this library:

16f87716f877_i2c_hw_l0.jal
16f87716f877_i2c_hw_l1.jal
16f877a16f877a_i2c_hw_l0.jal
16f877a16f877a_i2c_hw_l1.jal
18f14k5018f14k50_i2c_hw_l1.jal
18f14k5018f14k50_i2c_hw_l0.jal
18f25k2218f25k22_i2c_hw_master_echo.jal
18f455018f4550_i2c_hw_l1.jal
18f455018f4550_i2c_hw_l0.jal



i2c_hw_slave

i2c_hardware slave procedures

Author Sebastien Lelong, Copyright (c) 2008-2009, all rights reserved.
Adapted-by Joep Suijs, Albert Faber
Compiler >=2.4i

Description

Common and useful functions and procedure to implement an I2C slave


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • i2c_hw_slave_init(byte in height_bits_icaddress)

    setup an i2c slave, with low address (not high addresses coded with 10-bits)
    The passed address must be 8-bits long: it's a 7-bits address + the 8th R/W bit
    A global "i2c_enable_start_stop_interrupts" constant can be defined to so
    interrupts are generated on Start/Stop signals.
    /!\ careful: calling this procedure will enable interrupts (global, peripherals and i2c)
    

  • i2c_hw_slave_write_i2c(byte in what)

    write a byte to i2c bus
    

Functions


Related samples

Here are the list of samples which use this library:

16f72316f723_i2c_hw_slave_echo.jal
16f72316f723_i2c_hw_slave_check_bus.jal
16f7316f73_i2c_hw_slave_check_bus.jal
16f7316f73_i2c_hw_slave_echo.jal
16f87716f877_i2c_hw_slave_check_bus.jal
16f87716f877_i2c_hw_slave_echo.jal
16f877a16f877a_i2c_hw_slave_check_bus.jal
16f877a16f877a_i2c_hw_slave_echo.jal
16f877a16f877a_servo_rc_master_dedicated_slave_i2c.jal
16f8816f88_i2c_hw_slave_echo.jal
16f8816f88_i2c_hw_slave_check_bus.jal
18f14k5018f14k50_i2c_hw_slave_check_bus.jal
18f14k5018f14k50_i2c_hw_slave_echo.jal
18f45218f452_servo_rc_master_dedicated_slave_i2c.jal
18f455018f4550_i2c_hw_slave_check_bus.jal
18f455018f4550_i2c_hw_slave_echo.jal
18f462018f4620_servo_rc_master_dedicated_slave_i2c.jal



i2c_hw_slave_isr

i2c hardware slave ISR

Author Sebastien Lelong, Joep Suijs, Copyright (c) 2008-2009, all rights reserved.
Adapted-by Joep Suijs, Albert Faber
Compiler >=2.4i

Description

this library provides an ISR to implement 
a stateful i2c hardware slave. This is a jalv2 implementation of
Microchip Application Note AN734.



According to AN734, there are 5 possible i2c states. During ISR, each
of this states are detected. This ISR provides a standard skeleton to implement
an i2c hardware slaves, while client code must implement several callbacks
the ISR is expecting to call while processing states.



Here there are:
 - procedure i2c_hw_slave_on_state_1(byte in _trash):
      called when i2c address matches (master starts a talk)



 - procedure i2c_hw_slave_on_state_2(byte in rcv):
      called when master is writing a byte. Slave is thus
      receiving this byte. This callback takes this bytes as
      argument



 - procedure i2c_hw_slave_on_state_3():
      called when master wants to read a byte from slave. Thus,
      slave should send a byte (for instance, using i2c_hw_slave_write_i2c
      from i2c_hw_slave.jal library)



 - procedure i2c_hw_slave_on_state_4():
      called when master still wants to read a byte from slave. That is,
      master required to read (state 3) and now still want to read a byte



 - procedure i2c_hw_slave_on_state_5():
      called when master does not want to talk to slave anymore
      usually a good place to reset data or slave's logic



 - procedure i2c_hw_slave_on_error():
      called when something wrong happens. You can do what you want in
      this case, like resetting the PIC, log some information using usart, ...
         => called any cases other than states 1, 2, 3, 4 or 5


Sources

  - AN734: http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011798


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f72316f723_i2c_hw_slave_echo.jal
16f7316f73_i2c_hw_slave_echo.jal
16f87716f877_i2c_hw_slave_echo.jal
16f877a16f877a_i2c_hw_slave_echo.jal
16f877a16f877a_servo_rc_master_dedicated_slave_i2c.jal
16f8816f88_i2c_hw_slave_echo.jal
18f14k5018f14k50_i2c_hw_slave_echo.jal
18f45218f452_servo_rc_master_dedicated_slave_i2c.jal
18f455018f4550_i2c_hw_slave_echo.jal
18f462018f4620_servo_rc_master_dedicated_slave_i2c.jal



i2c_hw_slave_msg

i2c hardware slave Message Interface

Author Sebastien Lelong, Joep Suijs, Copyright (c) 2008-2009, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides an message interface to i2c hardware slave. 
It relies on the jalv2 implementation of Microchip Application Note AN734.


                                        
The user needs to supply a procedure to process the received message. 
Basically, this i2c slave waits for a full message to arrive. Then it calls 
the user procedure to process the message and (optional) prepare a response.
Subsequently, this lib will pass the response data over to the master, if 
it wants to have them.
See corresponding sample for more details.




Sources

  - AN734: http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011798


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f72316f723_i2c_hw_slave_eeprom_simulator.jal
16f72316f723_i2c_hw_slave_msg.jal
16f7316f73_i2c_hw_slave_msg.jal
16f7316f73_i2c_hw_slave_eeprom_simulator.jal
16f87716f877_i2c_hw_slave_eeprom_simulator.jal
16f87716f877_i2c_hw_slave_msg.jal
16f877a16f877a_i2c_hw_slave_msg.jal
16f877a16f877a_i2c_hw_slave_eeprom_simulator.jal
16f8816f88_i2c_hw_slave_msg.jal
16f8816f88_i2c_hw_slave_eeprom_simulator.jal
18f14k5018f14k50_i2c_hw_slave_msg.jal
18f14k5018f14k50_i2c_hw_slave_eeprom_simulator.jal
18f455018f4550_i2c_hw_slave_eeprom_simulator.jal
18f455018f4550_i2c_hw_slave_msg.jal



i2c_level1

i2c_hardware

Author Joep Suijs, Copyright (C) 2008 Joep Suijs
Adapted-by
Compiler >=2.4g

Description

Level1 implementation of I2C (single) master.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_i2c_sw_master_echo.jal
16f648a16f648a_i2c_sw_master_check_bus.jal
16f648a16f648a_i2c_sw_l1.jal
16f72316f723_i2c_sw_master_echo.jal
16f72316f723_i2c_sw_master_check_bus.jal
16f72316f723_i2c_sw_l1.jal
16f7316f73_i2c_sw_master_check_bus.jal
16f7316f73_i2c_sw_master_echo.jal
16f7316f73_i2c_sw_l1.jal
16f87716f877_i2c_sw_l1.jal
16f87716f877_i2c_sw_master_echo.jal
16f87716f877_i2c_sw_master_check_bus.jal
16f87716f877_i2c_hw_l1.jal
16f877a16f877a_i2c_sw_l1.jal
16f877a16f877a_i2c_sw_master_check_bus.jal
16f877a16f877a_i2c_hw_l1.jal
16f877a16f877a_i2c_sw_master_echo.jal
16f8816f88_i2c_sw_master_check_bus.jal
16f8816f88_i2c_sw_l1.jal
16f8816f88_i2c_sw_master_echo.jal
18f14k5018f14k50_i2c_hw_l1.jal
18f14k5018f14k50_i2c_sw_master_echo.jal
18f14k5018f14k50_i2c_sw_master_check_bus.jal
18f14k5018f14k50_i2c_sw_l1.jal
18f245018f2450_i2c_sw_l1.jal
18f245018f2450_i2c_sw_master_check_bus.jal
18f245018f2450_i2c_sw_master_echo.jal
18f25k2218f25k22_i2c_hw_master_echo.jal
18f25k2218f25k22_i2c_sw_master_echo.jal
18f455018f4550_i2c_sw_master_echo.jal
18f455018f4550_i2c_hw_l1.jal
18f455018f4550_i2c_sw_master_check_bus.jal
18f455018f4550_i2c_sw_l1.jal



i2c_software

i2c_software

Author Wouter van Ooijen, Copyright (C) 1998, 1999 Wouter van Ooijen
Adapted-by Joep Suijs.
Compiler >=2.4g

Description

Software implementation of I2C (single) master.





 Define i2c pins like:
alias i2c_scl            is pin_c3
alias i2c_scl_direction  is pin_c3_direction
alias i2c_sda            is pin_c4
alias i2c_sda_direction  is pin_c4_direction



const word _i2c_bus_speed = 1 ; * 100kHz


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • i2c_initialize()

    i2c_initialize - initialize the software i2c bus
    
    The output latch values are always low,
    the lines are switched open-collector fashion by 
    manipulating the direction registers.
    
    

  • i2c_stop()

    i2c_stop - output a stop condition
    
    
    

  • i2c_start()

    i2c_start - output a start condition
    
    
    

  • i2c_restart()

    i2c_restart - output a (re)start condition
    
    A restart is a start without a previous stop.
    This procedure is provided as part of the API to maintain compatibility 
    with the i2c hardware master lib.
    
    

Private
  • _i2c_bit_out(bit in x)

    _i2c_bit_out- output a single bit (for internal use only)
    
    
    

  • _i2c_bit_in(bit out x)

    _i2c_bit_in- input a single bit (for internal use only)
    
    
    

  • _i2c_wait()

    _i2c_wait - wait for a change to settle (for internal use only)
    
    The delay is determined by i2c_bus_speed and is 1/4 of the cycle time.
    Given the delay resolution of 1 us and all actions required by 
    i2c_software routines, the actual bus speed will be lower then the
    configured maximum.
    
    


Functions

  • i2c_transmit_byte( byte in x ) return bit

    i2c_transmit_byte - output one byte
    
    return true = okay, false = no ack received
    
    

  • i2c_receive_byte(bit in ack) return byte

    i2c_receive_byte - read one byte
    
    The ACK flag indicated if the byte read must be acked.
    In general, all bytes read by the master are acked, except the last one.
    Failing to NACK the last byte read will give unpredictable results.
    (Often it will provide repeatable sequences, where one out of 2 to 4 of 
    the reads from a specific device is correct. You are warned!)
    
    


Related samples

Here are the list of samples which use this library:

16f648a16f648a_i2c_sw_master_echo.jal
16f648a16f648a_lcd_dsm0822a.jal
16f648a16f648a_i2c_sw_l0.jal
16f648a16f648a_i2c_sw_master_check_bus.jal
16f648a16f648a_i2c_sw_l1.jal
16f72316f723_lcd_dsm0822a.jal
16f72316f723_i2c_sw_master_check_bus.jal
16f72316f723_i2c_sw_l0.jal
16f72316f723_i2c_sw_master_echo.jal
16f72316f723_i2c_sw_l1.jal
16f7316f73_i2c_sw_master_echo.jal
16f7316f73_i2c_sw_master_check_bus.jal
16f7316f73_i2c_sw_l1.jal
16f7316f73_lcd_dsm0822a.jal
16f7316f73_i2c_sw_l0.jal
16f87716f877_i2c_sw_l1.jal
16f87716f877_i2c_sw_master_echo.jal
16f87716f877_i2c_sw_l0.jal
16f87716f877_24lc256.jal
16f87716f877_i2c_sw_master_check_bus.jal
16f87716f877_lcd_dsm0822a.jal
16f877a16f877a_i2c_sw_l1.jal
16f877a16f877a_i2c_sw_l0.jal
16f877a16f877a_lcd_dsm0822a.jal
16f877a16f877a_i2c_sw_master_check_bus.jal
16f877a16f877a_servo_rc_master_dedicated_master_i2c.jal
16f877a16f877a_24lc256.jal
16f877a16f877a_i2c_sw_master_echo.jal
16f8816f88_i2c_sw_l0.jal
16f8816f88_i2c_sw_l1.jal
16f8816f88_i2c_sw_master_echo.jal
16f8816f88_i2c_sw_master_check_bus.jal
16f8816f88_lcd_dsm0822a.jal
18f14k5018f14k50_i2c_sw_master_echo.jal
18f14k5018f14k50_i2c_sw_master_check_bus.jal
18f14k5018f14k50_lcd_dsm0822a.jal
18f14k5018f14k50_i2c_sw_l1.jal
18f14k5018f14k50_i2c_sw_l0.jal
18f245018f2450_i2c_sw_l0.jal
18f245018f2450_i2c_sw_l1.jal
18f245018f2450_i2c_sw_master_check_bus.jal
18f245018f2450_lcd_dsm0822a.jal
18f245018f2450_i2c_sw_master_echo.jal
18f25k2218f25k22_i2c_sw_master_echo.jal
18f45218f452_servo_rc_master_dedicated_master_i2c.jal
18f45218f452_24lc256.jal
18f452518f4525_24lc256.jal
18f455018f4550_lcd_dsm0822a.jal
18f455018f4550_i2c_sw_master_echo.jal
18f455018f4550_i2c_sw_l0.jal
18f455018f4550_i2c_sw_master_check_bus.jal
18f455018f4550_24lc256.jal
18f455018f4550_i2c_sw_l1.jal
18f462018f4620_24lc256.jal
18f462018f4620_servo_rc_master_dedicated_master_i2c.jal



ir_ranger_gp2d02

GP2D02 IR ranger library

Author Sebastien Lelong, Copyright (c) 2008-2009, all rights reserved.
Adapted-by
Compiler >=2.4k

Description

this lib is able to handle the GP2D02 lib, reading distance 
measure with this IR Ranger.



You can either use the read procedure, or access the pseudo-variable
to retrieve distance measures.



When defining pins the ranger is connected to to, it's important to 
set them as "volatile" (level will go low/high within function call)
See sample(s) for more.


Sources

  - datasheet: http://www.datasheetcatalog.org/datasheet/Sharp/mXvryzu.pdf


Notes

reading a distance can take quite a long time, approx. 74ms.
See datasheet for more, but you should remember this while using this IR ranger


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f8816f88_ir_ranger_gp2d02.jal



jascii

ASCII text character constants and case conversion procedures

Author Wouter van Ooijen, Copyright (c) 1998, all rights reserved.
Adapted-by Joep Suijs, Rob Hamerling
Compiler >=2.4

Description

- ASCII text character constant definitions
             - case conversion procedures toupper and tolower



use of toupper
   var byte char = "b"  -- assign lower case "b" to char
   toupper(char)        -- char now contains "B"


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


keyboard

keyboard, scans 4x4 keybaord and returns 0x00..0x0F is keypressed, 0x10 if none pressed

Author Javier Martínez, Copyright (c) 2003, all rights reserved.
Adapted-by Eur van Andel, eur@fiwihex.nl, Joep Suijs, Rob Hamerling
Compiler >=2.4g

Description

This library is used to scan a 4x3 or 4x4 keyboard.
To use it, you need to define three variables:
   keydrive is the half port (_high or _low) with the cols connected.
   keydrive_direction is the related direction register.
   keyscan  is the half port (_high or _low) with the rows connected.



   Example:



   var volatile byte keyscan  is porta_low      -- rows of keyboard
   var volatile byte keydrive is portb_low      -- columns of keyboard
   var volatile byte keydrive_direction is portb_low_direction
   include keyboard
Note: if you don't want keyboard.jal change the direction of your pins, make sure all
keydrive pins are set to output before you call the library and define:
   var volatile byte keydrive_direction is keydrive



The library has two functions to read the keyboard:
getkey()       returns the key pressed.
getkey_once()  returns a pressed key only once (and 'none', 0x10 until the next key is pressed)



Hardware setup: connect the keyboard rows to a half port (higher or lower 4 bits of a port)
and connect the cols to a half port. Put a pull-down resistor (10k - 47k) on each row pin.
Adaptation: soldering your wires in the right order is a lot harder than you think.
Make sure you keep the rows and cols together and connect them to right port.
You could either adapt your wiring to match the default configuration or reconfigure the
library by defining the next 8 constants before you include keyboard.jal, like:
   const row1 = 0b0000_0100
   const row2 = 0b0000_0001
   const row3 = 0b0000_0010
   const row4 = 0b0000_1000
   const col1 = 0b0000_1000
   const col2 = 0b0000_0010
   const col3 = 0b0000_0100
   const col4 = 0b0000_0001
Connect the keyboard and press the buttons. Adapt the row and column constants so
pressing the buttons give the right result.
Note: you need to specify all 8 constants, even when you have a 4x3 keyboard. In
this case you can specify:
   const col4 = 0b0000_0000



keyboard map (4x4, col4 is left out with 4x3 keyboard)



     1 2 3 C     row 1
     4 5 6 D     row 2
     7 8 9 E     row 3
     * 0 # F     row 4



 col 1 2 3 4


Notes

[RobH] Added a 1 microsecond delay after changing keydrive
              to obtain reliable results with oscillator frequencies
              of 8 MHz and higher


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions

  • getkey() return byte

    getkey - return the key pressed (until it is released)
    
    return:  0 .. 9      numeric key pressed 0..9
             10          * (or A)
             11          # (or B)
             12 .. 15    C, D, E, F
             16          no key pressed.
             17          error (more then one key pressed)
    
    

  • getkey_once() return byte

    getkey_once - return the value of a key pressed only once
    
    returns: see getkey()
    
    


Related samples

Here are the list of samples which use this library:

16f876a16f876a_keyboard_lcd.jal
16f87716f877_keyboard.jal
16f877a16f877a_keyboard_lcd.jal
16f877a16f877a_keyboard.jal
18f26j1118f26j11_rtcc_hw_kbd_lcd.jal



large_array_1

Large Array library

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4l

Description

This is library for creating an array that take up more then
             256 bytes memory. Tested on 18F devices only.


Notes

Supports byte array with up to 2048 entries
Supports word array with up to 1024 entries
Supports dword array with up to 512 entries
Creates an array named large_array_1
Use "alias new_array_name is large_array_1" to rename the array
Small sample of how this lib was created at bottom of lib.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f45218f452_large_array.jal
18f452518f4525_large_array.jal
18f455018f4550_large_array.jal
18f462018f4620_large_array.jal
18f67j5018f67j50_large_array.jal



large_array_2

Large Array library

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4l

Description

This is library for creating an array that take up more then
             256 bytes memory. Tested on 18F devices only.


Notes

Supports byte array with up to 2048 entries
Supports word array with up to 1024 entries
Supports dword array with up to 512 entries
Creates an array named large_array_2
Use "alias new_array_name is large_array_2" to rename the array
Small sample of how this lib was created at bottom of lib.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f452518f4525_mp3_decoder_vs1053b_pata_hard_disk.jal
18f452518f4525_fat32_sd_card.jal
18f452518f4525_mp3_decoder_vs1053b_sd_card.jal
18f452518f4525_fat32_pata_hard_disk.jal
18f455018f4550_fat32_sd_card.jal
18f462018f4620_mp3_decoder_vs1053b_pata_hard_disk.jal
18f462018f4620_mp3_decoder_vs1053b_sd_card.jal
18f462018f4620_fat32_sd_card.jal
18f462018f4620_fat32_pata_hard_disk.jal
18f67j5018f67j50_mp3_decoder_vs1053b_sd_card.jal
18f67j5018f67j50_fat32_pata_hard_disk.jal
18f67j5018f67j50_fat32_sd_card.jal
18f67j5018f67j50_mp3_decoder_vs1053b_pata_hard_disk.jal



large_array_3

Large Array library

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4l

Description

This is library for creating an array that take up more then
             256 bytes memory. Tested on 18F devices only.


Notes

Supports byte array with up to 2048 entries
Supports word array with up to 1024 entries
Supports dword array with up to 512 entries
Creates an array named large_array_3
Use "alias new_array_name is large_array_3" to rename the array
Small sample of how this lib was created at bottom of lib.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


large_array_4

Large Array library

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4l

Description

This is library for creating an array that take up more then
             256 bytes memory. Tested on 18F devices only.


Notes

Supports byte array with up to 2048 entries
Supports word array with up to 1024 entries
Supports dword array with up to 512 entries
Creates an array named large_array_4
Use "alias new_array_name is large_array_4" to rename the array
Small sample of how this lib was created at bottom of lib.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


lcd_backlight

lcd_backlight.jal

Author Joep Suijs, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4g

Description

Provides standard interface to backlight of (directly connected) lcd.    
First, setup the pin for the backlight:
   var volatile bit lcd_bl is pin_b0
   pin_b0_direction = output              



If the backlight line is inverted (that is low output turn the backlight on),
you must define:
   const bit lcd_bl_inverted = true



If you want digital backlight (on or off), then you can include this library.
But if you want variable backlight (256 steps from off to on), the pin above 
must be a pwm (ccp) output pin. And you have to tell the library, which pwm:
   const byte lcd_backlight_pwm = 1                                        



now include the library & init it:
   include lcd_backlight
   pwm_backlight_init()        


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_backlight.jal
16f87716f877_backlight.jal
16f877a16f877a_backlight.jal
16f8816f88_backlight.jal



lcd_dog_m_4

control for DOG-M (ST7036 based) LCD's

Author Richard Zengerink, Copyright (c) 2008, all rights reserved
Adapted-by
Compiler =2.4

Description

   Simple interface for DOG-M (st7036) alphanumeric LCD screens.
   Screens can range from 1x8  (1 lines, 8 chars), 2x16 and 3x16.
   Uses 4 bit wide datapath + 2 handshake lines (total 6 PIC pins).
   Expects: - 2 pins for handshake: 'lcd_rs' and 'lcd_en'
            - 1 port nibble for data: 'lcd_dataport'
   *
   Directions for use of this library in application programs
   (in this sequence):
   1. Declare the following constants:
         const byte LCD_ROWS     = 2              -- 1, 2 or 3 lines
         const byte LCD_CHARS    = 16             -- 8, 16 chars per line
      and variables (aliases):
         var   byte lcd_dataport  is  portA_low   -- 4 data pins
         var   bit  lcd_en        is  pin_A4      -- trigger
         var   bit  lcd_rs        is  pin_A5      -- cmd/data select
   2. Include this library.
   and somewhere before actually using the lcd:
   3. Set the chosen LCD dataport and handshake pins to output:
         portA_low_direction = all_output
         pin_A4_direction    = output
         pin_A5_direction    = output
   4. Call lcd_init() to initialize the lcd controller.
   Above is an example for a 2x16 LCD:
     Bits 0..3 of portA are used for data, pins 4 and 5 of portA are
     used for handshake. Any other available nibble and handshake pins
     could be used (provided these are configurable for output).


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • lcd_init()

    Initialize display in 1 and 2 or 3 line, display on, no cursor shown an cursor
    moves to the right.
    
    

Private

Functions


Related samples

No sample found


lcd_dog_m_8

control for DOG-M (ST7036 based) LCD's

Author Richard Zengerink, Copyright (c) 2008, all rights reserved
Adapted-by
Compiler =2.4

Description

   Simple interface for DOG-M (st7036) alphanumeric LCD screens.
   Screens can range from 1x8  (1 lines, 8 chars), 2x16 and 3x16.
   Uses 8 bit wide datapath + 2 handshake lines (total 10 PIC pins).
   Expects: - 2 pins for handshake: 'lcd_rs' and 'lcd_en'
            - 1 port for data: 'lcd_dataport'
   *
   Directions for use of this library in application programs
   (in this sequence):
   1. Declare the following constants:
         const byte LCD_ROWS     = 2              -- 1, 2 or 3 lines
         const byte LCD_CHARS    = 16             -- 8, 16 chars per line
      and variables (aliases):
         var   byte lcd_dataport  is  portA       -- 8 data pins
         var   bit  lcd_en        is  pin_b0      -- trigger
         var   bit  lcd_rs        is  pin_b1      -- cmd/data select
   2. Include this library.
   and somewhere before actually using the lcd:
   3. Set the chosen LCD dataport and handshake pins to output:
         portA_direction     = all_output
         pin_b0_direction    = output
         pin_b0_direction    = output
   4. Call lcd_init() to initialize the lcd controller.
   Above is an example for a 2x16 LCD:
     portA are is used for data, pins 0 and 1 of portB are
     used for handshake. Any other available port and handshake pins
     could be used (provided these are configurable for output).


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • lcd_init()

    Initialize display in 1 and 2 or 3 line, display on, no cursor shown an cursor
    moves to the right.
    
    

Private

Functions


Related samples

No sample found


lcd_dog_m_spi

control for DOG-M (ST7036 based) LCD's

Author Richard Zengerink, Copyright (c) 2008, all rights reserved
Adapted-by
Compiler =2.4

Description

   Simple interface for DOG-M (st7036) alphanumeric LCD screens.
   Screens can range from 1x8  (1 lines, 8 chars), 2x16 and 3x16.
   Uses spi interface SI (data line), CLK (clock) RS (register select) and
   if necesery CSB (chip select) (total 4 PIC pins max.).
   Expects: - 1 pin for data: 'lcd_data'
            - 1 pin for clock: 'lcd_clk'
            - 1 pin for register/data select: 'lcd_rs'
            - 1 pin for Chip Select 'lcd_csb'  (if necesery, or CSB to gnd on lcd)
            - 1 var bit named not_connected to assign to lcd_csb if this pin
              is connected to ground.
   Directions for use of this library in application programs
   (in this sequence):
   1. Declare the following constants:
         const byte LCD_ROWS     = 2              -- 1, 2 or 3 lines
         const byte LCD_CHARS    = 16             -- 8, or 16 chars per line
      and variables (aliases):
         var   bit not_connected
         var   bit  lcd_data      is  pin_A0      -- 1 data pin
         var   bit  lcd_clk       is  pin_A1      -- 1 data pin
         var   bit  lcd_rs        is  pin_A2      -- 1 data pin
         var   bit  lcd_csb       is  pin_A3      -- 1 data pin
     or if csb is connected to gnd:
         var   bit  lcd_csb       is  not_connected



   2. Include this library.
   and somewhere before actually using the lcd:
   3. Set the chosen LCD data and control pins to output:
         portA_low_direction = all_output  (in above case this is OK)
    OR assign each pin seperatly (when not every pin is on the same port):
         pin_A0_direction    = output      (each pin separately assigned)
         pin_A1_direction    = output
         pin_b0_direction    = output
         pin_b1_direction    = output
   4. Call lcd_init() to initialize the lcd controller.
   Above is an example for a 2x16 LCD:



   Available functions for application programs:






     _lcd_write()                     ends byte from value to
                                            register of the lcd  and
                                            shift cursor position 1 right



     _lcd_write_data()                write data to lcd using
                                            _lcd_write() lcd_rs high



     _lcd_write_data()                write command to lcd using
                                            _lcd_write() lcd_rs low



     lcd_init()                             initialize the LCD controller




Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • lcd_init()

    Initialize display in 1 and 2 or 3 line, display on, no cursor shown an cursor
    moves to the right.
    
    

Private

Functions


Related samples

No sample found


lcd_dsm0822a

dsm0822a - i2c star burst dispay driver

Author Joep Suijs, Copyright (c) 2009-2010, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides a i2c star burst display driver
The dm0822a is a star burst display driver with an i2c interface.
To use this library:
- setup i2c comms to the display
- include this libraray and call dsm_init()



Now you can use the display. A char assigned to dsm_data like:
   dsm_data = "A"
is displayed on the next free location. And with 
   dsm_data = ASCII_CR
you start printing at the first location again.



The indicator fields of the display can be switched on with
   dsm_set_indicator(DSM_I1)   
and turned off with
   dsm_clear_indicator(DSM_I1)                     



The two procedures above support the next constants:
   DSM_1   : channel 1 indication
   DSM_2   : channel 2 indication
   DSM_3   : channel 3 indication
   DSM_4   : channel 4 indication
   DSM_5   : channel 5 indication
   DSM_6   : channel 6 indication
   DSM_I1  : left signal indication
   DSM_I2  : central signal indication
   DSM_I3  : right signal indication
   DSM_RDS : rds indicator
   DSM_TP  : tp indication
   DSM_TA  : ta indication
   DSM_OO  : stereo indication
   DSM_FM  : fm indication
   DSM_DOT : decimal point
Multiple of these constants can be OR-ed together to one parameter




Sources

based on C program of Michael Dworkin  
Info on the display at http://hobbyelektronik.org/VB/LCD/DS/index.htm


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_lcd_dsm0822a.jal
16f72316f723_lcd_dsm0822a.jal
16f7316f73_lcd_dsm0822a.jal
16f87716f877_lcd_dsm0822a.jal
16f877a16f877a_lcd_dsm0822a.jal
16f8816f88_lcd_dsm0822a.jal
18f14k5018f14k50_lcd_dsm0822a.jal
18f245018f2450_lcd_dsm0822a.jal
18f455018f4550_lcd_dsm0822a.jal



lcd_hd44780_4

LCD library for HD44780 compatible LCDs, with 4 bits wide datatransfer

Author Rob Hamerling, Copyright (c) 2008..2009, all rights reserved.
Adapted-by Eur van Andel, Joep Suijs (refactoring),Richard Zengerink (lcd_init)
Compiler 2.4n

Description

   Nibble interface for HD44780 compatible alphanumeric LCD screens.
   Uses 4 bits wide datapath + 2 handshake lines (total 6 PIC pins).
   Expects: 2 pins for handshake: 'lcd_rs' and 'lcd_en'
            and
                 1 port nibble for data: 'lcd_dataport'
              or
                 4 individual pins for data: 'lcd_d4' .. 'lcd_d7'
.
   Note:  a 'port nibble' (the lower or higher 4 bits of a port)
          gives faster and more compact code than 4 individual pins.
.
   Directions for use of this library in application programs
   (in this sequence):
   1. Declare the following constants:
         const byte LCD_ROWS     = 2               -- 1, 2 or 4 lines
         const byte LCD_CHARS    = 16              -- 8, 16 or 20 chars per line
      and aliases for handshake lines:
         alias   lcd_rs          is  pin_A5        -- cmd/data select
         alias   lcd_en          is  pin_A4        -- trigger
      and aliases for 4 data lines:
            alias lcd_dataport  is  portA_low      -- 4 databits
         or
            alias  lcd_d4       is  pin_A3         -- lcd databit d4
            alias  lcd_d5       is  pin_A1         -- lcd databit d5
            alias  lcd_d6       is  pin_C0         -- lcd databit d6
            alias  lcd_d7       is  pin_C2         -- lcd databit d7
.
   2. Set the chosen LCD dataport and handshake pins to output:
         pin_A4_direction       = output
         pin_A5_direction       = output
      and the data port nibble to output:
            portA_low_direction = all_output
         or the 4 individual datapins to output:
            pin_A3_direction    = output
            pin_A1_direction    = output
            pin_C0_direction    = output
            pin_C2_direction    = output
.
   3. Include this library.
.
   4. Call lcd_init() to initialize the lcd controller.
.
   Above is an example for a 2x16 LCD.
.
   See hd_44780_common for the LCD API.


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • lcd_init()

    Initialize LCD controller to 4-bits mode and default operational settings
    
    

Private

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_ds18b20_single.jal
16f648a16f648a_lcd_hd44780_custom.jal
16f648a16f648a_lcd_hd44780_4_4.jal
16f648a16f648a_lcd_hd44780_4bit.jal
16f648a16f648a_backlight.jal
16f648a16f648a_lcd_hd44780_4_1.jal
16f67616f676_lcd_hd44780_4_4.jal
16f67616f676_lcd_hd44780_4_1.jal
16f69016f690_lcd_hd44780_4_4.jal
16f69016f690_lcd_hd44780_4_1.jal
16f72616f726_lcd_hd44780_4_4.jal
16f72616f726_lcd_hd44780_4_1.jal
16f72716f727_lcd_hd44780_4_1.jal
16f72716f727_lcd_hd44780_4_4.jal
16f81916f819_lcd_hd44780_4_4.jal
16f81916f819_lcd_hd44780_4_1.jal
16f876a16f876a_keyboard_lcd.jal
16f876a16f876a_sht.jal
16f876a16f876a_tc77.jal
16f876a16f876a_rtc_lcd.jal
16f876a16f876a_lcd_hd44780_4_4.jal
16f876a16f876a_lcd_hd44780_4_1.jal
16f876a16f876a_t6603.jal
16f87716f877_backlight.jal
16f87716f877_lcd_hd44780_custom.jal
16f87716f877_lcd_hd44780_4bit.jal
16f87716f877_ds18b20_single.jal
16f877a16f877a_lcd_format.jal
16f877a16f877a_co2_t6603.jal
16f877a16f877a_backlight.jal
16f877a16f877a_keyboard_lcd.jal
16f877a16f877a_rtc_lcd.jal
16f877a16f877a_lcd_hd44780_4bit.jal
16f877a16f877a_ds18b20_single.jal
16f877a16f877a_lcd_hd44780_4_1.jal
16f877a16f877a_lcd_hd44780_4_4.jal
16f877a16f877a_lcd_hd44780_custom.jal
16f8816f88_lcd_hd44780_4_4.jal
16f8816f88_lcd_hd44780_4_1.jal
16f8816f88_ds18b20_single.jal
16f8816f88_lcd_hd44780_custom.jal
16f8816f88_lcd_hd44780_4bit.jal
16f8816f88_backlight.jal
16f8816f88_lcd_hd44780_4_4_custom.jal
16f88616f886_rtc_lcd_4mhz.jal
16f88616f886_pwm_adc_res.jal
16f88616f886_rtc_lcd_125khz.jal
16f88616f886_rtc_lcd_20mhz.jal
16f88616f886_pwm_adc_freq.jal
16f88716f887_lcd_hd44780_4_1.jal
16f88716f887_lcd_hd44780_4_4.jal
18f123018f1230_lcd_hd44780_4_1.jal
18f232018f2320_lcd_hd44780_4_1.jal
18f232018f2320_lcd_hd44780_4_4.jal
18f245018f2450_lcd_hd44780_custom.jal
18f245018f2450_ds18b20_single.jal
18f245018f2450_lcd_hd44780_4bit.jal
18f25j1018f25j10_test_mlx90615.jal
18f26j1118f26j11_rtcc_hw_kbd_lcd.jal
18f455018f4550_lcd_hd44780_4bit.jal
18f455018f4550_lcd_hd44780_custom.jal
18f455018f4550_ds18b20_single.jal
18f468518f4685_lcd_hd44780_4_4.jal
18f468518f4685_lcd_hd44780_4_1.jal
18f631018f6310_lcd_hd44780_4_1.jal
18f631018f6310_lcd_hd44780_4_4.jal



lcd_hd44780_8

LCD library for HD44780 compatible LCDs, with 8 bits wide datatransfer

Author Rob Hamerling, Copyright (c) 2008..2009, all rights reserved.
Adapted-by Eur van Andel, Joep Suijs (refactoring),Richard Zengerink (lcd_init)
Compiler 2.4n

Description

   Port interface for HD44780 compatible alphanumeric LCD screens.
   Uses 8 bits wide datapath + 2 handshake lines (total 10 PIC pins).
   Expects: 2 pins for handshake: 'lcd_rs' and 'lcd_en'
            and:
                   1 complete port for data: 'lcd_dataport'
                or
                   2 nibbles for data: 'lcd_dataport_low' and 'lcd_dataport_high'
                or
                   8 individual pins for data: lcd_dataline_d0 .. _d7
.
   note:    a complete ports gives faster and more compact code then
            two port 'nibble'' (the lower or higher 4 bits of a port)
            which is on its turn faster than 8 individual pins.
.
   Directions for use of this library in application programs
   (in this sequence):
   1. Declare the following constants:
         const byte LCD_ROWS     = 2               -- 1, 2 or 4 lines
         const byte LCD_CHARS    = 16              -- 8, 16 or 20 chars per line
      and aliases for handshake lines:
         alias   lcd_rs          is  pin_D2        -- cmd/data select
         alias   lcd_en          is  pin_D3        -- trigger
      and aliases for 8 data lines:
            alias  lcd_dataport  is  portF         -- 8 databits
          or
            alias  lcd_dataport_low  is portD_high  -- 4 low order databits
            alias  lcd_dataport_high is portC_high  -- 4 high order databits
          or
            alias   lcd_d0       is  pin_D0        -- lcd databit d0
            alias   lcd_d1       is  pin_D1        -- lcd databit d1
            alias   lcd_d2       is  pin_C6        -- lcd databit d2
            alias   lcd_d3       is  pin_C7        -- lcd databit d3
            alias   lcd_d4       is  pin_B0        -- lcd databit d4
            alias   lcd_d5       is  pin_B1        -- lcd databit d5
            alias   lcd_d6       is  pin_C0        -- lcd databit d6
            alias   lcd_d7       is  pin_C2        -- lcd databit d7
.
   2. Set the chosen LCD handshake pins to output:
         pin_D2_direction     = output
         pin_D3_direction     = output
      and the data port to output:
             portF_direction      = ALL_OUTPUT
         or 2 data port nibbles to output:
             portD_high_direction = ALL_OUTPUT
             portC_high_direction = ALL_OUTPUT
         or 8 individual data pins to outout:
             pin_D0_direction     = output
             pin_D1_direction     = output
             pin_C6_direction     = output
             pin_C7_direction     = output
             pin_B0_direction     = output
             pin_B1_direction     = output
             pin_C0_direction     = output
             pin_C2_direction     = output
.
   3. Include this library.
.
   4. Call lcd_init() to initialize the lcd controller.
.
   Above is an example for a 2x16 LCD.
.
   See hd_44780_common for the LCD API.


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • lcd_init()

    Initialize LCD controller to 8-bits mode and default operational settings
    
    

Private

Functions


Related samples

Here are the list of samples which use this library:

16f72716f727_lcd_hd44780_8_1.jal
16f72716f727_lcd_hd44780_8_4.jal
16f877a16f877a_lcd_hd44780_8_4.jal
16f877a16f877a_lcd_hd44780_8_1.jal
16f88716f887_lcd_hd44780_8_1.jal
16f88716f887_lcd_hd44780_8_4.jal
18f468518f4685_lcd_hd44780_8_4.jal
18f468518f4685_lcd_hd44780_8_1.jal
18f631018f6310_lcd_hd44780_8_1.jal
18f631018f6310_lcd_hd44780_8_8.jal
18f631018f6310_lcd_hd44780_8_4.jal



lcd_hd44780_common

common library for HD44780 based LCD

Author Richard Zengerink, Copyright (c) 2008..2011, all rights reserved.
Adapted-by Joep Suijs, Rob Hamerling
Compiler 2.4n

Description

Common API for HD44780 based LCD


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions

Private

API details

Global variables/contants

Procedures

Private
  • _lcd_restore_cursor()

    _lcd_restore_cursor - sets the cursor to the position in the shadow register
    (this routine is only used inside this file)
    
    


Functions

Private

Related samples

No sample found


lcd_hd44780_serial_sw

LCD library for HD44780 compatible LCDs, interfaced with 1 pin (serial_sw)

Author Joep Suijs, Copyright (c) 2008..2009, all rights reserved.
Adapted-by Richard Zengerink (lcd_init)
Compiler >=2.4g

Description

   Software serial interface for HD44780 compatible alphanumeric LCD screens.  
 --
   Directions for use of this library in application programs
   (in this sequence):
   1. Declare the following constants:
         const byte LCD_ROWS     = 2              -- 1, 2 or 4 lines
         const byte LCD_CHARS    = 16             -- 8, 16 or 20 chars per line
      and variables (aliases):
         var bit serial_sw_tx_pin  is  pin_d0     -- pin on which lcd is connected



   2. Set the chosen LCD dataport and handshake pins to output:
         pin_d0_direction = output



   3. Include this library.



   4. Call lcd_init() to initialize the lcd controller.



   Above is an example for a 2x16 LCD, connected to pin d0



   See hd_44780_common for the LCD API.


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

No sample found


lcd_sterm_master

STERM Master library for JALLIB

Author Javier Martínez & Eur Van Andel Copyright (C) 2003-2009 All rights reserved
Adapted-by William Welch
Compiler 2.4

Description

Sterm (Serial Terminal) is a protocol to write to an standard HD44780 LCD 
and read from a 4x4 matrix keyboard. It was developed for easy debugging of JAL programs. 
With Sterm and a single PIC pin you can do a  lot of human interfacing, often to the point that 
nothing else is needed. Especially usefull for projects "beyond the PC", that have to work in the field.


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions

Private

API details

Global variables/contants

Procedures

  • lcd_init()

    Send reset to Terminal:
    Clear the LCD and makes a sw reset of the PIC.
    

Private

Functions

Private

Related samples

Here are the list of samples which use this library:

16f81916f819_mcp2515_can_monitor.jal
16f81916f819_ee25aa02e48_lcd.jal
16f81916f819_mcp2515_canid4_monitor.jal
18f258518f2585_canid4_serial_adapter.jal
18f258518f2585_can_serial_adapter.jal
18f258518f2585_can_monitor.jal
18f258518f2585_canid4_monitor.jal
18f262018f2620_rtc_tmr3.jal
18f458518f4585_canid4_monitor.jal



math

math.jal - Collection of mathematical functions.

Author Rob Hamerling, Michael Watterson Copyright (c) 2009, all rights reserved.
Adapted-by Michael Watterson, Eur van Andel
Compiler 2.4l

Description

Collection of mathematical routines.


Sources

Several authors.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_sqrt.jal
16f72316f723_sqrt.jal
16f7316f73_sqrt.jal
16f87716f877_sqrt.jal
16f877a16f877a_sqrt.jal
16f8816f88_sqrt.jal
16f88616f886_math.jal
18f14k5018f14k50_sqrt.jal
18f245018f2450_sqrt.jal
18f455018f4550_sqrt.jal



mcp3424

mcp342, 18-bit, multi-channel delta-sigma AD converter with I2C output

Author Eur van Andel, eur@fiwihex.nl Copyright (c) 2010
Adapted-by William Welch
Compiler =2.4n

Description

this library works with the MCP3424 AD converter from Microchip with up to 18 bits accuracy
Datasheet: DS22088B


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


mcp9800

mcp9800

Author Eur van Andel, eur@fiwihex.nl Copyright (c) 2010
Adapted-by William Welch
Compiler =2.4n

Description

this library works with the MCP9800 temperature sensor from microchip
The MCP9800 can do 9 to 12 bit temperature measurement resolution
in the 12bit mode, the LSb represents 1/16ºC
only 12 bit routines are given here


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


mp3_decoder_sta015

sta015/sta013 mp3 decoder sample

Author Matthew Schinkel, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4m

Description

example usage of the sta015 mp3 decoder. plays .mp3 files from
             a fat32 formatted sd card or hard disk


Sources

http://www.st.com/stonline/books/pdf/docs/7042.pdf
http://www.pjrc.com/mp3/sta013.html


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


mp3_decoder_vs1053b

vs1053b mp3 decoder sample

Author Matthew Schinkel, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4m

Description

example usage of the vs1053 mp3 decoder. plays .mp3 files from
             a fat32 formatted sd card. Full control of play speed, volume,
             right/left speaker, bass, treble, mute. Also plays
             Ogg Vorbis/AAC/WMA/MIDI


Sources

VLSI Solutions Datasheet - www.vlsi.fi/fileadmin/datasheets/vlsi/vs1053.pdf


Notes

vs1053 uses SPI mode 0,0
must use 12.288mhz crystal for vs1053b


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

18f452518f4525_mp3_decoder_vs1053b_pata_hard_disk.jal
18f452518f4525_mp3_decoder_vs1053b_sd_card.jal
18f462018f4620_mp3_decoder_vs1053b_pata_hard_disk.jal
18f462018f4620_mp3_decoder_vs1053b_sd_card.jal
18f67j5018f67j50_mp3_decoder_vs1053b_sd_card.jal
18f67j5018f67j50_mp3_decoder_vs1053b_pata_hard_disk.jal



one_wire

one wire JAL library

Author Vasile Surducan, Copyright (c) 2009..2010, all rights reserved.
Adapted-by Jean Marchaudon, Joep Suijs
Compiler >=2.4m

Description

Library to interface with Dallas / Maxim one-wire-bus devices


 
Pin used for the 1-wire bus must be define these in your program 
before including the library. E.g.:
alias d1w_bus   is pin_c1
alias d1w_bus_out  is pin_c1_direction


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_ds18b20_single.jal
16f87716f877_ds18b20_single.jal
16f877a16f877a_ds18b20_single.jal
16f8816f88_ds18b20_single.jal
18f245018f2450_ds18b20_single.jal
18f455018f4550_ds18b20_single.jal



pata_hard_disk

Hard disk library for communicating with parallel ata hard drives

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4k

Description

this library provides functions for pata/ide hard disk drives.


Sources

"connecting ide drives by tilmann reh" - http://www.gaby.de/gide/IDE-TCJ.txt
IDE hardware reference & information document by alex t. ivopol
ATA Attachement with Packet Interface 6 - d1410r3-ATA-ATAPI-6.pdf


Notes

- If you are not using Alternate Status, Digital Output or Drive Address registers
         pins cs1 & cs0 can be saved by connecting these ide pins to cs0-high, cs1-low
         at ide connector. normal operation does not require these pins. Set
         "CONST BYTE PATA_HD_USE_CS0_CS1_PINS = TRUE" if you will be using
         these registers
       - You MUST write full sectors of 512 bytes.
       - this lib does not do error checking


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

16f87716f877_pata_hard_disk.jal
16f87716f877_fat32_small_pata_hard_disk.jal
16f877a16f877a_fat32_small_pata_hard_disk.jal
16f877a16f877a_pata_hard_disk.jal
18f45218f452_fat32_small_pata_hard_disk.jal
18f45218f452_pata_hard_disk.jal
18f452518f4525_fat32_small_pata_hard_disk.jal
18f452518f4525_fat32_pata_hard_disk.jal
18f452518f4525_mp3_decoder_vs1053b_pata_hard_disk.jal
18f452518f4525_pata_hard_disk.jal
18f462018f4620_mp3_decoder_vs1053b_pata_hard_disk.jal
18f462018f4620_pata_hard_disk.jal
18f462018f4620_fat32_small_pata_hard_disk.jal
18f462018f4620_fat32_pata_hard_disk.jal
18f67j5018f67j50_fat32_small_pata_hard_disk.jal
18f67j5018f67j50_fat32_pata_hard_disk.jal
18f67j5018f67j50_pata_hard_disk.jal
18f67j5018f67j50_mp3_decoder_vs1053b_pata_hard_disk.jal



period_skip

motor speed control by skipping periods of AC mains

Author Eur van Andel, eur@fiwihex.nl (c) 2009
Adapted-by
Compiler >=2.4g

Description

AC induction motors are low-priced, very reliable and widely available.
This library provides a way to control the speed of these motors, if they have reasonably
angular momentum.



Explanation: this is *NOT* phase control: http://en.wikipedia.org/wiki/Phase_control
Phase control makes a lot of noise, both audible and electrical. 



This is deliberate skipping of half-waves. There are only 100 half-waves per second
@ 50 Hz and bit-fine control of motor speed would result in long duty cycles (2.55s)
with varying motor speeds and audible pitch change. 
So we keep the period cycle at 32 half waves, with 8 duty cycles that only differ 
one half-wave to minimise audible noise. 
Electrical noise is minimized by zero-voltage switching.


Sources

Fairchild Application Note AN-3004, http://www.fairchildsemi.com/an/AN/AN-3004.pdf
http://www.sullivan-county.com/ele/triacs2.htm for schematics and examples how 
to generate a zero-crossing signal. 


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f87716f877_period_skip.jal



pic_data_eeprom

reading/writing of PIC's data EEPROM

Author Stef Mientki, Copyright (c) 2002..2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling, Joep Suijs (on behalf of Tijs van Roon).
Compiler >=2.4i

Description

Read from or write to EEPROM/data a byte, word or double word.
Available procedures:
  * data_eeprom_read(,)
  * data_eeprom_write(,)
  * data_eeprom_read_word(,)
  * data_eeprom_write_word(,)
  * data_eeprom_read_dword(,)
  * data_eeprom_write_dword(,)
Available functions:
  *  = data_eeprom()
  *  = data_eeprom_word()
  *  = data_eeprom_dword()
In all cases  is a position relative to the beginning of
EEPROM/data memory, thus starts at 0.
Examples of use:
  * Read a byte of EEPROM at offset 7 into x:
        var byte x
        data_eeprom_read(7, x)
  * Read a word from EEPROM at offset 4 into y:
        var word y
        y = data_eeprom_word(4)
  * Write a byte to EEPROM at offset 18:
        data_eeprom_write(18, 0b1111_0000)


Notes

- Write-protect bits in configuration memory may prohibit writing.
- Writing to locations outside the available memory range may have
  unexpected effects!
- Summary of changes
  + Changed byte-offset to word-offset for larger EEPROMs with 18Fs
  + Offset and flags settings for read and write in separate procedure.
  + Moved check for write completed ahead of read and write, for
    performance (ahead of read needed for read back of same offset).
  + added 'pragma inline' to several procedures
  + some other code optimizations
  + added support for PICs with deviating register names, like 'EEDAT'
    or EEDATL in stead of 'EEDATA' and EEADRL in stead of EEADR.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_data_eeprom.jal
16f877a16f877a_data_eeprom.jal
16f8816f88_data_eeprom.jal
16f8816f88_remember_me.jal
18f14k5018f14k50_data_eeprom.jal
18f24218f242_data_eeprom.jal
18f262018f2620_data_eeprom.jal
18f455018f4550_data_eeprom.jal
18f672218f6722_data_eeprom.jal



pintools

utility functions and procedures to manipulate pins (level, mode, etc...)

Author Sebastien Lelong, Copyright (C) 2009, all rights reserved.
Adapted-by
Compiler 2.4m

Description

This library provides a set of utility functions and procedures
to help users manipulating pins. For instance, you can dynamically access pins
using a specific mapping (RA0 is #0, RB1 is #2, etc...) and act on levels, mode,
directions, etc...



Using this library requires that array "pintools_map" is first defined. This array 
is composed by elements going by two:
 * the first element corresponds to the port letter ("A", "B", ...)
 * the second element corresponds to the pin number in this port (0, 1, 2, ...)
Pins are then accessed according to the index in this array (starting with 0)
Ex: const byte pintools_map [] = {"A","1", "B","1", "D","3}
This 6 elements (2x3) array specifies that:
 * pin #0 corresponds to pin_A1
 * pin #1 corresponds to pin_B1
 * pin #2 corresponds to pin_D3


Notes

this library hasn't been fully tested, this is still BETA...


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f455018f4550_pintools.jal



pps

Peripheral Pin Select (PPS) library

Author Sebastien Lelong, Copyright (c) 2011, all rights reserved.
Adapted-by
Compiler >=2.4o

Description

This library provides several utility functions to deal with
Peripheral Pin Select (PPS) module. PPS is a special feature implemented on
recent PIC (currently 18FXXJ11, 18FXXJ13, 18FXXJ50, 18FXXJ53). PPS allows
to dynamically assign function to pins known as "remappable pins". These pins are
easily identified as they're name "RPn".
.
Assigning function to pins is done differently wheter function is an input
or output. When function is an input (eg. serial RX), PPS is used by
specifying, for this function, what is the RP pins to be used. On the other
side, when function is an output (eg. serial TX), PPS is used by
specifying, for this RP pin, what is the function it should
carry. As a consequence, several RP pins can carry the same output function.
.
In order to configure RP pins, PPS module must be unlocked using pps_begin(),
pins should be remapped calling corresponding procedure and setting
appropriate function ID number, then locked again using pps_commit().
This is a security guard used to prevent any unintentional changes.
When PPS uses 1-way locking (default behavior), pins can be remapped only
once (when PPS is becoming locked again, any further changes are ignored).
When PPS don't use 1-way locking, several unlock/lock sequences can occur
at runtime. If this behavior is wanted, the following fuse setting should be
used:
         pragma target IOL1WAY disabled
.
Please refer to datasheet in order to have a better overview of PPS.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pps_control_lock(bit in state)

    Lock/unlock PPS module, allowing pins to be remapped. If 1-way locking is used
    this procedure must only be called once. Once remappable pins are configured
    PPS must be locked again to apply changes
    Note: interrupts are temporarily disabled. When pps_lock(true) is called
    interrupts are restored back to previous state
    

Functions


Related samples

Here are the list of samples which use this library:

18f27j5318f27j53_pps_rx2tx2.jal



print

Writes variables to output device

Author Joep Suijs, Copyright (c) 2007..2008, all rights reserved.
Adapted-by Joep Suijs, Michael Watterson
Compiler >=2.2

Description

Outputs variables to output device.
formats: _decimal and _hex
vars:    bit, byte, sbyte, word, sword, dword, sdword


  
Example:


     
var sword bhl = -684


     
; print the signed word to the LCD display
print_sword_dec(lcd_char, bhl)


     
; and now print the same signed word to the serial port
print_sword_dec(serial_hw_data, bhl)



; Specials:
print_crlf(serial_hw_data)  -- print cr + lf to device
; 
const byte str1[] = "JalLibWorld V1.0\n"     
print_string(serial_hw_data, str1) -- print string to device
;
; Note - the whole string - that is the length of the array - 
; is printed. When you use a variable array to construct strings,
; you might want to terminate at a termination character, like 0.
; You can set this termination character with:
; const print_string_terminator = 255
; (or use a var if you want to change it runtime.)
;
include print      


Notes

 print_sword_fp_dec uses "fixed point" integer, -127.256 to +127.256
 Imagine the decimal. Thus 0x110 = 1.5 as 128 = 0.5 and 256 = 1


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

16f193716f1937_serial_hw_int_cts.jal
16f193716f1937_serial_hardware.jal
16f648a16f648a_startersguide.jal
16f648a16f648a_serial_print.jal
16f648a16f648a_lcd_dsm0822a.jal
16f648a16f648a_serial_hardware.jal
16f648a16f648a_serial_hw_int_cts.jal
16f648a16f648a_i2c_sw_l1.jal
16f648a16f648a_lcd_hd44780_4bit.jal
16f648a16f648a_ds18b20_single.jal
16f648a16f648a_sqrt.jal
16f648a16f648a_i2c_sw_l0.jal
16f648a16f648a_backlight.jal
16f648a16f648a_random.jal
16f72316f723_lcd_dsm0822a.jal
16f72316f723_serial_print.jal
16f72316f723_i2c_hw_slave_msg.jal
16f72316f723_sqrt.jal
16f72316f723_adc_independent.jal
16f72316f723_random.jal
16f72316f723_i2c_sw_l0.jal
16f72316f723_serial_hw_int_cts.jal
16f72316f723_i2c_sw_l1.jal
16f72316f723_startersguide.jal
16f72316f723_serial_hardware.jal
16f72316f723_i2c_hw_slave_eeprom_simulator.jal
16f7316f73_serial_print.jal
16f7316f73_serial_hw_int_cts.jal
16f7316f73_startersguide.jal
16f7316f73_adc_dependent.jal
16f7316f73_random.jal
16f7316f73_lcd_dsm0822a.jal
16f7316f73_i2c_sw_l0.jal
16f7316f73_i2c_hw_slave_msg.jal
16f7316f73_serial_hardware.jal
16f7316f73_i2c_hw_slave_eeprom_simulator.jal
16f7316f73_i2c_sw_l1.jal
16f7316f73_sqrt.jal
16f81916f819_ee25aa02e48_lcd.jal
16f81916f819_mcp2515_can_monitor.jal
16f81916f819_mcp2515_canid4_monitor.jal
16f876a16f876a_keyboard_lcd.jal
16f876a16f876a_adc.jal
16f876a16f876a_tc77.jal
16f876a16f876a_t6603.jal
16f876a16f876a_sht.jal
16f876a16f876a_rtc_lcd.jal
16f87716f877_backlight.jal
16f87716f877_i2c_sw_l1.jal
16f87716f877_glcd_ks0108.jal
16f87716f877_lcd_hd44780_4bit.jal
16f87716f877_serial_hw_int_cts.jal
16f87716f877_i2c_hw_slave_eeprom_simulator.jal
16f87716f877_adc_dependent.jal
16f87716f877_fat32_small_sd_card.jal
16f87716f877_sqrt.jal
16f87716f877_keyboard.jal
16f87716f877_serial_print.jal
16f87716f877_serial_hardware.jal
16f87716f877_adc.jal
16f87716f877_startersguide.jal
16f87716f877_i2c_sw_l0.jal
16f87716f877_fat32_small_pata_hard_disk.jal
16f87716f877_i2c_hw_l0.jal
16f87716f877_i2c_hw_l1.jal
16f87716f877_pata_hard_disk.jal
16f87716f877_lcd_dsm0822a.jal
16f87716f877_i2c_hw_slave_msg.jal
16f87716f877_sd_card.jal
16f87716f877_random.jal
16f87716f877_stopwatch.jal
16f87716f877_ds18b20_single.jal
16f877a16f877a_i2c_hw_slave_msg.jal
16f877a16f877a_random.jal
16f877a16f877a_sd_card.jal
16f877a16f877a_serial_software.jal
16f877a16f877a_pata_hard_disk.jal
16f877a16f877a_backlight.jal
16f877a16f877a_stopwatch.jal
16f877a16f877a_keyboard.jal
16f877a16f877a_startersguide.jal
16f877a16f877a_lcd_dsm0822a.jal
16f877a16f877a_adc_dependent.jal
16f877a16f877a_lcd_hd44780_4bit.jal
16f877a16f877a_i2c_hw_l1.jal
16f877a16f877a_sqrt.jal
16f877a16f877a_i2c_hw_l0.jal
16f877a16f877a_23k256.jal
16f877a16f877a_serial_hw_int_cts.jal
16f877a16f877a_keyboard_lcd.jal
16f877a16f877a_ds18b20_single.jal
16f877a16f877a_i2c_hw_slave_eeprom_simulator.jal
16f877a16f877a_print_serial_numbers.jal
16f877a16f877a_i2c_sw_l1.jal
16f877a16f877a_i2c_sw_l0.jal
16f877a16f877a_co2_t6603.jal
16f877a16f877a_serial_print.jal
16f877a16f877a_serial_hardware.jal
16f877a16f877a_fat32_small_pata_hard_disk.jal
16f877a16f877a_rtc_lcd.jal
16f877a16f877a_glcd_ks0108.jal
16f877a16f877a_fat32_small_sd_card.jal
16f8816f88_adc_highres.jal
16f8816f88_i2c_hw_slave_eeprom_simulator.jal
16f8816f88_ds18b20_single.jal
16f8816f88_backlight.jal
16f8816f88_remember_me.jal
16f8816f88_startersguide.jal
16f8816f88_lcd_hd44780_4bit.jal
16f8816f88_adc_lowres.jal
16f8816f88_i2c_hw_slave_msg.jal
16f8816f88_serial_hardware.jal
16f8816f88_serial_hw_int_cts.jal
16f8816f88_sqrt.jal
16f8816f88_print_serial_numbers.jal
16f8816f88_i2c_sw_l0.jal
16f8816f88_i2c_sw_l1.jal
16f8816f88_random.jal
16f8816f88_adc_independent.jal
16f8816f88_lcd_dsm0822a.jal
16f8816f88_serial_print.jal
16f88616f886_rtc_lcd_4mhz.jal
16f88616f886_rtc_lcd_125khz.jal
16f88616f886_rtc_lcd_20mhz.jal
16f88616f886_math.jal
16f88616f886_pwm_adc_freq.jal
16f88616f886_pwm_adc_res.jal
18f14k5018f14k50_serial_hw_int_cts.jal
18f14k5018f14k50_usb_serial.jal
18f14k5018f14k50_random.jal
18f14k5018f14k50_serial_hardware.jal
18f14k5018f14k50_i2c_hw_l0.jal
18f14k5018f14k50_i2c_hw_l1.jal
18f14k5018f14k50_usb_hid_mouse.jal
18f14k5018f14k50_adc_independent.jal
18f14k5018f14k50_lcd_dsm0822a.jal
18f14k5018f14k50_sqrt.jal
18f14k5018f14k50_i2c_sw_l1.jal
18f14k5018f14k50_usb_bootloader_autostart.jal
18f14k5018f14k50_i2c_hw_slave_msg.jal
18f14k5018f14k50_i2c_sw_l0.jal
18f14k5018f14k50_startersguide.jal
18f14k5018f14k50_i2c_hw_slave_eeprom_simulator.jal
18f14k5018f14k50_usb_hid_generic.jal
18f14k5018f14k50_serial_print.jal
18f14k5018f14k50_usb_bootloader.jal
18f245018f2450_usb_hid_mouse.jal
18f245018f2450_usb_serial.jal
18f245018f2450_sqrt.jal
18f245018f2450_adc_dependent.jal
18f245018f2450_startersguide.jal
18f245018f2450_serial_hardware.jal
18f245018f2450_serial_print.jal
18f245018f2450_usb_bootloader_autostart.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_random.jal
18f245018f2450_ds18b20_single.jal
18f245018f2450_usb_bootloader.jal
18f245018f2450_serial_hw_int_cts.jal
18f245018f2450_lcd_hd44780_4bit.jal
18f245018f2450_i2c_sw_l1.jal
18f245018f2450_i2c_sw_l0.jal
18f245018f2450_lcd_dsm0822a.jal
18f258518f2585_can_monitor.jal
18f258518f2585_canid4_monitor.jal
18f258518f2585_can_serial_hw.jal
18f258518f2585_canid4_serial_adapter.jal
18f258518f2585_can_serial_adapter.jal
18f25j1018f25j10_test_mlx90615.jal
18f25k2218f25k22_eusart2.jal
18f262018f2620_rtc_tmr3.jal
18f26j1118f26j11_rtcc_hw_kbd_lcd.jal
18f27j5318f27j53_pps_rx2tx2.jal
18f45218f452_fat32_small_pata_hard_disk.jal
18f45218f452_pata_hard_disk.jal
18f45218f452_23k256.jal
18f45218f452_fat32_small_sd_card.jal
18f45218f452_sd_card.jal
18f45218f452_stopwatch.jal
18f452518f4525_fat32_sd_card.jal
18f452518f4525_sd_card.jal
18f452518f4525_mp3_decoder_vs1053b_pata_hard_disk.jal
18f452518f4525_fat32_small_pata_hard_disk.jal
18f452518f4525_pata_hard_disk.jal
18f452518f4525_fat32_pata_hard_disk.jal
18f452518f4525_stopwatch.jal
18f452518f4525_mp3_decoder_vs1053b_sd_card.jal
18f452518f4525_fat32_small_sd_card.jal
18f455018f4550_stopwatch.jal
18f455018f4550_lcd_dsm0822a.jal
18f455018f4550_lcd_hd44780_4bit.jal
18f455018f4550_i2c_sw_l0.jal
18f455018f4550_usb_bootloader_autostart.jal
18f455018f4550_i2c_hw_l1.jal
18f455018f4550_i2c_hw_l0.jal
18f455018f4550_i2c_hw_slave_msg.jal
18f455018f4550_sd_card.jal
18f455018f4550_ir2serial.jal
18f455018f4550_sqrt.jal
18f455018f4550_usb_bootloader.jal
18f455018f4550_i2c_sw_l1.jal
18f455018f4550_startersguide.jal
18f455018f4550_serial_hw_int_cts.jal
18f455018f4550_adc_dependent.jal
18f455018f4550_dynamic_adc.jal
18f455018f4550_adc.jal
18f455018f4550_serial_software.jal
18f455018f4550_i2c_hw_slave_eeprom_simulator.jal
18f455018f4550_usb_hid_generic.jal
18f455018f4550_glcd_ks0108.jal
18f455018f4550_usb_hid_mouse.jal
18f455018f4550_ds18b20_single.jal
18f455018f4550_serial_print.jal
18f455018f4550_usb_serial.jal
18f455018f4550_fat32_sd_card.jal
18f455018f4550_fat32_small_sd_card.jal
18f455018f4550_serial_hardware.jal
18f455018f4550_23k256.jal
18f455018f4550_random.jal
18f458518f4585_canid4_monitor.jal
18f462018f4620_mp3_decoder_vs1053b_sd_card.jal
18f462018f4620_glcd_touch_stm032qvt_003.jal
18f462018f4620_fat32_sd_card.jal
18f462018f4620_fat32_small_pata_hard_disk.jal
18f462018f4620_fat32_pata_hard_disk.jal
18f462018f4620_stopwatch.jal
18f462018f4620_pata_hard_disk.jal
18f462018f4620_sd_card.jal
18f462018f4620_fat32_small_sd_card.jal
18f462018f4620_mp3_decoder_vs1053b_pata_hard_disk.jal
18f631018f6310_serial_hw_int_cts.jal
18f652018f6520_serial_hw_int_cts.jal
18f67j5018f67j50_sd_card.jal
18f67j5018f67j50_fat32_sd_card.jal
18f67j5018f67j50_mp3_decoder_vs1053b_sd_card.jal
18f67j5018f67j50_fat32_small_sd_card.jal
18f67j5018f67j50_fat32_small_pata_hard_disk.jal
18f67j5018f67j50_pata_hard_disk.jal
18f67j5018f67j50_mp3_decoder_vs1053b_pata_hard_disk.jal
18f67j5018f67j50_fat32_pata_hard_disk.jal
18f67j5018f67j50_23k256.jal
18f67j5018f67j50_stopwatch.jal



profiler

profiler.jal

Author Joep Suijs, Copyright (c) 2009..2009, all rights reserved.
Adapted-by
Compiler >=2.4g

Description

   This library provides procedures to profile code parts.
   Intended for software development, uses timer1.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_sqrt.jal
16f72316f723_sqrt.jal
16f7316f73_sqrt.jal
16f87716f877_sqrt.jal
16f877a16f877a_sqrt.jal
16f8816f88_sqrt.jal
18f14k5018f14k50_sqrt.jal
18f245018f2450_sqrt.jal
18f455018f4550_sqrt.jal



pwm_ccp1

hardware PWM control, dedicated to module CCP1

Author Stef Mientki, Copyright (C) 2002-2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling.
Compiler 2.4l

Description

Performs PWM operations on the CCP1 module.
This file is automatically included by pwm_hardware.jal
when the target PIC has a CCP1 module.


Notes

1. This is a heavy refactoring of the original pwm_hardware.jal
          (Stef's lib)
       2. Partly rewritten for JalV2 version 2.4l and Jallib revision 1171.
          Reduced memory occupation. Added procedure for lowres PWM.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm1_set_percent_dutycycle(byte in percent)

    Set a percentage duty cycle, allowing max 100 PWM steps.
    Allowed range: 0..100
    The duty cycle will be set to the specified percentage of the maximum
    for the current PWM frequency.
    Note: The number of available PWM steps can be lower than 100 with
    (very) high PWM frequencies.
    Note: pin_CCP1_direction should be set to output!
    

  • pwm1_on()

    PWM mode on
    Restore duty cycle from shadow registers
    Note: pin_CCP1_direction should be set to output!
    

  • pwm1_off()

    PWM mode off
    retain duty cycle setting in shadow registers
    

  • pwm1_set_dutycycle_lowres(byte in duty)

    Set dutycycle with 8-bits resolution allowing 255 PWM steps.
    The 'duty' argument is the 8-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<7:2> are the 6 MSbits
    Allowed range: 0..255
    Beware that steps 256..1023 are not available. In other words
    the available PWM range is 25% of the highres procedure.
    This procedure is particularly suitable with higher frequencies
    whereby the PWM resolution is limited to 256 steps or less!
    

  • pwm1_set_dutycycle_highres(word in duty)

    Set dutycycle with 10-bits resolution, allowing 1024 PWM steps.
    The 'duty' argument is a (max) 10-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<9:2> are the 8 MSbits
    Allowed range: 0..1023
    Note: pin_CCP1_direction should be set to output!
    

  • pwm1_set_dutycycle(byte in duty)

    Set dutycycle for 10-bits resolution but allowing only 255 PWM steps.
    This procedure is equivalent to pwm1_set_dutycycle_highres(), but
    the low order 2 bits of the 10-bits duty cycle are set to 0.
    This means that only every 4th of the available 1023 steps can be selected
    and consequently max 255 PWM steps are available.
    This procedure is for user convenience, allowing to specify an 8 bits
    value for the duty cycle is for many applications satisfactory.
    Calling this procedure will also activate PWM.
    Note: pin_CCP1_direction should be set to output!
    

Functions


Related samples

No sample found


pwm_ccp10

hardware PWM control, dedicated to module CCP10

Author Stef Mientki, Copyright (C) 2002-2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling.
Compiler 2.4l

Description

Performs PWM operations on the CCP10 module.
This file is automatically included by pwm_hardware.jal
when the target PIC has a CCP10 module.


Notes

1. This is a heavy refactoring of the original pwm_hardware.jal
          (Stef's lib)
       2. Partly rewritten for JalV2 version 2.4l and Jallib revision 1171.
          Reduced memory occupation. Added procedure for lowres PWM.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm10_on()

    PWM mode on
    Restore duty cycle from shadow registers
    Note: pin_CCP10_direction should be set to output!
    

  • pwm10_set_dutycycle_lowres(byte in duty)

    Set dutycycle with 8-bits resolution allowing 255 PWM steps.
    The 'duty' argument is the 8-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<7:2> are the 6 MSbits
    Allowed range: 0..255
    Beware that steps 256..1023 are not available. In other words
    the available PWM range is 25% of the highres procedure.
    This procedure is particularly suitable with higher frequencies
    whereby the PWM resolution is limited to 256 steps or less!
    

  • pwm10_set_dutycycle(byte in duty)

    Set dutycycle for 10-bits resolution but allowing only 255 PWM steps.
    This procedure is equivalent to pwm10_set_dutycycle_highres(), but
    the low order 2 bits of the 10-bits duty cycle are set to 0.
    This means that only every 4th of the available 1023 steps can be selected
    and consequently max 255 PWM steps are available.
    This procedure is for user convenience, allowing to specify an 8 bits
    value for the duty cycle is for many applications satisfactory.
    Calling this procedure will also activate PWM.
    Note: pin_CCP10_direction should be set to output!
    

  • pwm10_set_dutycycle_highres(word in duty)

    Set dutycycle with 10-bits resolution, allowing 1024 PWM steps.
    The 'duty' argument is a (max) 10-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<9:2> are the 8 MSbits
    Allowed range: 0..1023
    Note: pin_CCP10_direction should be set to output!
    

  • pwm10_set_percent_dutycycle(byte in percent)

    Set a percentage duty cycle, allowing max 100 PWM steps.
    Allowed range: 0..100
    The duty cycle will be set to the specified percentage of the maximum
    for the current PWM frequency.
    Note: The number of available PWM steps can be lower than 100 with
    (very) high PWM frequencies.
    Note: pin_CCP10_direction should be set to output!
    

  • pwm10_off()

    PWM mode off
    retain duty cycle setting in shadow registers
    

Functions


Related samples

No sample found


pwm_ccp2

hardware PWM control, dedicated to module CCP2

Author Stef Mientki, Copyright (C) 2002-2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling.
Compiler 2.4l

Description

Performs PWM operations on the CCP2 module.
This file is automatically included by pwm_hardware.jal
when the target PIC has a CCP2 module.


Notes

1. This is a heavy refactoring of the original pwm_hardware.jal
          (Stef's lib)
       2. Partly rewritten for JalV2 version 2.4l and Jallib revision 1171.
          Reduced memory occupation. Added procedure for lowres PWM.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm2_set_dutycycle(byte in duty)

    Set dutycycle for 10-bits resolution but allowing only 255 PWM steps.
    This procedure is equivalent to pwm2_set_dutycycle_highres(), but
    the low order 2 bits of the 10-bits duty cycle are set to 0.
    This means that only every 4th of the available 1023 steps can be selected
    and consequently max 255 PWM steps are available.
    This procedure is for user convenience, allowing to specify an 8 bits
    value for the duty cycle is for many applications satisfactory.
    Calling this procedure will also activate PWM.
    Note: pin_CCP2_direction should be set to output!
    

  • pwm2_off()

    PWM mode off
    retain duty cycle setting in shadow registers
    

  • pwm2_set_dutycycle_lowres(byte in duty)

    Set dutycycle with 8-bits resolution allowing 255 PWM steps.
    The 'duty' argument is the 8-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<7:2> are the 6 MSbits
    Allowed range: 0..255
    Beware that steps 256..1023 are not available. In other words
    the available PWM range is 25% of the highres procedure.
    This procedure is particularly suitable with higher frequencies
    whereby the PWM resolution is limited to 256 steps or less!
    

  • pwm2_on()

    PWM mode on
    Restore duty cycle from shadow registers
    Note: pin_CCP2_direction should be set to output!
    

  • pwm2_set_dutycycle_highres(word in duty)

    Set dutycycle with 10-bits resolution, allowing 1024 PWM steps.
    The 'duty' argument is a (max) 10-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<9:2> are the 8 MSbits
    Allowed range: 0..1023
    Note: pin_CCP2_direction should be set to output!
    

  • pwm2_set_percent_dutycycle(byte in percent)

    Set a percentage duty cycle, allowing max 100 PWM steps.
    Allowed range: 0..100
    The duty cycle will be set to the specified percentage of the maximum
    for the current PWM frequency.
    Note: The number of available PWM steps can be lower than 100 with
    (very) high PWM frequencies.
    Note: pin_CCP2_direction should be set to output!
    

Functions


Related samples

No sample found


pwm_ccp3

hardware PWM control, dedicated to module CCP3

Author Stef Mientki, Copyright (C) 2002-2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling.
Compiler 2.4l

Description

Performs PWM operations on the CCP3 module.
This file is automatically included by pwm_hardware.jal
when the target PIC has a CCP3 module.


Notes

1. This is a heavy refactoring of the original pwm_hardware.jal
          (Stef's lib)
       2. Partly rewritten for JalV2 version 2.4l and Jallib revision 1171.
          Reduced memory occupation. Added procedure for lowres PWM.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm3_on()

    PWM mode on
    Restore duty cycle from shadow registers
    Note: pin_CCP3_direction should be set to output!
    

  • pwm3_set_dutycycle(byte in duty)

    Set dutycycle for 10-bits resolution but allowing only 255 PWM steps.
    This procedure is equivalent to pwm3_set_dutycycle_highres(), but
    the low order 2 bits of the 10-bits duty cycle are set to 0.
    This means that only every 4th of the available 1023 steps can be selected
    and consequently max 255 PWM steps are available.
    This procedure is for user convenience, allowing to specify an 8 bits
    value for the duty cycle is for many applications satisfactory.
    Calling this procedure will also activate PWM.
    Note: pin_CCP3_direction should be set to output!
    

  • pwm3_set_dutycycle_lowres(byte in duty)

    Set dutycycle with 8-bits resolution allowing 255 PWM steps.
    The 'duty' argument is the 8-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<7:2> are the 6 MSbits
    Allowed range: 0..255
    Beware that steps 256..1023 are not available. In other words
    the available PWM range is 25% of the highres procedure.
    This procedure is particularly suitable with higher frequencies
    whereby the PWM resolution is limited to 256 steps or less!
    

  • pwm3_set_dutycycle_highres(word in duty)

    Set dutycycle with 10-bits resolution, allowing 1024 PWM steps.
    The 'duty' argument is a (max) 10-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<9:2> are the 8 MSbits
    Allowed range: 0..1023
    Note: pin_CCP3_direction should be set to output!
    

  • pwm3_set_percent_dutycycle(byte in percent)

    Set a percentage duty cycle, allowing max 100 PWM steps.
    Allowed range: 0..100
    The duty cycle will be set to the specified percentage of the maximum
    for the current PWM frequency.
    Note: The number of available PWM steps can be lower than 100 with
    (very) high PWM frequencies.
    Note: pin_CCP3_direction should be set to output!
    

  • pwm3_off()

    PWM mode off
    retain duty cycle setting in shadow registers
    

Functions


Related samples

No sample found


pwm_ccp4

hardware PWM control, dedicated to module CCP4

Author Stef Mientki, Copyright (C) 2002-2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling.
Compiler 2.4l

Description

Performs PWM operations on the CCP4 module.
This file is automatically included by pwm_hardware.jal
when the target PIC has a CCP4 module.


Notes

1. This is a heavy refactoring of the original pwm_hardware.jal
          (Stef's lib)
       2. Partly rewritten for JalV2 version 2.4l and Jallib revision 1171.
          Reduced memory occupation. Added procedure for lowres PWM.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm4_set_dutycycle_lowres(byte in duty)

    Set dutycycle with 8-bits resolution allowing 255 PWM steps.
    The 'duty' argument is the 8-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<7:2> are the 6 MSbits
    Allowed range: 0..255
    Beware that steps 256..1023 are not available. In other words
    the available PWM range is 25% of the highres procedure.
    This procedure is particularly suitable with higher frequencies
    whereby the PWM resolution is limited to 256 steps or less!
    

  • pwm4_off()

    PWM mode off
    retain duty cycle setting in shadow registers
    

  • pwm4_on()

    PWM mode on
    Restore duty cycle from shadow registers
    Note: pin_CCP4_direction should be set to output!
    

  • pwm4_set_percent_dutycycle(byte in percent)

    Set a percentage duty cycle, allowing max 100 PWM steps.
    Allowed range: 0..100
    The duty cycle will be set to the specified percentage of the maximum
    for the current PWM frequency.
    Note: The number of available PWM steps can be lower than 100 with
    (very) high PWM frequencies.
    Note: pin_CCP4_direction should be set to output!
    

  • pwm4_set_dutycycle(byte in duty)

    Set dutycycle for 10-bits resolution but allowing only 255 PWM steps.
    This procedure is equivalent to pwm4_set_dutycycle_highres(), but
    the low order 2 bits of the 10-bits duty cycle are set to 0.
    This means that only every 4th of the available 1023 steps can be selected
    and consequently max 255 PWM steps are available.
    This procedure is for user convenience, allowing to specify an 8 bits
    value for the duty cycle is for many applications satisfactory.
    Calling this procedure will also activate PWM.
    Note: pin_CCP4_direction should be set to output!
    

  • pwm4_set_dutycycle_highres(word in duty)

    Set dutycycle with 10-bits resolution, allowing 1024 PWM steps.
    The 'duty' argument is a (max) 10-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<9:2> are the 8 MSbits
    Allowed range: 0..1023
    Note: pin_CCP4_direction should be set to output!
    

Functions


Related samples

No sample found


pwm_ccp5

hardware PWM control, dedicated to module CCP5

Author Stef Mientki, Copyright (C) 2002-2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling.
Compiler 2.4l

Description

Performs PWM operations on the CCP5 module.
This file is automatically included by pwm_hardware.jal
when the target PIC has a CCP5 module.


Notes

1. This is a heavy refactoring of the original pwm_hardware.jal
          (Stef's lib)
       2. Partly rewritten for JalV2 version 2.4l and Jallib revision 1171.
          Reduced memory occupation. Added procedure for lowres PWM.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm5_set_dutycycle_highres(word in duty)

    Set dutycycle with 10-bits resolution, allowing 1024 PWM steps.
    The 'duty' argument is a (max) 10-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<9:2> are the 8 MSbits
    Allowed range: 0..1023
    Note: pin_CCP5_direction should be set to output!
    

  • pwm5_set_dutycycle(byte in duty)

    Set dutycycle for 10-bits resolution but allowing only 255 PWM steps.
    This procedure is equivalent to pwm5_set_dutycycle_highres(), but
    the low order 2 bits of the 10-bits duty cycle are set to 0.
    This means that only every 4th of the available 1023 steps can be selected
    and consequently max 255 PWM steps are available.
    This procedure is for user convenience, allowing to specify an 8 bits
    value for the duty cycle is for many applications satisfactory.
    Calling this procedure will also activate PWM.
    Note: pin_CCP5_direction should be set to output!
    

  • pwm5_off()

    PWM mode off
    retain duty cycle setting in shadow registers
    

  • pwm5_set_dutycycle_lowres(byte in duty)

    Set dutycycle with 8-bits resolution allowing 255 PWM steps.
    The 'duty' argument is the 8-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<7:2> are the 6 MSbits
    Allowed range: 0..255
    Beware that steps 256..1023 are not available. In other words
    the available PWM range is 25% of the highres procedure.
    This procedure is particularly suitable with higher frequencies
    whereby the PWM resolution is limited to 256 steps or less!
    

  • pwm5_set_percent_dutycycle(byte in percent)

    Set a percentage duty cycle, allowing max 100 PWM steps.
    Allowed range: 0..100
    The duty cycle will be set to the specified percentage of the maximum
    for the current PWM frequency.
    Note: The number of available PWM steps can be lower than 100 with
    (very) high PWM frequencies.
    Note: pin_CCP5_direction should be set to output!
    

  • pwm5_on()

    PWM mode on
    Restore duty cycle from shadow registers
    Note: pin_CCP5_direction should be set to output!
    

Functions


Related samples

No sample found


pwm_ccp6

hardware PWM control, dedicated to module CCP6

Author Stef Mientki, Copyright (C) 2002-2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling.
Compiler 2.4l

Description

Performs PWM operations on the CCP6 module.
This file is automatically included by pwm_hardware.jal
when the target PIC has a CCP6 module.


Notes

1. This is a heavy refactoring of the original pwm_hardware.jal
          (Stef's lib)
       2. Partly rewritten for JalV2 version 2.4l and Jallib revision 1171.
          Reduced memory occupation. Added procedure for lowres PWM.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm6_set_dutycycle_highres(word in duty)

    Set dutycycle with 10-bits resolution, allowing 1024 PWM steps.
    The 'duty' argument is a (max) 10-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<9:2> are the 8 MSbits
    Allowed range: 0..1023
    Note: pin_CCP6_direction should be set to output!
    

  • pwm6_on()

    PWM mode on
    Restore duty cycle from shadow registers
    Note: pin_CCP6_direction should be set to output!
    

  • pwm6_set_dutycycle_lowres(byte in duty)

    Set dutycycle with 8-bits resolution allowing 255 PWM steps.
    The 'duty' argument is the 8-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<7:2> are the 6 MSbits
    Allowed range: 0..255
    Beware that steps 256..1023 are not available. In other words
    the available PWM range is 25% of the highres procedure.
    This procedure is particularly suitable with higher frequencies
    whereby the PWM resolution is limited to 256 steps or less!
    

  • pwm6_set_dutycycle(byte in duty)

    Set dutycycle for 10-bits resolution but allowing only 255 PWM steps.
    This procedure is equivalent to pwm6_set_dutycycle_highres(), but
    the low order 2 bits of the 10-bits duty cycle are set to 0.
    This means that only every 4th of the available 1023 steps can be selected
    and consequently max 255 PWM steps are available.
    This procedure is for user convenience, allowing to specify an 8 bits
    value for the duty cycle is for many applications satisfactory.
    Calling this procedure will also activate PWM.
    Note: pin_CCP6_direction should be set to output!
    

  • pwm6_set_percent_dutycycle(byte in percent)

    Set a percentage duty cycle, allowing max 100 PWM steps.
    Allowed range: 0..100
    The duty cycle will be set to the specified percentage of the maximum
    for the current PWM frequency.
    Note: The number of available PWM steps can be lower than 100 with
    (very) high PWM frequencies.
    Note: pin_CCP6_direction should be set to output!
    

  • pwm6_off()

    PWM mode off
    retain duty cycle setting in shadow registers
    

Functions


Related samples

No sample found


pwm_ccp7

hardware PWM control, dedicated to module CCP7

Author Stef Mientki, Copyright (C) 2002-2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling.
Compiler 2.4l

Description

Performs PWM operations on the CCP7 module.
This file is automatically included by pwm_hardware.jal
when the target PIC has a CCP7 module.


Notes

1. This is a heavy refactoring of the original pwm_hardware.jal
          (Stef's lib)
       2. Partly rewritten for JalV2 version 2.4l and Jallib revision 1171.
          Reduced memory occupation. Added procedure for lowres PWM.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm7_on()

    PWM mode on
    Restore duty cycle from shadow registers
    Note: pin_CCP7_direction should be set to output!
    

  • pwm7_set_dutycycle_lowres(byte in duty)

    Set dutycycle with 8-bits resolution allowing 255 PWM steps.
    The 'duty' argument is the 8-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<7:2> are the 6 MSbits
    Allowed range: 0..255
    Beware that steps 256..1023 are not available. In other words
    the available PWM range is 25% of the highres procedure.
    This procedure is particularly suitable with higher frequencies
    whereby the PWM resolution is limited to 256 steps or less!
    

  • pwm7_set_percent_dutycycle(byte in percent)

    Set a percentage duty cycle, allowing max 100 PWM steps.
    Allowed range: 0..100
    The duty cycle will be set to the specified percentage of the maximum
    for the current PWM frequency.
    Note: The number of available PWM steps can be lower than 100 with
    (very) high PWM frequencies.
    Note: pin_CCP7_direction should be set to output!
    

  • pwm7_off()

    PWM mode off
    retain duty cycle setting in shadow registers
    

  • pwm7_set_dutycycle_highres(word in duty)

    Set dutycycle with 10-bits resolution, allowing 1024 PWM steps.
    The 'duty' argument is a (max) 10-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<9:2> are the 8 MSbits
    Allowed range: 0..1023
    Note: pin_CCP7_direction should be set to output!
    

  • pwm7_set_dutycycle(byte in duty)

    Set dutycycle for 10-bits resolution but allowing only 255 PWM steps.
    This procedure is equivalent to pwm7_set_dutycycle_highres(), but
    the low order 2 bits of the 10-bits duty cycle are set to 0.
    This means that only every 4th of the available 1023 steps can be selected
    and consequently max 255 PWM steps are available.
    This procedure is for user convenience, allowing to specify an 8 bits
    value for the duty cycle is for many applications satisfactory.
    Calling this procedure will also activate PWM.
    Note: pin_CCP7_direction should be set to output!
    

Functions


Related samples

No sample found


pwm_ccp8

hardware PWM control, dedicated to module CCP8

Author Stef Mientki, Copyright (C) 2002-2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling.
Compiler 2.4l

Description

Performs PWM operations on the CCP8 module.
This file is automatically included by pwm_hardware.jal
when the target PIC has a CCP8 module.


Notes

1. This is a heavy refactoring of the original pwm_hardware.jal
          (Stef's lib)
       2. Partly rewritten for JalV2 version 2.4l and Jallib revision 1171.
          Reduced memory occupation. Added procedure for lowres PWM.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm8_set_dutycycle(byte in duty)

    Set dutycycle for 10-bits resolution but allowing only 255 PWM steps.
    This procedure is equivalent to pwm8_set_dutycycle_highres(), but
    the low order 2 bits of the 10-bits duty cycle are set to 0.
    This means that only every 4th of the available 1023 steps can be selected
    and consequently max 255 PWM steps are available.
    This procedure is for user convenience, allowing to specify an 8 bits
    value for the duty cycle is for many applications satisfactory.
    Calling this procedure will also activate PWM.
    Note: pin_CCP8_direction should be set to output!
    

  • pwm8_off()

    PWM mode off
    retain duty cycle setting in shadow registers
    

  • pwm8_on()

    PWM mode on
    Restore duty cycle from shadow registers
    Note: pin_CCP8_direction should be set to output!
    

  • pwm8_set_dutycycle_lowres(byte in duty)

    Set dutycycle with 8-bits resolution allowing 255 PWM steps.
    The 'duty' argument is the 8-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<7:2> are the 6 MSbits
    Allowed range: 0..255
    Beware that steps 256..1023 are not available. In other words
    the available PWM range is 25% of the highres procedure.
    This procedure is particularly suitable with higher frequencies
    whereby the PWM resolution is limited to 256 steps or less!
    

  • pwm8_set_dutycycle_highres(word in duty)

    Set dutycycle with 10-bits resolution, allowing 1024 PWM steps.
    The 'duty' argument is a (max) 10-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<9:2> are the 8 MSbits
    Allowed range: 0..1023
    Note: pin_CCP8_direction should be set to output!
    

  • pwm8_set_percent_dutycycle(byte in percent)

    Set a percentage duty cycle, allowing max 100 PWM steps.
    Allowed range: 0..100
    The duty cycle will be set to the specified percentage of the maximum
    for the current PWM frequency.
    Note: The number of available PWM steps can be lower than 100 with
    (very) high PWM frequencies.
    Note: pin_CCP8_direction should be set to output!
    

Functions


Related samples

No sample found


pwm_ccp9

hardware PWM control, dedicated to module CCP9

Author Stef Mientki, Copyright (C) 2002-2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling.
Compiler 2.4l

Description

Performs PWM operations on the CCP9 module.
This file is automatically included by pwm_hardware.jal
when the target PIC has a CCP9 module.


Notes

1. This is a heavy refactoring of the original pwm_hardware.jal
          (Stef's lib)
       2. Partly rewritten for JalV2 version 2.4l and Jallib revision 1171.
          Reduced memory occupation. Added procedure for lowres PWM.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm9_set_dutycycle(byte in duty)

    Set dutycycle for 10-bits resolution but allowing only 255 PWM steps.
    This procedure is equivalent to pwm9_set_dutycycle_highres(), but
    the low order 2 bits of the 10-bits duty cycle are set to 0.
    This means that only every 4th of the available 1023 steps can be selected
    and consequently max 255 PWM steps are available.
    This procedure is for user convenience, allowing to specify an 8 bits
    value for the duty cycle is for many applications satisfactory.
    Calling this procedure will also activate PWM.
    Note: pin_CCP9_direction should be set to output!
    

  • pwm9_set_percent_dutycycle(byte in percent)

    Set a percentage duty cycle, allowing max 100 PWM steps.
    Allowed range: 0..100
    The duty cycle will be set to the specified percentage of the maximum
    for the current PWM frequency.
    Note: The number of available PWM steps can be lower than 100 with
    (very) high PWM frequencies.
    Note: pin_CCP9_direction should be set to output!
    

  • pwm9_set_dutycycle_highres(word in duty)

    Set dutycycle with 10-bits resolution, allowing 1024 PWM steps.
    The 'duty' argument is a (max) 10-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<9:2> are the 8 MSbits
    Allowed range: 0..1023
    Note: pin_CCP9_direction should be set to output!
    

  • pwm9_on()

    PWM mode on
    Restore duty cycle from shadow registers
    Note: pin_CCP9_direction should be set to output!
    

  • pwm9_off()

    PWM mode off
    retain duty cycle setting in shadow registers
    

  • pwm9_set_dutycycle_lowres(byte in duty)

    Set dutycycle with 8-bits resolution allowing 255 PWM steps.
    The 'duty' argument is the 8-bits absolute value for the duty cycle:
     * duty<1:0> are the 2 LSbits
     * duty<7:2> are the 6 MSbits
    Allowed range: 0..255
    Beware that steps 256..1023 are not available. In other words
    the available PWM range is 25% of the highres procedure.
    This procedure is particularly suitable with higher frequencies
    whereby the PWM resolution is limited to 256 steps or less!
    

Functions


Related samples

No sample found


pwm_common

Hardware PWM control, common procedures

Author Stef Mientki, Copyright (C) 2002-2006, all rights reserved.
Adapted-by Sebastien Lelong
Compiler 2.4l

Description

This lib handles common operations on PWM, regardless the channel number.
It is used in combination with one or more pwm_ccp libraries
(eg. pwm_ccp1.jal, pwm_ccp2.jal, etc.). These libraries are included
automatically dependent of the configuration of the target PIC.


Notes

This is a heavy refactoring of the original pwm_hardware.jal (Stef's lib).


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm_max_resolution(byte in prescaler)

    Sets all(!) CCP modules for max (10-bits) PWM resolution.
    While setting maximum resolution, the Timer2 prescaler can be used to adjust
    frequency to a some extent with the Timer2 parameter value which can be either:
      * 1 : high frequency
      * 4 : medium frequency
      * 16: low frequency
    
    Below a table showing the PWM frequencies for common clock speeds and
    different Timer2 prescaler values.
    
    ||*Timer2 prescaler* ||  *4MHz*  ||  *8MHz*  || *10MHz*  ||  *20MHz*  ||
    ||    1              || 3.90 kHz || 7.81 kHz || 9.77 kHz || 19.43 kHz ||
    ||    4              ||  976  Hz || 1.95 kHz || 2.44 kHz ||  4.88 kHz ||
    ||    16             ||  244  Hz ||  488  Hz ||  610 Hz  ||  1.22 kHz ||
    
    For PICs with more than one CCP module you should realize that all CCP
    modules use Timer2 and PR2 for PWM operations. This means that the PWM
    period (frequency) of all PWM output pins is the same. Only the duty
    cycle can vary between one and another PWM pin.
    
    Set PWM to maximum resolution (for all PWM pins!).
    This implies 1 out of 3 specific PWM frequencies, depending on the Timer2
    prescaler value passed with the call. See examples in the table above,
    or use the formula in the datasheet to calculate the resulting frequency.
    

  • pwm_set_frequency(dword in freq)

    Sets all(!) CCP modules for a specific PWM frequency.
    
    The minimum and maximum allowed PWM frequencies depend on the clock speed.
    When specifying a value beyond the limits PWM will not be started.
    
    The chosen frequency may enforce a limit on the PWM resolution (number of steps).
    The application program should not specify a higher value for the duty cycle
    than this limit. When exceeding this limit the dutycycle will probably result
    in a 'weird' value.
    Only the procedure set_dutycycle_percent() is safe in this case, the other
    set_dutycycle procedures use absolute values and are not safe!
    

Functions


Related samples

No sample found


pwm_hardware

Hardware PWM control

Author Sebastien Lelong, Copyright (C) 2008-2009, all rights reserved.
Adapted-by Albert Faber, Rob Hamerling.
Compiler 2.4l

Description

Include this library if you want to use the PWM feature of the CCP module(s).
This library uses conditional compile to selectively include underlying PWM
libraries and number of PWM channels, according to the target PIC configuration.
Ex: - 16f88 has 1 PWM channel: including pwm_hardware will prepare PWM
      for 1 channel (using pwm_ccp1.jal)
    - 16f877 has 2 PWM channels: including pwm_hardware will prepare PWM
      for 2 channels (using pwm_ccp1.jal and pwm_ccp2.jal)
    - etc. for PICs with more CCP modules
Note: All used pin_CCPx_directions should be set to output by the application.



With using the PWM hardware a design choice must be made between desired
PWM frequency and desired PWM resolution (number of possible PWM steps).
Choosing maximum PWM resolution implies a relative low PWM frequency and
vice versa: a high frequency limits the number of available PWM steps.
The figures are dependent on the target clock speed.
Refer to pwm_common, pwm_ccp1, pwm_ccp2 ... etc. documentation to
understand how to use these PWM libraries.


Notes

1. Because the PWM libraries use conditional compilation and the 'alias'
   keyword, at least JalV2 compiler version 2.4l is required.
2. These libraries use the pin alias names as declared in Jallib device
   files since revision 1171, so Jallib release 0.4 is a minimum requirement.
3. Some PICs have extended CCP modules.  These will be handled by these
   PWM libraries as 'classic' CCP modules.


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

12f68312f683_pwm_adc.jal
12hv61512hv615_temperature_fan.jal
16f648a16f648a_pwm_led.jal
16f648a16f648a_pwm_led_highres.jal
16f648a16f648a_pwm_sound.jal
16f72316f723_pwm_led.jal
16f72316f723_pwm_sound.jal
16f72316f723_pwm_led_highres.jal
16f7316f73_pwm_led_highres.jal
16f7316f73_pwm_led.jal
16f7316f73_pwm_sound.jal
16f7316f73_pwm2.jal
16f76716f767_pwm_adc.jal
16f87716f877_pwm_led.jal
16f87716f877_pwm_sound.jal
16f87716f877_pwm2.jal
16f87716f877_pwm_led_highres.jal
16f877a16f877a_pwm_led_highres.jal
16f877a16f877a_pwm_led.jal
16f877a16f877a_pwm_sound.jal
16f877a16f877a_pwm2.jal
16f8816f88_ir_ranger_gp2d02.jal
16f8816f88_pwm_sound.jal
16f8816f88_pwm_led_highres.jal
16f8816f88_pwm_led.jal
16f88616f886_pwm_adc_freq.jal
16f88616f886_pwm_adc_res.jal
18f14k5018f14k50_pwm_sound.jal
18f14k5018f14k50_pwm_led.jal
18f14k5018f14k50_pwm_led_highres.jal
18f245018f2450_pwm_led_highres.jal
18f245018f2450_pwm_sound.jal
18f245018f2450_pwm_led.jal
18f455018f4550_pwm_led_highres.jal
18f455018f4550_pwm_sound.jal
18f455018f4550_pwm_led.jal



queue01

queue01 - fifo queue (number 01 is the template)

Author Joep Suijs, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides a (one) byte fifo queue. 
This queue is interrupt-safe in the sense that you can write to the queue from the interrupt and
read from the main program or vice versa without special precautions.
Reading (or writing) from both interrupt and main program might not work properly.



The basic interface is pseudo var:
queue01 = x -- put x into queue; block if queue is full
x = queue01 -- read x from queue; block if queue is empty



non-blocking access to the same queue is provided by
queue01_nb_put()
and
queue01_nb_get()



other methods:
queue01_clear()    -- clear queue (makes queue empty)
queue01_empty()    -- returns true if queue is emtpy (depricated, use queue1_is_empty())
queue01_is_empty() -- returns true if queue is emtpy 
queue01_is_full()  -- returns true if queue is full
queue01_nr_free()  -- returns nr of free places in queue
queue01_nr_used()  -- returns nr of used places in queue


       
Option:
const queue01_element_size = n ; define Queue elements are n bytes wide (default is one byte)


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f72316f723_i2c_hw_slave_eeprom_simulator.jal
16f7316f73_i2c_hw_slave_eeprom_simulator.jal
16f87716f877_i2c_hw_slave_eeprom_simulator.jal
16f877a16f877a_i2c_hw_slave_eeprom_simulator.jal
16f8816f88_i2c_hw_slave_eeprom_simulator.jal
18f14k5018f14k50_i2c_hw_slave_eeprom_simulator.jal
18f455018f4550_i2c_hw_slave_eeprom_simulator.jal



queue02

queue02 - fifo queue (number 01 is the template)

Author Joep Suijs, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides a (one) byte fifo queue. 
This queue is interrupt-safe in the sense that you can write to the queue from the interrupt and
read from the main program or vice versa without special precautions.
Reading (or writing) from both interrupt and main program might not work properly.



The basic interface is pseudo var:
queue02 = x -- put x into queue; block if queue is full
x = queue02 -- read x from queue; block if queue is empty



non-blocking access to the same queue is provided by
queue02_nb_put()
and
queue02_nb_get()



other methods:
queue02_clear()    -- clear queue (makes queue empty)
queue02_empty()    -- returns true if queue is emtpy (depricated, use queue1_is_empty())
queue02_is_empty() -- returns true if queue is emtpy 
queue02_is_full()  -- returns true if queue is full
queue02_nr_free()  -- returns nr of free places in queue
queue02_nr_used()  -- returns nr of used places in queue


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


queue03

queue03 - fifo queue (number 01 is the template)

Author Joep Suijs, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides a (one) byte fifo queue. 
This queue is interrupt-safe in the sense that you can write to the queue from the interrupt and
read from the main program or vice versa without special precautions.
Reading (or writing) from both interrupt and main program might not work properly.



The basic interface is pseudo var:
queue03 = x -- put x into queue; block if queue is full
x = queue03 -- read x from queue; block if queue is empty



non-blocking access to the same queue is provided by
queue03_nb_put()
and
queue03_nb_get()



other methods:
queue03_clear()    -- clear queue (makes queue empty)
queue03_empty()    -- returns true if queue is emtpy (depricated, use queue1_is_empty())
queue03_is_empty() -- returns true if queue is emtpy 
queue03_is_full()  -- returns true if queue is full
queue03_nr_free()  -- returns nr of free places in queue
queue03_nr_used()  -- returns nr of used places in queue


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


queue04

queue04 - fifo queue (number 01 is the template)

Author Joep Suijs, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides a (one) byte fifo queue. 
This queue is interrupt-safe in the sense that you can write to the queue from the interrupt and
read from the main program or vice versa without special precautions.
Reading (or writing) from both interrupt and main program might not work properly.



The basic interface is pseudo var:
queue04 = x -- put x into queue; block if queue is full
x = queue04 -- read x from queue; block if queue is empty



non-blocking access to the same queue is provided by
queue04_nb_put()
and
queue04_nb_get()



other methods:
queue04_clear()    -- clear queue (makes queue empty)
queue04_empty()    -- returns true if queue is emtpy (depricated, use queue1_is_empty())
queue04_is_empty() -- returns true if queue is emtpy 
queue04_is_full()  -- returns true if queue is full
queue04_nr_free()  -- returns nr of free places in queue
queue04_nr_used()  -- returns nr of used places in queue


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


queue05

queue05 - fifo queue (number 01 is the template)

Author Joep Suijs, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides a (one) byte fifo queue. 
This queue is interrupt-safe in the sense that you can write to the queue from the interrupt and
read from the main program or vice versa without special precautions.
Reading (or writing) from both interrupt and main program might not work properly.



The basic interface is pseudo var:
queue05 = x -- put x into queue; block if queue is full
x = queue05 -- read x from queue; block if queue is empty



non-blocking access to the same queue is provided by
queue05_nb_put()
and
queue05_nb_get()



other methods:
queue05_clear()    -- clear queue (makes queue empty)
queue05_empty()    -- returns true if queue is emtpy (depricated, use queue1_is_empty())
queue05_is_empty() -- returns true if queue is emtpy 
queue05_is_full()  -- returns true if queue is full
queue05_nr_free()  -- returns nr of free places in queue
queue05_nr_used()  -- returns nr of used places in queue


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


queue06

queue06 - fifo queue (number 01 is the template)

Author Joep Suijs, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides a (one) byte fifo queue. 
This queue is interrupt-safe in the sense that you can write to the queue from the interrupt and
read from the main program or vice versa without special precautions.
Reading (or writing) from both interrupt and main program might not work properly.



The basic interface is pseudo var:
queue06 = x -- put x into queue; block if queue is full
x = queue06 -- read x from queue; block if queue is empty



non-blocking access to the same queue is provided by
queue06_nb_put()
and
queue06_nb_get()



other methods:
queue06_clear()    -- clear queue (makes queue empty)
queue06_empty()    -- returns true if queue is emtpy (depricated, use queue1_is_empty())
queue06_is_empty() -- returns true if queue is emtpy 
queue06_is_full()  -- returns true if queue is full
queue06_nr_free()  -- returns nr of free places in queue
queue06_nr_used()  -- returns nr of used places in queue


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


queue07

queue07 - fifo queue (number 01 is the template)

Author Joep Suijs, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides a (one) byte fifo queue. 
This queue is interrupt-safe in the sense that you can write to the queue from the interrupt and
read from the main program or vice versa without special precautions.
Reading (or writing) from both interrupt and main program might not work properly.



The basic interface is pseudo var:
queue07 = x -- put x into queue; block if queue is full
x = queue07 -- read x from queue; block if queue is empty



non-blocking access to the same queue is provided by
queue07_nb_put()
and
queue07_nb_get()



other methods:
queue07_clear()    -- clear queue (makes queue empty)
queue07_empty()    -- returns true if queue is emtpy (depricated, use queue1_is_empty())
queue07_is_empty() -- returns true if queue is emtpy 
queue07_is_full()  -- returns true if queue is full
queue07_nr_free()  -- returns nr of free places in queue
queue07_nr_used()  -- returns nr of used places in queue


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


queue08

queue08 - fifo queue (number 01 is the template)

Author Joep Suijs, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides a (one) byte fifo queue. 
This queue is interrupt-safe in the sense that you can write to the queue from the interrupt and
read from the main program or vice versa without special precautions.
Reading (or writing) from both interrupt and main program might not work properly.



The basic interface is pseudo var:
queue08 = x -- put x into queue; block if queue is full
x = queue08 -- read x from queue; block if queue is empty



non-blocking access to the same queue is provided by
queue08_nb_put()
and
queue08_nb_get()



other methods:
queue08_clear()    -- clear queue (makes queue empty)
queue08_empty()    -- returns true if queue is emtpy (depricated, use queue1_is_empty())
queue08_is_empty() -- returns true if queue is emtpy 
queue08_is_full()  -- returns true if queue is full
queue08_nr_free()  -- returns nr of free places in queue
queue08_nr_used()  -- returns nr of used places in queue


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


random

random

Author Joep Suijs, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4i

Description

this library provides a (decent) random function.
The formula is provided by *the* George Marsaglia.
(see http://coding.derkeiler.com/Archive/C_CPP/comp.lang.c/2008-03/msg03691.html) 



/* initialize with any 32-bit seed x and any 32-bit y not 0 */
static unsigned long x=2282008, y=362436069;
#define sK ( x=69069*x+123, y^=y<<13, y^=y>>17, y^=y<<5, x+y )



function random_byte returns an 8-bit random number
function random_word returns a 16-bit random number
functon dice         returns a number from 1 to 6



Note: this library will recreate the same sequence. If this is undesired, assign a
      different (non-zero!) startup-value to _rndx and/or _rndy at startup.



Note2: If you don't care about random quality and want to save a few processor cycles or
       memory bytes, define random_downgrade to select a basic random algorithm.


Sources

Interface Copyright (C) 2005 Stef Mientki


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_random.jal
16f72316f723_random.jal
16f7316f73_random.jal
16f87716f877_glcd_ks0108.jal
16f87716f877_random.jal
16f877a16f877a_glcd_ks0108.jal
16f877a16f877a_random.jal
16f8816f88_random.jal
18f14k5018f14k50_random.jal
18f245018f2450_random.jal
18f455018f4550_glcd_ks0108.jal
18f455018f4550_random.jal



rtc_isr_tmr0

Real Time Clock running from ISR on TMR0

Author Eur van Andel, Copyright (c) 2003..2008, all rights reserved.
Adapted-by Rob Hamerling
Compiler 2.4l

Description

This Interrupt Service Routine updates the variable seconds
about once per second. The precision is 0.2 ppm, the accuracy depends
on the Xtal used.


Sources

http://www.romanblack.com/one_sec.htm
         http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm


Notes

This is the Bresenham Line Algorithm, invented at IBM in 1962,
which gets an accurate end result by summing the small errors resulting of
taking discrete steps and correcting when the error gets too large. This
means that individual second lengths may show some jitter, but that long-term
timekeeping is accurate. Original assembler by Roman Black.
.
At 20 MHz, so 200ns/clock, so 5 000 000 clocks/second
Rhe RTC has three bytes: bres_hi, bres_mid, bres_lo
timer 0 runs on internal clock speed and interrupts on overflow
every timer 0 interrupt decreases bres_mid by one.
The  5 000 000 value is added when bres_hi en bres_mid are zero
note that remainder is added to bres_lo, which can overflow in bres_mid
this keeps clock count accurate, although interrupts happen every 256 clock
counts the ISR subtracts 1 from the mid byte. It first checks
the mid byte for zero and borrows a bit from bres_hi if needed.
.
Required PIC settings: T0CON_PSA = 1
                       T0CON_PS = 0
                       T0CON_T0CS = 0   -- Timer0 on instruction cycle clock


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • RTC()

    No documentation found

Functions


Related samples

Here are the list of samples which use this library:

16f876a16f876a_rtc_lcd.jal
16f877a16f877a_rtc_lcd.jal
16f88616f886_rtc_lcd_4mhz.jal
16f88616f886_rtc_lcd_20mhz.jal
16f88616f886_rtc_lcd_125khz.jal



rtc_isr_tmr3

Real Time Clock running from ISR on TMR3

Author Eur van Andel, Copyright (c) 2010, all rights reserved.
Adapted-by
Compiler 2.4m

Description

This Interrupt Service Routine updates the variable seconds
about once per second. The precision is 0.2 ppm, the accuracy depends
on the Xtal used. The main program should check if seconds are > 60 and
if so, increase minutes, hours, days, months, etc. calendar.jal does this


Sources

http://www.romanblack.com/one_sec.htm
         http://en.wikipedia.org/wiki/Bresenham%27s_line_algorithm


Notes

This is the Bresenham Line Algorithm, invented at IBM in 1962,
which gets an accurate end result by summing the small errors resulting of
taking discrete steps and correcting when the error gets too large. This
means that individual second lengths may show some jitter, but that long-term
timekeeping is accurate. 
.
For instance: if xtal=20 MHz, then 5 MHz clock, so 5 000 000 clocks/second
TMR3 runs on internal clock speed and interrupts on overflow
every TMR3 interrupt decreases _rtc_bresenham by 0x1_00_00, or 2^16
if _rts_bresenham < 0x1_00_00 then 5_000_000 is added
so the jitter is 2^15/5e6 = 0.6%
Total second count is accurate, since the lower 15 bits stay intact and add up
.
This RTC runs on TMR3. You must setup TMR3 yourself in the main program.
prescaler = 1, internal clock, TMR3 = on
TMR3IE = on, INTCON_GIE = on
A typical setup looks for a PIC18F look like this:
.
T3CON_T3CKPS   = 0b00      -- 1:1 prescaler
T3CON_TMR3_ON  = on        -- TMR3 on
.
PIE2_TMR3IE    = on        -- TMR3 interrupt enabled
IPR_TMR3IP     = on        -- high priority interrupt for TMR3 (default on)
RCON_IPEN      = off       -- no interrupt priorities (default off)
INTCON_PEIE    = on        -- peripheral interrupt enabled
INTCON_GIE     = on        -- global interrupt enabled


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • RTC()

    No documentation found

Functions


Related samples

Here are the list of samples which use this library:

18f262018f2620_rtc_tmr3.jal



rtcc_hw

Support for builtin RealTimeClockCalendar (RTCC) module of 18FxxJxx.

Author Rob Hamerling, Copyright (c) 2010..2011, all rights reserved.
Adapted-by
Compiler 2.4n

Description

RealTimeClock support:
  - routines for control of realtime clock and alarm
.
This library supports:
  - RTCC modules like in 18fxxj11, 18fxxj50 and several other PICs.
.
Available procedures and functions for application programs
(not all of these may be implemented yet!).
.
Time/clock related operations:
  - rtc_set_clock()              -- enable/disable RTCC module
  - rtc_calibrate()              -- compensate crystal frequency aberration
  - rtc_pin_signal()             -- RTCC output pin signal control
  - rtc_get_date()               -- year,month,day (bcd)
  - rtc_set_date()
  - rtc_get_time()               -- hour,minute,second (bcd)
  - rtc_set_time()
  - rtc_get_secondofday()        -- second of day (binary)
  - rtc_get_minuteofday()        -- minute of day (binary)
  - rtc_get_dayofweek()          -- day of week number (binary)
  - rtc_get_dayofmonth()         -- day of month (binary)
  - rtc_get_dayofyear()          -- day of year (binary)
.
Alarm related operations:
  - rtc_set_alarm()              -- enable/disable alarm
  - rtc_get_alarm_date()         -- alarm month,day (bcd), no year!
  - rtc_set_alarm_date()
  - rtc_get_alarm_time()         -- alarm hour,minute,second (bcd)
  - rtc_set_alarm_time()
  - rtc_set_alarm_dayofweek()
  - rtc_set_alarm_interval()     -- alarm interval (binary)
  - rtc_set_alarm_repeat()       -- alarm repeat (binary)
.
General purpose functions and procedures:
  - bcd2bin()                   -- convert byte from bcd to binary
  - mult60()                    -- hours -> minutes; minutes -> seconds
.
The RTCC uses bcd notation for year, month, day, hour, minute and
second (all of these are byte variables).
.
Bytes in bcd-notation can easily be displayed with print_byte_hex()
of the Jallib print library.
.
For the compare of dates and times (for smaller or larger) the
library provides some functions which return binary values for
minute or second of the day, day of the week, day of the month
and day of the year.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • rtc_calibrate(sbyte in calibration)

    Calibrate the RTCC module.
    input: calibration value
    output: none
    returns: nothing
    note: Calibration value is a signed byte  (-128..+127).
          A negative value must be specified when the crystal is too fast.
          See datasheet for the calculation of the amount.
    
    

  • rtc_set_alarm_interval(byte in interval)

    Set alarm interval.
    input: alarm_interval with a RTC_ALARM_INTERVAL_xxxx mask
           (see the defined RTC_ALARM_INTERVAL_xxxx masks above)
    output: none
    returns: nothing
    
    

  • rtc_set_alarm_dayofweek(byte in weekday)

    Set alarm time.
    input: day-of-week of alarm (binary, 0..6)
    output: none
    returns: nothing
    Notes: When setting the alarm date the alarm interval is
           by default set to once a week on the specified day of the week.
           You may want to set the alarm time first, or control the
           alarm interval separately.
    
    

  • rtc_set_alarm(bit in state)

    Enable or disable alarm.
    input: alarm_state (bit): true  - enable alarm
                              false - disable alarm
    output: none
    returns: nothing
    
    

  • rtc_set_alarm_repeat(byte in repeats)

    Set alarm repetition.
    input: repeats: number of times to repeat alarm signal (binary)
    output: none
    returns: nothing
    notes: The following will happen after an alarm condition:
           - with repeat value 0 there will be 1 alarm event
           - with repeat values 1..254 there will be as many more alarm
             events as specified with 
             (at intervals as specified with rtc_set_alarm_interval() )
           - with repeat value 255 there will be indefinite alarm events
           The ALRMCFG_ALRMEN bit will be cleared after the last alarm event
           (thus never with repeat value 255).
    
    

  • rtc_pin_signal(bit*2 in pin_signal_selection_mask)

    Select the RTCC output pin signal functionality.
    input: 2-bits mask: one of the RTC_PIN_xxxx constants (see above)
    output: none
    returns: nothing
    notes: - With 'NONE' pin_RTCC is released and available for I/O
           - See the datasheet for the meaning of the different masks.
    
    

  • rtc_set_clock(bit in state)

    Enable or disable the RTCC module.
    input: none
    output: none
    returns: nothing
    notes: The T1 oscillator is enable/disabled too!
    
    

Private
  • _rtc_read()

    Read the realtime clock.
    input:  none
    output: none
    returns: nothing
    notes: read clock/calendar registers into local variables
    
    

  • _rtc_write_control(bit in control)

    Enable or disable RTCC register writes.
    input: bit (enable / disable)
    output: none
    returns: nothing
    notes:  (Re)setting the RTCWREN bit in RTCCFG requires a strict
            sequence, see datasheets for details.
            JalV2 2.4n and 2.4o(beta) generate the correct sequences
            with the code below.
    
    

  • _rtc_write()

    Write the realtime clock.
    input:  none
    output: none
    returns: nothing
    notes: - enable writing to RTC registers
           - write clock/calendar registers
           - disable writes
    
    

  • _rtc_alrm_read()

    Read the alarm setting.
    input:  none
    output: none
    returns: nothing
    notes: read alarm registers into local variables
    
    

  • _rtc_alrm_write()

    Write the alarm time of realtime clock.
    input:  none
    output: none
    returns: nothing
    notes: - disable alarm
           - write alarm registers from local variables
           - restore alarm state
    
    


Functions

  • mult60(word in x) return dword

    Multiply a word by 60 (typically for minutes to seconds or hours to minutes)
    input:   byte with binary data
    output:  none
    returns: word with product
    notes: - (x * 60) -> x * (64 - 4) -> (x * 64) - (x * 4)
           - algorithm without multiplication
           - word as input, dword as returnvalue chosen for
             relative second of day (function rtc_hhmmss_bin())
    
    

  • rtc_get_dayofweek() return byte

    Get day of week.
    input: none
    output: none
    returns: day of the week (binary byte 0..6)
    
    

  • rtc_get_dayofyear() return word

    Get day of year.
    input: none
    output: none
    returns: number of days sinece 1st of January (binary word 0..365)
    
    

  • rtc_get_minuteofday() return word

    Get minute of day.
    input: none
    output: none
    returns: number of minutes since midnight (binary word)
    
    

  • bcd2bin(byte in bcd) return byte

    ======================================================================
     General purpose functions / procedures
    ======================================================================
    
    Convert one byte packed bcd to one byte binary.
    input:   byte with bcd data
    output:  none
    returns: byte with binary value of bcd byte
    notes: - A byte in bcd notation contains ((16 * tens) + ones).
             To convert it to a binary value: subtract (6 * tens)
             Algorithm is modeled after an assembler version of
             Scott Dattalo at PicList (but slightly less efficient!).
    
    

  • rtc_get_secondofday() return dword

    Get second of day.
    input: none
    output: none
    returns: number of seconds since midnight (binary dword)
    
    

  • rtc_get_dayofmonth() return byte

    Get day of month.
    input: none
    output: none
    returns: number of days since 1st of the month (binary byte 0..30)
    
    


Related samples

Here are the list of samples which use this library:

18f26j1118f26j11_rtcc_hw_kbd_lcd.jal
18f27j5318f27j53_rtcc_hw_alarm.jal



sd_card

Library for communicating with SD memory cards

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4n

Description

this library provides functions for SD memory cards.


Sources

SanDisk Secure Digital Card - http://www.cs.ucr.edu/~amitra/sdcard/ProdManualSDCardv1.9.pdf
How to use MMC/SDC - http://forums.parallax.com/forums/attach.aspx?a=32012


Notes

SD card SPI mode is 1,1


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

16f87716f877_fat32_small_sd_card.jal
16f87716f877_sd_card.jal
16f877a16f877a_sd_card.jal
16f877a16f877a_fat32_small_sd_card.jal
18f45218f452_fat32_small_sd_card.jal
18f45218f452_sd_card.jal
18f452518f4525_fat32_small_sd_card.jal
18f452518f4525_sd_card.jal
18f452518f4525_fat32_sd_card.jal
18f452518f4525_mp3_decoder_vs1053b_sd_card.jal
18f455018f4550_fat32_sd_card.jal
18f455018f4550_fat32_small_sd_card.jal
18f455018f4550_sd_card.jal
18f462018f4620_mp3_decoder_vs1053b_sd_card.jal
18f462018f4620_sd_card.jal
18f462018f4620_fat32_sd_card.jal
18f462018f4620_fat32_small_sd_card.jal
18f67j5018f67j50_sd_card.jal
18f67j5018f67j50_fat32_small_sd_card.jal
18f67j5018f67j50_mp3_decoder_vs1053b_sd_card.jal
18f67j5018f67j50_fat32_sd_card.jal



serial_hardware

USART hardware control

Author Stef Mientki, Copyright (c) 2002..2006, all rights reserved.
Adapted-by Sebastien Lelong.
Compiler >=2.4g

Description

USART hardware control.
Routines for sending and receiving through the PIC-usart,
both asynchrone and synchrone are supported.
Baudrate can simply be set through a human constant,
because the baudrate depending registers are calculated by this unit.
Baudrate is calculated, starting at the high baudrate flag,
which will ensure the highest possible accuracy.


Dependencies


Summary

Global variables/contants

Procedures

Functions

Private

API details

Global variables/contants

Procedures

  • serial_hw_data'put(byte in data)

    Here Serial read and write are definied as pseudo variables
    so you use them as normal vars, like
     * wait for character being received,
     * then echo the inverted character
    {{{
    serial_hw_data = ! serial_hw_data
    }}}
    these procedures will wait till they can perform their action
    therefore it's better to use to following construct
    {{{
     if charater received, echo the inverted character
    if  serial_hw_data_available then
        serial_hw_data = ! serial_hw_data
    end if
     do other things
    }}}
    

  • serial_hw_init()

    Initializes the serial port, calculates baudrate registers.
    

  • serial_hw_write_word(word in data)

    like Serial_H_write, but then with a word as input
    The MSB is outputed first
    

  • serial_hw_write(byte in data)

    serial_hw_write - write char to serial port, blocking
    
    Asynchronuous serial send routine, using the TX pin
    Sends byte X (8 bit with no parity) to the serial port
    First checks (and waits if necessary) if transmit buffer is empty
    
    

  • serial_hw_data_raw'put(byte in data)

    These are real raw procedures, declared as pseudo variables
    the user is totally responsible for testing the transmit/receive
    flag before using these functions
    

  • serial_hw_enable()

    Enables USART
    

  • serial_hw_disable()

    Disables USART so ports can be used (temporary) for other purposes.
    USART can be enabled again by calling serial_hw_enable()
    

Functions

Private
  • _serial_hw_read(byte out data) return bit

    _serial_hw_read - internal use only!
    
    (using this inline function for serial_hw_data'get saves a stack level)
    Returns true if a character was received, otherwise returns false.
    Overrun error flag is cleared.
    
    



Related samples

Here are the list of samples which use this library:

16f648a16f648a_startersguide.jal
16f648a16f648a_serial_print.jal
16f648a16f648a_serial_format.jal
16f648a16f648a_serial_hardware.jal
16f648a16f648a_i2c_sw_master_echo.jal
16f648a16f648a_i2c_sw_l1.jal
16f648a16f648a_sqrt.jal
16f648a16f648a_i2c_sw_l0.jal
16f648a16f648a_lcd_dsm0822a.jal
16f648a16f648a_random.jal
16f72316f723_lcd_dsm0822a.jal
16f72316f723_serial_print.jal
16f72316f723_i2c_sw_master_echo.jal
16f72316f723_i2c_hw_slave_msg.jal
16f72316f723_sqrt.jal
16f72316f723_adc_independent.jal
16f72316f723_random.jal
16f72316f723_i2c_sw_l0.jal
16f72316f723_serial_format.jal
16f72316f723_i2c_sw_l1.jal
16f72316f723_startersguide.jal
16f72316f723_serial_hardware.jal
16f72316f723_i2c_hw_slave_eeprom_simulator.jal
16f7316f73_i2c_sw_master_echo.jal
16f7316f73_serial_print.jal
16f7316f73_startersguide.jal
16f7316f73_adc_dependent.jal
16f7316f73_random.jal
16f7316f73_lcd_dsm0822a.jal
16f7316f73_i2c_sw_l0.jal
16f7316f73_i2c_hw_slave_msg.jal
16f7316f73_serial_hardware.jal
16f7316f73_i2c_hw_slave_eeprom_simulator.jal
16f7316f73_i2c_sw_l1.jal
16f7316f73_sqrt.jal
16f7316f73_serial_format.jal
16f7716f77_adc_lowres.jal
16f876a16f876a_adc.jal
16f876a16f876a_t6603.jal
16f87716f877_i2c_sw_l1.jal
16f87716f877_glcd_ks0108.jal
16f87716f877_serial_format.jal
16f87716f877_i2c_sw_l0.jal
16f87716f877_lcd_dsm0822a.jal
16f87716f877_i2c_hw_slave_eeprom_simulator.jal
16f87716f877_adc_dependent.jal
16f87716f877_sqrt.jal
16f87716f877_keyboard.jal
16f87716f877_serial_print.jal
16f87716f877_serial_hardware.jal
16f87716f877_24lc256.jal
16f87716f877_adc.jal
16f87716f877_startersguide.jal
16f87716f877_fat32_small_sd_card.jal
16f87716f877_i2c_sw_master_echo.jal
16f87716f877_fat32_small_pata_hard_disk.jal
16f87716f877_i2c_hw_l0.jal
16f87716f877_pata_hard_disk.jal
16f87716f877_i2c_hw_slave_msg.jal
16f87716f877_sd_card.jal
16f87716f877_random.jal
16f87716f877_stopwatch.jal
16f87716f877_i2c_hw_l1.jal
16f877a16f877a_i2c_hw_slave_msg.jal
16f877a16f877a_random.jal
16f877a16f877a_sd_card.jal
16f877a16f877a_i2c_hw_l1.jal
16f877a16f877a_pata_hard_disk.jal
16f877a16f877a_i2c_hw_l0.jal
16f877a16f877a_serial_format.jal
16f877a16f877a_stopwatch.jal
16f877a16f877a_keyboard.jal
16f877a16f877a_startersguide.jal
16f877a16f877a_lcd_dsm0822a.jal
16f877a16f877a_adc_dependent.jal
16f877a16f877a_sqrt.jal
16f877a16f877a_23k256.jal
16f877a16f877a_i2c_hw_slave_eeprom_simulator.jal
16f877a16f877a_24lc256.jal
16f877a16f877a_i2c_sw_l1.jal
16f877a16f877a_i2c_sw_l0.jal
16f877a16f877a_serial_print.jal
16f877a16f877a_co2_t6603.jal
16f877a16f877a_serial_hardware.jal
16f877a16f877a_fat32_small_sd_card.jal
16f877a16f877a_fat32_small_pata_hard_disk.jal
16f877a16f877a_glcd_ks0108.jal
16f877a16f877a_print_serial_numbers.jal
16f877a16f877a_i2c_sw_master_echo.jal
16f8816f88_adc_highres.jal
16f8816f88_i2c_hw_slave_eeprom_simulator.jal
16f8816f88_delay_basic.jal
16f8816f88_ir_ranger_gp2d02.jal
16f8816f88_serial_hw_echo.jal
16f8816f88_i2c_sw_l0.jal
16f8816f88_remember_me.jal
16f8816f88_startersguide.jal
16f8816f88_i2c_sw_master_echo.jal
16f8816f88_print_serial_numbers.jal
16f8816f88_serial_format.jal
16f8816f88_adc_lowres.jal
16f8816f88_i2c_hw_slave_msg.jal
16f8816f88_serial_hardware.jal
16f8816f88_sqrt.jal
16f8816f88_i2c_sw_l1.jal
16f8816f88_random.jal
16f8816f88_adc_independent.jal
16f8816f88_lcd_dsm0822a.jal
16f8816f88_serial_print.jal
16f88616f886_math.jal
18f14k5018f14k50_i2c_sw_master_echo.jal
18f14k5018f14k50_random.jal
18f14k5018f14k50_usb_hid_mouse.jal
18f14k5018f14k50_usb_bootloader_autostart.jal
18f14k5018f14k50_serial_hardware.jal
18f14k5018f14k50_i2c_hw_l0.jal
18f14k5018f14k50_i2c_hw_l1.jal
18f14k5018f14k50_adc_independent.jal
18f14k5018f14k50_lcd_dsm0822a.jal
18f14k5018f14k50_sqrt.jal
18f14k5018f14k50_i2c_sw_l1.jal
18f14k5018f14k50_i2c_hw_slave_msg.jal
18f14k5018f14k50_i2c_sw_l0.jal
18f14k5018f14k50_serial_format.jal
18f14k5018f14k50_startersguide.jal
18f14k5018f14k50_i2c_hw_slave_eeprom_simulator.jal
18f14k5018f14k50_usb_hid_generic.jal
18f14k5018f14k50_serial_print.jal
18f14k5018f14k50_usb_bootloader.jal
18f245018f2450_usb_hid_mouse.jal
18f245018f2450_adc_dependent.jal
18f245018f2450_sqrt.jal
18f245018f2450_usb_bootloader_autostart.jal
18f245018f2450_serial_hardware.jal
18f245018f2450_serial_print.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_random.jal
18f245018f2450_i2c_sw_master_echo.jal
18f245018f2450_usb_bootloader.jal
18f245018f2450_serial_format.jal
18f245018f2450_i2c_sw_l1.jal
18f245018f2450_startersguide.jal
18f245018f2450_i2c_sw_l0.jal
18f245018f2450_lcd_dsm0822a.jal
18f258518f2585_can_serial_hw.jal
18f25k2218f25k22_i2c_sw_master_echo.jal
18f25k2218f25k22_i2c_hw_master_echo.jal
18f45218f452_24lc256.jal
18f45218f452_fat32_small_pata_hard_disk.jal
18f45218f452_pata_hard_disk.jal
18f45218f452_23k256.jal
18f45218f452_fat32_small_sd_card.jal
18f45218f452_sd_card.jal
18f45218f452_bit_array.jal
18f45218f452_stopwatch.jal
18f45218f452_large_array.jal
18f452518f4525_fat32_sd_card.jal
18f452518f4525_24lc256.jal
18f452518f4525_bit_array.jal
18f452518f4525_sd_card.jal
18f452518f4525_mp3_decoder_vs1053b_pata_hard_disk.jal
18f452518f4525_large_array.jal
18f452518f4525_fat32_small_pata_hard_disk.jal
18f452518f4525_pata_hard_disk.jal
18f452518f4525_fat32_pata_hard_disk.jal
18f452518f4525_stopwatch.jal
18f452518f4525_mp3_decoder_vs1053b_sd_card.jal
18f452518f4525_fat32_small_sd_card.jal
18f455018f4550_stopwatch.jal
18f455018f4550_usb_bootloader.jal
18f455018f4550_lcd_dsm0822a.jal
18f455018f4550_usb_bootloader_autostart.jal
18f455018f4550_i2c_hw_l1.jal
18f455018f4550_i2c_hw_l0.jal
18f455018f4550_dynamic_adc.jal
18f455018f4550_i2c_sw_l0.jal
18f455018f4550_large_array.jal
18f455018f4550_i2c_hw_slave_msg.jal
18f455018f4550_i2c_sw_l1.jal
18f455018f4550_adc_dependent.jal
18f455018f4550_startersguide.jal
18f455018f4550_adc.jal
18f455018f4550_serial_format.jal
18f455018f4550_sqrt.jal
18f455018f4550_i2c_hw_slave_eeprom_simulator.jal
18f455018f4550_usb_hid_generic.jal
18f455018f4550_glcd_ks0108.jal
18f455018f4550_24lc256.jal
18f455018f4550_usb_hid_mouse.jal
18f455018f4550_serial_print.jal
18f455018f4550_debug.jal
18f455018f4550_serial_hardware.jal
18f455018f4550_i2c_sw_master_echo.jal
18f455018f4550_random.jal
18f455018f4550_bit_array.jal
18f462018f4620_mp3_decoder_vs1053b_sd_card.jal
18f462018f4620_bit_array.jal
18f462018f4620_fat32_sd_card.jal
18f462018f4620_fat32_small_pata_hard_disk.jal
18f462018f4620_fat32_pata_hard_disk.jal
18f462018f4620_stopwatch.jal
18f462018f4620_24lc256.jal
18f462018f4620_pata_hard_disk.jal
18f462018f4620_large_array.jal
18f462018f4620_sd_card.jal
18f462018f4620_fat32_small_sd_card.jal
18f462018f4620_mp3_decoder_vs1053b_pata_hard_disk.jal
18f67j5018f67j50_sd_card.jal
18f67j5018f67j50_fat32_small_pata_hard_disk.jal
18f67j5018f67j50_fat32_sd_card.jal
18f67j5018f67j50_mp3_decoder_vs1053b_sd_card.jal
18f67j5018f67j50_fat32_small_sd_card.jal
18f67j5018f67j50_bit_array.jal
18f67j5018f67j50_pata_hard_disk.jal
18f67j5018f67j50_large_array.jal
18f67j5018f67j50_mp3_decoder_vs1053b_pata_hard_disk.jal
18f67j5018f67j50_fat32_pata_hard_disk.jal
18f67j5018f67j50_23k256.jal
18f67j5018f67j50_stopwatch.jal



serial_hardware2

USART2 hardware control

Author Stef Mientki, Copyright (c) 2002..2006, all rights reserved.
Adapted-by Sebastien Lelong.
Compiler >=2.4g

Description

USART2 hardware control.
Routines for sending and receiving through the EUSART2
(2nd EUSART module)
both asynchrone and synchrone are supported.
Baudrate can simply be set through a human constant,
because the baudrate depending registers are calculated by this unit.
Baudrate is calculated, starting at the high baudrate flag,
which will ensure the highest possible accuracy.


Dependencies


Summary

Global variables/contants

Procedures

Functions

Private

API details

Global variables/contants

Procedures

  • serial_hw2_init()

    Initializes the serial port, calculates baudrate registers.
    

  • serial_hw2_write(byte in data)

    Write char to serial port, blocking
    
    Asynchronuous serial send routine, using the TX pin
    Sends byte X (8 bit with no parity) to the serial port
    First checks (and waits if necessary) if transmit buffer is empty
    
    

  • serial_hw2_enable()

    Enables USART
    

  • serial_hw2_data_raw'put(byte in data)

    These are real raw procedures, declared as pseudo variables
    the user is totally responsible for testing the transmit/receive
    flag before using these functions
    

  • serial_hw2_data'put(byte in data)

    Here Serial read and write are definied as pseudo variables
    so you use them as normal vars, like
     * wait for character being received,
     * then echo the inverted character
    {{{
    serial_hw2_data = ! serial_hw2_data
    }}}
    these procedures will wait till they can perform their action
    therefore it's better to use to following construct
    {{{
     if charater received, echo the inverted character
    if  serial_hw2_data_available then
        serial_hw2_data = ! serial_hw2_data
    end if
     do other things
    }}}
    

  • serial_hw2_write_word(word in data)

    like Serial_H_write, but then with a word as input
    The MSB is outputed first
    

  • serial_hw2_disable()

    Disables USART so ports can be used (temporary) for other purposes.
    USART can be enabled again by calling serial_hw2_enable()
    

Functions

Private
  • _serial_hw2_read(byte out data) return bit

    Internal use only!
    
    (using this inline function for serial_hw2_data'get saves a stack level)
    Returns true if a character was received, otherwise returns false.
    Overrun error flag is cleared.
    
    



Related samples

Here are the list of samples which use this library:

18f25k2218f25k22_eusart2.jal
18f27j5318f27j53_pps_rx2tx2.jal



serial_hw_int_cts

serial_hw_int_cts.jal. Interrupt driven buffered serial interface with flow control.

Author Rob Hamerling, Copyright (c) 2008..2009, all rights reserved.
Adapted-by Joep Suijs
Compiler =2.4h

Description

Serial communications:
  - receive and transmit data transfer is interrupt driven
  - receive and transmit data transfer uses circular buffers
  - automatic CTS flow control with spare free space for FiFo buffer


Notes

 - For data transmit and receive the pins TX and RX are used
   automatically, these have not to be assigned by the application.
 - The selection of the CTS pin above is an example, any other pin
   which is configurable for output can be used.
 - When CTS flow control is not desired then assign serial_ctsinv
   to a dummy bit, for example:
       var  bit  dummy_cts_bit
       alias serial_ctsinv  is  dummy_cts_bit
 - The serial_overflow_discard flag may be dynamically changed
   (depending on how important the data is for the receiving party).
 - Do not touch the following interrupt bits: TXIE, RCIE, PEIE and GIE


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions

  • serial_hw_read(byte out data) return bit

     Return byte (if any) from circular receive buffer for UART
     input:   nothing
     output:  received byte (if any)
     returns: TRUE  when byte returned
              FALSE if no byte available
     notes: - Sets CTS high when receive buffer has more than 
              bytes free space after delivering byte to caller.
    
    

  • serial_hw_data'get() return byte

    Return next received byte
    

  • serial_receive_byte(byte out data) return bit

    Deprecated
    

  • serial_send_byte(byte in data) return byte

     Put a single byte in circular transmit buffer for UART
     input:   byte to transmit
     returns: transmitted byte (or 0x00 when data discarded)
     notes: - Activates transmit interrupt handler when data buffered
            - When buffer full act as indicated in 'serial_overflow_discard'
              * TRUE:  discard data
                       (and return 0x00 as data byte)
              * FALSE: wait for free buffer space
                       (returns only after data has been stored in buffer)
    
    


Related samples

Here are the list of samples which use this library:

16f193716f1937_serial_hardware.jal
16f193716f1937_serial_hw_int_cts.jal
16f648a16f648a_serial_hw_int_cts.jal
16f72316f723_serial_hw_int_cts.jal
16f7316f73_serial_hw_int_cts.jal
16f87716f877_serial_hw_int_cts.jal
16f877a16f877a_serial_hw_int_cts.jal
16f8816f88_serial_hw_int_cts.jal
16f8816f88_serial_hw_int_cts_echo.jal
18f14k5018f14k50_serial_hw_int_cts.jal
18f245018f2450_serial_hw_int_cts.jal
18f258518f2585_canid4_serial_adapter.jal
18f258518f2585_can_serial_adapter.jal
18f455018f4550_serial_hw_int_cts.jal
18f631018f6310_serial_hw_int_cts.jal
18f652018f6520_serial_hw_int_cts.jal



serial_software

Software RS232 library

Author Stef Mientki, Copyright (c) 2002..2006, all rights reserved.
Adapted-by Sebastien Lelong, Albert Faber, Joep Suijs (on behalf of Tijs van Roon)
Compiler >=2.4l

Description

software RS232 library
Library supports software RS232 send and receive procedure on any IO-pin.
Both the inverted and non-inverted routines are available, 
so it should fit any hardware.
Baudrate can be set between 110 and 230_400 (for 20 Mhz Xtal),
for lower Xtal frequencies the maximum baudrate will be equally lower.
Baudrates are optimized, so even the high baudrates shouldn't be a problem
(my [Stef] standard = 115_200 Baud, which has never given me any problems).
Interrupts are disabled during transmissions.
Transmission parameters are 8 databits, 2 stopbits, no parity, no handshake.
const serial_sw_stopbits = 1 ; setup for one stopbit.                                                


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • serial_sw_data'put(byte in data)

    Here the serial_sw_write procedure is declared as a pseudo variable
    so you can use it in the following way:
    {{{
       serial_sw_write = 0x33
    }}}
    

  • serial_sw_write(byte in data)

    Waits untill a character is received.
    Interrupts will be disabled during this routine, but restored afterwards.
    Also here the code is doubled (inverting and non-inverting)
    and selection is done by a compiler-directive.
    

  • serial_sw_init()

    No documentation found

  • serial_sw_read_wait(byte out data)

    Waits untill a character is received.
    Interrupts will be disabled during this routine, but restored afterwards.
    Also here the code is doubled (inverting and non-inverting)
    and selection is done by a compiler-directive.
    

Functions

  • serial_sw_data'get() return byte

    Here the serial_sw_read_wait procedure is declared as a pseudo variable
    so you can use it in the following way
    {{{
       Data = serial_sw_write
    }}}
    

  • serial_sw_read(byte out data) return bit

    Waits untill a character is received or time out is reached.
    Interrupts will be disabled during this routine, but restored afterwards.
    Also here the code is doubled (inverting and non-inverting)
    and selection is done by a compiler-directive.
    


Related samples

Here are the list of samples which use this library:

16f877a16f877a_serial_software.jal
16f8816f88_serial_sw_echo.jal
18f455018f4550_fat32_sd_card.jal
18f455018f4550_sd_card.jal
18f455018f4550_serial_software.jal
18f455018f4550_fat32_small_sd_card.jal
18f455018f4550_23k256.jal



servo_rc_master

servo control library

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4m

Description

This library controls up to 24 servos that are the type used in
             radio control (RC). This is the main servo library.


Sources

http://www.horrorseek.com/home/halloween/wolfstone/Motors/svoint_RCServos.html


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

16f877a16f877a_servo_rc_master.jal
16f877a16f877a_servo_rc_master_dedicated_slave_i2c.jal
18f45218f452_servo_rc_master_dedicated_slave_i2c.jal
18f45218f452_servo_rc_master.jal
18f462018f4620_servo_rc_master.jal
18f462018f4620_servo_rc_master_dedicated_slave_i2c.jal



servo_rc_master_dedicated

Library for use with a dedicated RC servo PIC

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4m

Description

This library controls an external PIC that works as a slave device
and is a dedicated PIC to servo movements.


Sources

http://www.horrorseek.com/home/halloween/wolfstone/Motors/svoint_RCServos.html


Notes

Also see servo_rc_master library, this is not the main servo library.


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f877a16f877a_servo_rc_master_dedicated_master_i2c.jal
18f45218f452_servo_rc_master_dedicated_master_i2c.jal
18f462018f4620_servo_rc_master_dedicated_master_i2c.jal



seven_segment

seven_segment.jal - translation routine for 7 segment display

Author Wouter van Ooijen (c) 1998, all rights reserved.
Adapted-by Joep Suijs, Vasile Surducan 25.08.2009
Compiler >=2.2

Description

Translation routine for 7 segment display. 


                                                             
The seven segment display needs to be connected to a single port.
Define the pin layout of the seven segment display like:





 constant for the segments      gfe dcba
const byte seven_segment_a  = 0b_0000_0001
const byte seven_segment_b  = 0b_0000_0010
const byte seven_segment_c  = 0b_0000_0100
const byte seven_segment_d  = 0b_0000_1000
const byte seven_segment_e  = 0b_0001_0000
const byte seven_segment_f  = 0b_0010_0000
const byte seven_segment_g  = 0b_0100_0000
const byte seven_segment_dp = 0b_1000_0000   



character set:



value 0 is character 0     
value 1 is character 1     
value 2 is character 2     
value 3 is character 3     
value 4 is character 4     
value 5 is character 5     
value 6 is character 6     
value 7 is character 7     
value 8 is character 8     
value 9 is character 9     
value 10 is character A    
value 11 is character b    
value 12 is character C_big
value 13 is character d    
value 14 is character E    
value 15 is character F    
value 16 is character S    
value 17 is character c_small
value 18 is character r    
value 19 is character H    
value 20 is character i_small
value 21 is character L    
value 22 is character o    
value 23 is character P    
value 24 is character U_big
value 26 is character u    
value 27 is character space



Use:  



const bit seven_segment_common_anode = true ; omit this line if you use a common cathode display.



portd_direction = all_output
portd = seven_from_digit(1) -- display '1'


    


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f87716f877_seven_segment.jal
16f877a16f877a_seven_segment.jal
18f455018f4550_seven_segment.jal



slip

Library for SLIP (Serial Line IP)

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4n

Description

This library sends and receives SLIP (Serial Line IP) packets
             for communication with serial data in packet form.


Sources

http://tools.ietf.org/html/rfc1055


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


smbus_mlx90615

SM bus library for Melexis IR sensor MLX90615

Author Vasile Surducan, Copyright (c) 2010...2012, all rights reserved.
Adapted-by
Compiler >=2.4m

Description

software implementation for single SMbus master, use 4 hw stack


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

18f25j1018f25j10_test_mlx90615.jal



spi_common

SPI Master common definition

Author Sebastien Lelong(c) 2011, all rights reserved.
Adapted-by
Compiler 2.4n

Description

SPI Master common constant definition, used both by MSSP1 and MSSP2


Notes

content was extracted from spi_master_hw.jal at rev 1537
http://code.google.com/p/jallib/source/browse/trunk/include/peripheral/spi/spi_master_hw.jal?r=1537


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


spi_master_hw

SPI Master

Author William Welch Copyright (c) 2009, all rights reserved.
Adapted-by Sebastien Lelong
Compiler 2.4l

Description

SPI Master hardware control.
Routines for sending and receiving through the SPI in master mode


Sources

good overview of SPI at http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus
also at: http://elm-chan.org/docs/spi_e.html


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f81916f819_mcp2515_can_monitor.jal
16f81916f819_canopen_mcp2515_txhb.jal
16f81916f819_ee25aa02e48_lcd.jal
16f81916f819_mcp2515_canid4_monitor.jal
16f87716f877_fat32_small_pata_hard_disk.jal
16f87716f877_sd_card.jal
16f87716f877_fat32_small_sd_card.jal
16f877a16f877a_fat32_small_pata_hard_disk.jal
16f877a16f877a_23k256.jal
16f877a16f877a_sd_card.jal
16f877a16f877a_fat32_small_sd_card.jal
18f45218f452_23k256.jal
18f45218f452_fat32_small_sd_card.jal
18f45218f452_sd_card.jal
18f45218f452_fat32_small_pata_hard_disk.jal
18f452518f4525_fat32_sd_card.jal
18f452518f4525_mp3_decoder_vs1053b_sd_card.jal
18f452518f4525_sd_card.jal
18f452518f4525_fat32_small_pata_hard_disk.jal
18f452518f4525_fat32_pata_hard_disk.jal
18f452518f4525_mp3_decoder_vs1053b_pata_hard_disk.jal
18f452518f4525_fat32_small_sd_card.jal
18f455018f4550_fat32_small_sd_card.jal
18f455018f4550_fat32_sd_card.jal
18f455018f4550_23k256.jal
18f455018f4550_sd_card.jal
18f462018f4620_mp3_decoder_vs1053b_sd_card.jal
18f462018f4620_sd_card.jal
18f462018f4620_fat32_pata_hard_disk.jal
18f462018f4620_glcd_touch_stm032qvt_003.jal
18f462018f4620_fat32_small_sd_card.jal
18f462018f4620_mp3_decoder_vs1053b_pata_hard_disk.jal
18f462018f4620_fat32_sd_card.jal
18f462018f4620_fat32_small_pata_hard_disk.jal
18f67j5018f67j50_mp3_decoder_vs1053b_sd_card.jal
18f67j5018f67j50_fat32_pata_hard_disk.jal
18f67j5018f67j50_sd_card.jal
18f67j5018f67j50_fat32_small_pata_hard_disk.jal
18f67j5018f67j50_mp3_decoder_vs1053b_pata_hard_disk.jal
18f67j5018f67j50_23k256.jal
18f67j5018f67j50_fat32_sd_card.jal
18f67j5018f67j50_fat32_small_sd_card.jal



spi_master_hw2

SPI Master, driving MSSP2 module

Author Sebastien Lelong Copyright (c) 2011, all rights reserved.
Adapted-by
Compiler 2.4n

Description

SPI Master hardware control.
Routines for sending and receiving through the SPI in master mode, using MSSP2


Sources

good overview of SPI at http://en.wikipedia.org/wiki/Serial_Peripheral_Interface_Bus
also at: http://elm-chan.org/docs/spi_e.html


Notes

this is a rough duplication of spi_master_hw.jal at rev 1537, 
(http://code.google.com/p/jallib/source/browse/trunk/include/peripheral/spi/spi_master_hw.jal?r=1537)
originally written by William Welch, from which MSSP1 registers were modified to match MSSP2 names.


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


sram_23k256

23K256 sram library

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by Sebastien Lelong
Compiler >=2.4l

Description

This is library for 23K256 SPI SRAM, Microchip's 20mhz 256kbit SRAM memory


Sources

http://ww1.microchip.com/downloads/en/DeviceDoc/22100D.pdf


Notes

Address from 0 to 32,767
This is a 2.7v to 3.6v memory.
This lib should also work with 23k640 (64kbit sram), but hasn't been tested, please let me know.
Also should work with 23A640 & 23A256 (1.5v to 1.95v versions), also not tested
SPI Mode is 00 for 23k256


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f87716f877_fat32_small_pata_hard_disk.jal
16f87716f877_fat32_small_sd_card.jal
16f877a16f877a_fat32_small_pata_hard_disk.jal
16f877a16f877a_23k256.jal
16f877a16f877a_fat32_small_sd_card.jal
18f45218f452_fat32_small_pata_hard_disk.jal
18f45218f452_23k256.jal
18f45218f452_fat32_small_sd_card.jal
18f452518f4525_fat32_sd_card.jal
18f452518f4525_mp3_decoder_vs1053b_sd_card.jal
18f452518f4525_fat32_small_pata_hard_disk.jal
18f452518f4525_fat32_pata_hard_disk.jal
18f452518f4525_mp3_decoder_vs1053b_pata_hard_disk.jal
18f452518f4525_fat32_small_sd_card.jal
18f455018f4550_fat32_small_sd_card.jal
18f455018f4550_23k256.jal
18f462018f4620_mp3_decoder_vs1053b_sd_card.jal
18f462018f4620_fat32_pata_hard_disk.jal
18f462018f4620_fat32_small_sd_card.jal
18f462018f4620_mp3_decoder_vs1053b_pata_hard_disk.jal
18f462018f4620_fat32_sd_card.jal
18f462018f4620_fat32_small_pata_hard_disk.jal
18f67j5018f67j50_mp3_decoder_vs1053b_sd_card.jal
18f67j5018f67j50_fat32_pata_hard_disk.jal
18f67j5018f67j50_fat32_small_pata_hard_disk.jal
18f67j5018f67j50_mp3_decoder_vs1053b_pata_hard_disk.jal
18f67j5018f67j50_23k256.jal
18f67j5018f67j50_fat32_sd_card.jal
18f67j5018f67j50_fat32_small_sd_card.jal



stopwatch

Stopwatch library

Author Matthew Schinkel - borntechi.com, copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4n

Description

Creates a stopwatch for timing events


Notes

You do not need to define any constants in your program. Stopwatch will
choose these default values for you.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f87716f877_stopwatch.jal
16f877a16f877a_stopwatch.jal
18f45218f452_stopwatch.jal
18f452518f4525_stopwatch.jal
18f455018f4550_stopwatch.jal
18f462018f4620_stopwatch.jal
18f67j5018f67j50_stopwatch.jal



temperature_sht

SHTxx, for Sensirion humidity and temperature sensors

Author Eur van Andel, eur@fiwihex.nl Copyright (c) 2008
Adapted-by
Compiler =2.4h

Description

The Sensirion SHT1x/SHT7x is a single chip relative humidity and
temperature multi sensor module comprising a calibrated digital output.
It comes in 5 flavors, with different accuracy and package style:
sensor   hum acc  temp acc    package
SHT10    4.5%     0.5C        SMD (LCC)
SHT11    3.0%     0.4C        SMD (LCC) 
SHT15    2.0%     0.3C        SMD (LCC) 
SHT71    3.0%     0.4C        4-pin single-in-line 
SHT75    1.8%     0.3C        4-pin single-in-line 
all consist of the same silicon: the less accurate models are sold cheaper.
My experience is mixed: I've seen some consistent +2C offset in temperature,
but good humidty measurements. The 4-pin package breaks when you touch it.
The SMD package has naked tracks underneath: you can't route under it!
If exposed to >95% RH for 10 minutes, these sensors will go beserk and need 
<60% RH for an hour to recover. You might try heating them. 
protocol is close to I2C, but not the same. Remember to pull up DATA.
0b0000_0011  starts temperature measurement
0b0000_0101  starts humidity measurement
device returns three bytes: MSB, LSB and CRC
this library doesn't perform any CRC check


Sources

http://www.sensirion.com/en/01_humidity_sensors/00_humidity_sensors.htm


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • read_raw_hum_sht(byte out MSB, byte out LSB, byte out CRC)

    read raw 12-bit humidity from SHT
    default value of resolution bit is 12 bit RH
    SHT takes 55 ms for measurement @ 12 bits
    we will wait 70 ms
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every 500ms
    

  • read_hum_word_sht(word out hum)

    read humidity from SHT, result in word precision 0.01%RH
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every 500ms
    

  • sht_get_data(byte out x)

    receive one byte from the SHT
    

  • sht_start()

    send start
          _____         ________ 
    DATA:      |_______| 
              ___     ___ 
    SCK : ___|   |___|   |______ 
    

  • sht_put_ack()

    send ACK
    

  • sht_wait_ack_out(bit out ack)

    No documentation found

  • sht_conn_reset()

    reset SHT interface, must be followed with sht_start and command
    

  • sht_wait_ack()

    wait for ACK, but continue after 1 ms
    

  • sht_reset()

    reset SHT
    

  • read_centicelsius_temp_sht(sword out centicelsius)

    read Celcius temperature from SHT
    with 0.01 C resolution, result is sword type, so -327.68 .. +327.68 C
    SHT takes 320 ms for measurement @ 14 bits
    we will wait 400 ms
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every four seconds!
    

  • sht_put_data(byte in x)

    send one byte to the SHT
    

  • read_celsius_temp_sht(sbyte out celsius)

    read Celcius temperature from SHT
    with 1 C resolution, result is sbyte type, so -126...+127C
    SHT takes 320 ms for measurement @ 14 bits
    we will wait 400 ms
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every four seconds!
    

  • read_hum_sht(byte out hum)

    read humidity from SHT, result in byte precision 1%RH
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every 500ms
    

  • read_raw_temp_sht(byte out MSB, byte out LSB, byte out CRC)

    read raw 14-bit temperature from SHT
    default value of resolution bit is 14 bit temperature
    SHT takes 320 ms for measurement @ 14 bits
    we will wait 330 ms
    SHT may only be switched on for 10% of the time because of self-heating
    so this measurement can only happen every two seconds!
    

Functions


Related samples

No sample found


temperature_tc77

temp_TC77

Author Eur van Andel, eur@fiwihex.nl Copyright (c) 2010
Adapted-by
Compiler =2.4h

Description

this library reads the TC77 temperature sensor from Microchip.
The TC77 has a 12-bit plus sign temperature resolution of 0.0625°C 
per Least Significant Bit (LSb). It works via the SPI protocol
Specs:
1C (max.) accuracy from +25°C to +65C, 
2C (max.) accuracy from -40°C to +85C 
3C (max.) accuracy from -55°C to +125C 
2.7V to 5.5V Operating Range, Low Power: 250uA (typ.) Continuous Conversion
Mode, 0.1uA (typ.) Shutdown Mode 


--------   
I have several years of experience with hundreds of these sensors.
They work very well: fast, good accuracy, good repeatability. 
If they have an offset, it can easily be calibrated in software. 
The hard part of using this sensor is gettting it watertigtht. 
It is SMD, so it needs a PCB, and a cable. Dipping in resin or shrinking in
glue-covered shrinktube works. 
The SPI protocol is bit-banged here and can be used with any pins.
Clock data in on rising edge of clock, program must pull CS low. This allows
for multiple TC77s on the same 2-wire databus. Put a 100nF decoupling 
capacitor close the the TC77. If you don't, you WILL get weird data. 
Writing the status_word is not supported here.


Notes

This library expects two pins defined as SIO and SCK:
var bit SCK is pin_xx = high  -- TC77 common clock
pin_xx_direction = output
var bit SIO is pin_yy         -- TC77 common data
pin_yy_direction = input      
include temperature_tc77      -- this library 
A third pin is needed for /CS:
var bit cs is pin_zz = high  -- chipselect TC77 sensor
pin_zz_direction = output
Usage is:
  CS = low
  tc77_read_celsius_sword(T1)
  CS = high
Multiple TC77s can share the same bus, but each needs its own /CS pin. 


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

12hv61512hv615_temperature_fan.jal
16f876a16f876a_tc77.jal



timer0_isr_interval

timer0 isr interval

Author Joep Suijs, Copyright (C) 2008 Joep Suijs
Adapted-by Rob Hamerling
Compiler >=2.4j

Description

Fixed interval isr with support for non-blocking delays.    


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_timer0_interval.jal
16f72316f723_timer0_interval.jal
16f7316f73_timer0_interval.jal
16f87716f877_timer0_interval.jal
16f877a16f877a_timer0_interval.jal
16f8816f88_timer0_interval.jal
18f14k5018f14k50_timer0_interval.jal
18f245018f2450_timer0_interval.jal
18f455018f4550_timer0_interval.jal



timer0_poll_interval

timer0 poll interval

Author Joep Suijs, Copyright (C) 2008 Joep Suijs
Adapted-by Rob Hamerling, William Welch
Compiler >=2.4m

Description

Fixed interval support for non-blocking delays, but without using
             an interrupt.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

18f14k5018f14k50_tmr0_poll_interval.jal
18f245018f2450_tmr0_poll_interval.jal
18f455018f4550_tmr0_poll_interval.jal
18f458518f4585_canopen_blink.jal
18f458518f4585_tmr0_poll_interval.jal



unittest

unittests procedures



usart2_common

USART2 common

Author Stef Mientki Copyright (c) 2002..2010, all rights reserved.
Adapted-by Sebastien Lelong, Joep Suijs, Rob Hamerling
Compiler >=2.4n

Description

USART2 common functions
This file provides common functions to other libraries.



Baudrate can simply be set through a constant in the application program,
because the baudrate depending registers are calculated by this unit.
Baudrate is calculated, starting at the high baudrate flag,
which will ensure the highest possible accuracy.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private
  • _calculate_and_set_baudrate2()

    internal function, calculates and sets baudrate divider
    and stores it in the appropiate register.
    the high-speed / low-speed bit is not stored but returned as the result
    Special attention is payed to the highest and lowest baudrates,
    a deviation of 5% is accepted in these cases
    Asynchronous baudrate settings
    {{{
    for ESUART (with 16 bits baudrate generator)
     SPBRGH2/SPBRG2 = ( Fosc / ( 4 * Baudrate ) ) -1
    if TXSTA2_BRGH = 1 (high speed)
     SPBRG2 = ( Fosc / ( 16 * Baudrate ) ) -1
    if TXSTA2_BRGH = 0 (low speed)
     SPBRG2 = ( Fosc / ( 64 * Baudrate ) ) -1
    }}}
    Synchronous baudrate settings:
     * TXSTA2_BRGH = 0 (low speed)
     * SPBRG2 = ( Fosc / ( 4 * Baudrate ) ) -1
    


Functions


Related samples

No sample found


usart_common

USART common

Author Stef Mientki Copyright (c) 2002..2010, all rights reserved.
Adapted-by Sebastien Lelong, Joep Suijs, Rob Hamerling
Compiler >=2.4n

Description

USART common functions
This file provides common functions to other libraries.



Baudrate can simply be set through a constant in the application program,
because the baudrate depending registers are calculated by this unit.
Baudrate is calculated, starting at the high baudrate flag,
which will ensure the highest possible accuracy.


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private
  • _calculate_and_set_baudrate()

    internal function, calculates and sets baudrate divider
    and stores it in the appropiate register.
    the high-speed / low-speed bit is not stored but returned as the result
    Special attention is payed to the highest and lowest baudrates,
    a deviation of 5% is accepted in these cases
    Asynchronous baudrate settings
    {{{
    for ESUART (with 16 bits baudrate generator)
     SPBRGH/SPBRG = ( Fosc / ( 4 * Baudrate ) ) -1
    if TXSTA_BRGH = 1 (high speed)
     SPBRG = ( Fosc / ( 16 * Baudrate ) ) -1
    if TXSTA_BRGH = 0 (low speed)
     SPBRG = ( Fosc / ( 64 * Baudrate ) ) -1
    }}}
    Synchronous baudrate settings:
     * TXSTA_BRGH = 0 (low speed)
     * SPBRG = ( Fosc / ( 4 * Baudrate ) ) -1
    


Functions


Related samples

No sample found


usb_defs

USB constant definitions

Author Albert Faber, Copyright (c) 2008..2009, all rights reserved.
Adapted-by -
Compiler >=2.4j

Description

Constants for configurting the USB interface




Sources

http://www.usb.org for USB specifications


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

Here are the list of samples which use this library:

18f14k5018f14k50_usb_hid_mouse.jal
18f14k5018f14k50_usb_hid_generic.jal
18f14k5018f14k50_usb_bootloader_autostart.jal
18f14k5018f14k50_usb_bootloader.jal
18f245018f2450_usb_bootloader.jal
18f245018f2450_usb_bootloader_autostart.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_usb_hid_mouse.jal
18f455018f4550_usb_bootloader_autostart.jal
18f455018f4550_usb_bootloader.jal
18f455018f4550_usb_hid_mouse.jal
18f455018f4550_usb_hid_generic.jal



usb_drv

USB driver library

Author Albert Faber, Copyright (c) 2008..2009, all rights reserved.
Adapted-by -
Compiler >=2.4j

Description

This file contains the lowl level USB driver routines. It constrols
the USB serial interface engine, by managing the input and output transfers,
and calling the defined callback function when required


Sources

http://www.usb.org ; for USB specifications
         http://www.lvr.com/usbc.htm ; a lot of information about USB
         http://www.beyondlogic.org/ ; also a nice with with useful information


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • usb_enable_module()

    Procedure to turn on the USB device
    
    

  • usb_handle_stall()

    Procedure can be called when the USB device has to be stalled
    
    

  • usb_setup()

    Procedure to intialize the USB device, it will only do the setup, to enable
    the USB device, use the usb_enable() procedure
    
    

  • usb_handle_isr()

    This is the heard of the USB library, all pending IO transfers are handled by
    this main (interrupt) service routine. For the PIC USB device it does not make much 
    sense to use real interrupts since all real time aspects are handle by the SIE. 
    Therefore this usb_handle_isr() must be polled on a regular base, in order to 
    to keep the input and output transfers flowing
    
    

Private
  • _usb_handle_standard_request()

    Internal procedure to handle standard USB requests
    it will take care of the overall state of the device
    performing USB buffer management
    controlling the SIE
    and call the callback function if required
    
    

  • _usb_ints_on()

    Internal procedure to set the correct interrupt flags, note that for PIC USB device
    it does not make much sense to use real interrupts since all real time aspects
    are handle by the SIE. However, the library does use the interrupt flags, this
    procedure will setup to proper interrupt flags
    
    

  • _usb_handle_transaction()

    Internal procedure to handle the USB transactions
    it will take care of the overall state of the device
    performing USB buffer management
    controlling the SIE
    and call the callback function if required
    
    

  • _usb_handle_reset()

    Internal procedure to reset the USB device
    
    


Functions

  • usb_is_configured() return bit

    Function returns true if the usb device has been completely configured, otherwise
    return value will be false
    
    

  • usb_get_state() return byte

    Get the state of the USB device
    
    USB_STATE_POWERED -> USB device is powered up, ready to start negotiating
    USB_STATE_DEFAULT -> USB device is now negotiating
    USB_STATE_ADDRESS -> USB device now has an address
    USB_STATE_CONFIGURED -> USB device is completely configured and ready to rock and roll 
    
    


Related samples

Here are the list of samples which use this library:

18f14k5018f14k50_usb_hid_mouse.jal
18f14k5018f14k50_usb_hid_generic.jal
18f14k5018f14k50_usb_bootloader_autostart.jal
18f14k5018f14k50_usb_bootloader.jal
18f245018f2450_usb_bootloader.jal
18f245018f2450_usb_bootloader_autostart.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_usb_hid_mouse.jal
18f455018f4550_usb_bootloader_autostart.jal
18f455018f4550_usb_bootloader.jal
18f455018f4550_usb_hid_mouse.jal
18f455018f4550_usb_hid_generic.jal



usb_drv_cdc_class

USB Communication Device Class driver

Author Albert Faber, Copyright (c) 2008..2009, all rights reserved.
Adapted-by -
Compiler >=2.4j

Description

USB Communication Device Class (CDC) code
This USB library files contains the low level implementation to perform serial
communication over a USB interface. The usage of this library requires detailed
knowledge of the USB interface and requires that several configuration parameters
are defined correctly. In order to make USB serial communication more accessible 
for the end user, I would highly recommend to use the usb_serial library




Sources

http://www.usb.org for USB specifications


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions

  • usb_cdc_rx_avail() return bit

    This function returns there has been a character received, function will return true 
    if there is at least one pending receive character, false otherwise
    
    

  • does_sie_owns_tx_buffer() return bit

    This function returns the status of the SIE tx buffer. Either the SIE can own the
    transmit buffer (tranmit is pending) or it can be owned by the CPU. This function 
    return true if the SIE owns the buffer, otherwise false is returned
    
    

  • usb_cdc_line_status() return byte

    This function returns the line status. If on the host side the COM port has not been
    opened, the return status will be 0x00, otherwise it will be != 0
    
    

  • usb_cdc_getc() return byte

    This usb_cdc_getc function wait (blocking) until a character has been received.
    The byte value of the received character is returned by this function
    
    

  • usb_cdc_tx_empty() return byte

    This function returns the empty status of the transmit FIFO, it will return true if
    transmit FIFO is empty, false otherwise
    
    


Related samples

No sample found


usb_drv_core

USB driver library

Author Albert Faber, Copyright (c) 2008..2009, all rights reserved.
Adapted-by -
Compiler >=2.4j

Description

Routines for controlling the USB serial interface engine sending
which will ensure the highest possible accuracy.




Sources

http://www.usb.org for USB specifications


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

Private

Functions


Related samples

Here are the list of samples which use this library:

18f14k5018f14k50_usb_hid_mouse.jal
18f14k5018f14k50_usb_hid_generic.jal
18f14k5018f14k50_usb_bootloader_autostart.jal
18f14k5018f14k50_usb_bootloader.jal
18f245018f2450_usb_bootloader.jal
18f245018f2450_usb_bootloader_autostart.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_usb_hid_mouse.jal
18f455018f4550_usb_bootloader_autostart.jal
18f455018f4550_usb_bootloader.jal
18f455018f4550_usb_hid_mouse.jal
18f455018f4550_usb_hid_generic.jal



usb_keyboard

USB HID easy keyboard interface

Author Albert Faber, Copyright (c) 2010, all rights reserved.
Adapted-by -
Compiler >=2.4j

Description

An easy to use USB HID keyboard library
the USB interface. By default nothing has to be defined by the user, below
an example how to use the library


                                                                        
include usb_keyboard
..
usb_keyboard_init()
..
;-- wait till USB becomes available
while ( !usb_is_configured() )  loop
end loop
..
;-- main loop
var byte ch
forever loop
;   -- call the flush routine on a regular base in the main loop
;   -- in order to keep the USB communicaiton alive
    usb_keyboard_flush()
    .....
    if ( usb_is_configured() )
       if ( pin_x )
		   ush_keyboard_send_key( 0x00, USB_KEYBOARD_KEY_A )
       else
		   ush_keyboard_send_key( 0x00, USB_KEYBOARD_KEY_NONE )


Sources

http://www.usb.org for USB specifications


Notes

-


Dependencies


Summary

Global variables/contants

Procedures

Private

Functions


API details

Global variables/contants

Procedures

  • usb_handle_class_request_callback()

    No documentation found

  • ush_keyboard_send_key( byte in modifier_key, byte in key )

    ush_keyboard_send_key - send a key code (blocking!)
       
    ush_keyboard_send_key() sends a key code toward the USB HID host
    the call is blocking and assumes that the HID communcation channel
    has been established. See also definitions for key codes (starting
    with USB_KEYBOARD_KEY_xxxx) and for the modifier key definitions
    starting with USB_KEYBOARD_MKEY_. Note that once a key code has been
    send, the HID host assumes that the key remains pressed, until a
    USB_KEYBOARD_KEY_NONE (or other key) is send towards the HID host
    
    

  • usb_handle_class_ctrl_read_callback()

    No documentation found

  • usb_ep_data_in_callback(byte in end_point, word in buffer_addr, byte in byte_count)

    No documentation found

  • usb_handle_class_ctrl_write_callback()

    No documentation found

  • usb_keyboard_flush()

    usb_keyboard_flush shall be called on a regular base (millisecond range)
    in order to keep the USB communcation alive. Therfore it is adviced to
    call the usb_keyboard _flush procedure in the main loop of your 
    application
    
    

  • usb_keyboard_init()

    usb_keyboard_init will setup the HID USB communication with the HOST, 
    however, this can be a time consuming process, therefore this call 
    is non blocking. In order to check if communication with the HOST 
    has been established, one can call the usb_is_configured() function, see
    usb_is_configured() documentation for additional details.
    
    

Private

Functions


Related samples

Here are the list of samples which use this library:

18f14k5018f14k50_usb_hid_keyboard.jal
18f245018f2450_usb_hid_keyboard.jal
18f455018f4550_usb_hid_keyboard.jal



usb_serial

USB Serial

Author Albert Faber, Copyright (c) 2009, all rights reserved.
Adapted-by
Compiler >=2.4k

Description

The library will ease the use of for serial communication over 
the USB interface. By default nothing has to be defined by the user, below
an example how to use the library


                                                                        
include usb_serial
..
usb_serial_init()
..
;-- optionally wait till USB becomes available
while ( usb_cdc_line_status() ==  0x00 )  loop
end loop
..
;-- main loop
var byte ch
forever loop
;   -- call the flush routine on a regular base in the main loop
;   -- in order to keep the USB communicaiton alive
    usb_serial_flush()
    if ( usb_serial_read( ch ) )
		usb_serial_data = ch -- echo
	end if
    	.....
end loop


                                                                        
In addition this library can be used in combination with other JAL
libraries, like print.jal and format.jal, for example to send a
string, one can use the following code fragment:


                                                                        
const byte str[] = "Hello World"
print_string( usb_serial_data, str )


                                                                        
customization
The usb_serial library offers the following custimization prameters, 
the user has the ability to set these const parameter(s) before the 
inclusion of the usb_serial file


                                                                        
const byte USB_CDC_RX_BUFFER_SIZE = 0x??  -- set receive FIFO size
const byte USB_CDC_TX_BUFFER_SIZE = 0x??  -- set transmit FIFO size
const word USB_SERIAL_PRODUCT_ID = 0x???? -- set USB device product ID
const word USB_SERIAL_VENDOR_ID = 0x????  -- set USB device vendor ID
const byte USB_STRING0[] = { .. }         -- set USB language string
const byte USB_STRING1[] = { .. }         -- set USB mfg string
const byte USB_STRING2[] = { .. }         -- set USB product string


Notes

-


Dependencies


Summary

Global variables/contants

Procedures

Functions

Private

API details

Global variables/contants

Procedures

  • usb_serial_data'put(byte in data)

    usb_serial_data'put - write char to the USB port, blocking
    
    Asynchronuous serial send routine, using the USB Cummunication class
    Sends byte X (8 bit) to the USB host (via virtual COM port)
    Note that characters are dropped when the communcation channel on the
    USB host side is not opened (yet), this is a design choice in order to
    avoid lockup(s)
    
    

  • usb_serial_init()

    usb_serial_init will setup the USB communication, however, this can be
    a time consuming process, therefore this call is non blocking.
    In order to check if the USB device has established contact with the 
    HOST USB device, one can call the usb_is_configured() function, see
    usb_is_configured() documentation for additional details.
    
    

  • usb_serial_flush()

    usb_serial_flush shall be called on a regular base (millisecond range)
    in order to keep the USB transmision alive. Therfore it is adviced to
    call the usb_serial_flush procedure in the main loop of your 
    application
    
    

  • usb_serial_write(byte in data)

    usb_serial_write - write char to the USB port, blocking
    
    Asynchronuous serial send routine, using the USB Cummunication class
    Sends byte X (8 bit) to the USB host (via virtual COM port)
    Checks (and waits if necessary) if FIFO buffer is full
    Note that characters are dropped when the communcation channel on the
    USB host side is not opened (yet), this is a design choice in order to
    avoid lockup(s)
    
    

Functions

  • usb_serial_data'get() return byte

    usb_serial_data'get() - read a char (blocking!)
       
    usb_serial_data'get() waits till a character has been received and
    returns it
    
    

  • usb_serial_data_available'get() return bit

    No documentation found

  • usb_serial_port_open'get() return bit

    Check if the serial port has been opened by the host.
    
    

  • usb_serial_read(byte out data) return bit

    usb_serial_read - read char if available (non-blocking)
       
    usb_serial_read returns true if a character has been received, 
    otherwise returns false. If function returns true, the data variable
    is valid, and contains the character that has been received. In other
    cases the data variable is not defined
    Note that characters are dropped when the communcation channel on the
    USB host side is not opened (yet), this is a design choice in order to
    avoid lockup(s)
    
    

Private
  • _usb_serial_read(byte out data) return bit

    _usb_serial_read - internal use only!
    
    _usb_serial_read returns true if a character has been received, 
    otherwise returns false. If function returns true, the data variable
    is valid, and contains the character that has been received. In other
    cases the data variable is not defined
    Note that characters are dropped when the communcation channel on the
    USB host side is not opened (yet), this is a design choice in order to
    avoid lockup(s)
    
    



Related samples

Here are the list of samples which use this library:

18f14k5018f14k50_usb_serial.jal
18f245018f2450_usb_serial.jal
18f455018f4550_ir2serial.jal
18f455018f4550_usb_serial.jal