jalapi

Welcome to jalapi, the jallib API documentation

http://jallib.googlecode.com

Table of Content

adc
adc_channels
adc_clock
adc_hardware
calendar
co2_t6603
delay
format
humidity_sht
i2c_hardware
i2c_hardware_aliases
i2c_hw_slave
i2c_hw_slave_isr
i2c_hw_slave_msg
i2c_level1
i2c_software
ir_ranger_gp2d02
jascii
keyboard
lcd_backlight
lcd_hd44780_4
lcd_hd44780_8
lcd_hd44780_common
lcd_hd44780_serial_sw
pata_hard_disk
pic_data_eeprom
print
pwm_ccp1
pwm_ccp2
pwm_ccp3
pwm_ccp4
pwm_ccp5
pwm_common
pwm_hardware
queue01
queue02
queue03
queue04
random
rtc_isr_tmr0
serial_hardware
serial_hw_int_cts
serial_software
temperature_tc77
timer0_isr_interval
unittest
usart_common
usb_defs
usb_drv
usb_drv_cdc_class
usb_drv_core
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://jallib.blogspot.com for details...


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, adc_pindef.jal and adc_clock.jal



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_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
    

  • 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
    

Private

Functions


Related samples

Here are the list of samples which use this library:

16f876a16f876a_adc.jal
16f87716f877_adc.jal
16f8816f88_adc_lowres.jal
16f8816f88_adc_highres.jal



adc_channels

ADC channel configuration.

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

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, Vref+ and Vref- are part of these combinations.
         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

Functions


API details

Global variables/contants

Procedures

  • adc_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_vcfg()

    Configure Voltage reference using VCFG bits
    

Functions


Related samples

No sample found


adc_clock

ADC block configuration

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

Description

this library provides a procedure to configure
ADC clock according to ADC constraints about Tad values and PIC's clock speed


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Private

Functions

Private

API details

Global variables/contants

Procedures

Private

Functions

Private

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:

16f7716f77_adc_lowres.jal
18f14k5018f14k50_usb_hid_generic.jal
18f245018f2450_usb_hid_generic.jal
18f455018f4550_usb_hid_generic.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

Functions


Related samples

Here are the list of samples which use this library:

16f876a16f876a_rtc_lcd.jal
16f877a16f877a_rtc_lcd.jal



co2_t6603

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

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

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



delay

Delays procedures at any processor frequency

Author Stef Mientki, Copyright (c) 2002..2006, all rights reserved.
Adapted-by Sebastien Lelong, Rob Hamerling.
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:

16f648a16f648a_serial_hw_int_cts.jal
16f648a16f648a_serial_print.jal
16f648a16f648a_random.jal
16f648a16f648a_serial_format.jal
16f648a16f648a_lcd_hd44780_4_4.jal
16f648a16f648a_serial_hardware.jal
16f648a16f648a_i2c_sw_l1.jal
16f648a16f648a_lcd_hd44780_4_1.jal
16f648a16f648a_backlight.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_8_4.jal
16f72716f727_lcd_hd44780_4_4.jal
16f72716f727_lcd_hd44780_8_1.jal
16f7716f77_adc_lowres.jal
16f81916f819_lcd_hd44780_4_1.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_pata_hard_disk.jal
16f87716f877_adc.jal
16f877a16f877a_lcd_format.jal
16f877a16f877a_i2c_hw_l1.jal
16f877a16f877a_serial_print.jal
16f877a16f877a_serial_format.jal
16f877a16f877a_random.jal
16f877a16f877a_lcd_hd44780_4_1.jal
16f877a16f877a_lcd_hd44780_8_1.jal
16f877a16f877a_lcd_hd44780_8_4.jal
16f877a16f877a_serial_hw_int_cts.jal
16f877a16f877a_i2c_sw_l1.jal
16f877a16f877a_serial_hardware.jal
16f877a16f877a_backlight.jal
16f877a16f877a_rtc_lcd.jal
16f877a16f877a_print_serial_numbers.jal
16f877a16f877a_lcd_hd44780_4_4.jal
16f8816f88_lcd_hd44780_4_4.jal
16f8816f88_delay_basic.jal
16f8816f88_serial_hw_int_cts.jal
16f8816f88_random.jal
16f8816f88_backlight.jal
16f8816f88_lcd_hd44780_4_1.jal
16f8816f88_print_serial_numbers.jal
16f8816f88_adc_lowres.jal
16f8816f88_serial_hardware.jal
16f8816f88_i2c_sw_l1.jal
16f8816f88_adc_highres.jal
16f8816f88_serial_print.jal
16f88716f887_lcd_hd44780_8_4.jal
16f88716f887_lcd_hd44780_8_1.jal
16f88716f887_lcd_hd44780_4_1.jal
16f88716f887_lcd_hd44780_4_4.jal
18f123018f1230_lcd_hd44780_4_1.jal
18f14k5018f14k50_serial_hw_int_cts.jal
18f14k5018f14k50_usb_serial.jal
18f14k5018f14k50_random.jal
18f14k5018f14k50_usb_hid_mouse.jal
18f14k5018f14k50_i2c_hw_l0.jal
18f14k5018f14k50_i2c_hw_l1.jal
18f14k5018f14k50_i2c_sw_l1.jal
18f14k5018f14k50_usb_hid_keyboard.jal
18f14k5018f14k50_serial_format.jal
18f14k5018f14k50_serial_hardware.jal
18f14k5018f14k50_usb_hid_generic.jal
18f14k5018f14k50_serial_print.jal
18f232018f2320_lcd_hd44780_4_4.jal
18f232018f2320_lcd_hd44780_4_1.jal
18f245018f2450_usb_hid_mouse.jal
18f245018f2450_usb_serial.jal
18f245018f2450_usb_hid_keyboard.jal
18f245018f2450_serial_hw_int_cts.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_serial_hardware.jal
18f245018f2450_serial_print.jal
18f245018f2450_random.jal
18f245018f2450_serial_format.jal
18f245018f2450_i2c_sw_l1.jal
18f455018f4550_i2c_hw_l1.jal
18f455018f4550_i2c_hw_l0.jal
18f455018f4550_i2c_sw_l1.jal
18f455018f4550_serial_hw_int_cts.jal
18f455018f4550_usb_hid_keyboard.jal
18f455018f4550_serial_format.jal
18f455018f4550_usb_hid_generic.jal
18f455018f4550_usb_hid_mouse.jal
18f455018f4550_serial_print.jal
18f455018f4550_usb_serial.jal
18f455018f4550_serial_hardware.jal
18f455018f4550_random.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_4_4.jal
18f631018f6310_lcd_hd44780_8_4.jal
18f631018f6310_lcd_hd44780_8_8.jal
18f631018f6310_lcd_hd44780_4_1.jal
18f631018f6310_lcd_hd44780_8_1.jal



format

Writes formatted values to output device

Author Stef Mientki, Copyright (c) 2002 .. 2006, all rights reserved.
Adapted-by Joep Suijs
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_format.jal
16f648a16f648a_serial_print.jal
16f876a16f876a_rtc_lcd.jal
16f876a16f876a_tc77.jal
16f876a16f876a_sht.jal
16f877a16f877a_serial_print.jal
16f877a16f877a_rtc_lcd.jal
16f877a16f877a_serial_format.jal
16f877a16f877a_print_serial_numbers.jal
16f877a16f877a_lcd_format.jal
16f8816f88_print_serial_numbers.jal
16f8816f88_serial_print.jal
18f14k5018f14k50_serial_print.jal
18f14k5018f14k50_serial_format.jal
18f245018f2450_serial_print.jal
18f245018f2450_serial_format.jal
18f455018f4550_serial_print.jal
18f455018f4550_serial_format.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.5         SMD (LCC)
SHT11    3.0      0.4         SMD (LCC) 
SHT15    2.0      0.3         SMD (LCC) 
SHT71    3.0      0.4         4-pin single-in-line 
SHT75    1.8      0.3         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
higher functions don't do a CRC check


Sources

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


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:

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.


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:

16f877a16f877a_i2c_hw_l1.jal
18f14k5018f14k50_i2c_hw_l1.jal
18f14k5018f14k50_i2c_hw_l0.jal
18f455018f4550_i2c_hw_l0.jal
18f455018f4550_i2c_hw_l1.jal



i2c_hardware_aliases

i2c_hardware_aliases

Author Albert Faber, Copyright (C) 2009 Albert Faber
Adapted-by
Compiler >=2.4k

Description

I2C hardware aliases for PIC18f


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


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:

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
18f455018f4550_i2c_hw_slave_check_bus.jal
18f455018f4550_i2c_hw_slave_echo.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:

16f8816f88_i2c_hw_slave_echo.jal
18f14k5018f14k50_i2c_hw_slave_echo.jal
18f455018f4550_i2c_hw_slave_echo.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:

16f877a16f877a_i2c_hw_slave_eeprom_simulator.jal
16f877a16f877a_i2c_hw_slave_msg.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_l1.jal
16f877a16f877a_i2c_hw_l1.jal
16f877a16f877a_i2c_sw_l1.jal
16f877a16f877a_i2c_sw_master_check_bus.jal
16f877a16f877a_i2c_sw_master_echo.jal
16f8816f88_i2c_sw_master_echo.jal
16f8816f88_i2c_sw_master_check_bus.jal
16f8816f88_i2c_sw_l1.jal
18f14k5018f14k50_i2c_hw_l1.jal
18f14k5018f14k50_i2c_sw_master_check_bus.jal
18f14k5018f14k50_i2c_sw_master_echo.jal
18f14k5018f14k50_i2c_sw_l1.jal
18f245018f2450_i2c_sw_master_echo.jal
18f245018f2450_i2c_sw_l1.jal
18f245018f2450_i2c_sw_master_check_bus.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.


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_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!)
    
    

  • i2c_transmit_byte( byte in x ) return bit

    i2c_transmit_byte - output one byte
    
    
    


Related samples

Here are the list of samples which use this library:

16f648a16f648a_i2c_sw_l1.jal
16f877a16f877a_i2c_sw_l1.jal
16f877a16f877a_i2c_sw_master_check_bus.jal
16f877a16f877a_i2c_sw_master_echo.jal
16f8816f88_i2c_sw_master_echo.jal
16f8816f88_i2c_sw_master_check_bus.jal
16f8816f88_i2c_sw_l1.jal
18f14k5018f14k50_i2c_sw_master_check_bus.jal
18f14k5018f14k50_i2c_sw_master_echo.jal
18f14k5018f14k50_i2c_sw_l1.jal
18f245018f2450_i2c_sw_master_echo.jal
18f245018f2450_i2c_sw_l1.jal
18f245018f2450_i2c_sw_master_check_bus.jal
18f455018f4550_i2c_sw_master_echo.jal
18f455018f4550_i2c_sw_master_check_bus.jal
18f455018f4550_i2c_sw_l1.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
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 A     row1  
     4 5 6 B     row2 
     7 8 9 C     row3 
     * 0 # D     row4 



 col 1 2 3 4


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
             10          *
             11          #
             12 .. 15    ???
             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
16f877a16f877a_keyboard_lcd.jal



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
16f877a16f877a_backlight.jal
16f8816f88_backlight.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)
Compiler >=2.4g

Description

   Nibble interface for HD44780 compatible alphanumeric LCD screens.
.
   Expects: - 2 pins for handshake: 'lcd_rs' and 'lcd_en'
        and
            - 1 port nibble for data: 'lcd_dataport'
        or
            - 4 lines for data: 'lcd_d4' .. 'lcd_d7'
   note:    a 'port nibble' - the lower or higher 4 bits of a port - give
            faster and more compact code then random selected data lines.
.
   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  lcd_en        is  pin_A4      -- trigger
         var   bit  lcd_rs        is  pin_A5      -- cmd/data select
      and variables (aliases):
         var   byte lcd_dataport  is  portA_low   -- 4 data pins
      or
         var   bit  lcd_d4        is  pin_A3      -- databit d4 pin
         var   bit  lcd_d5        is  pin_A1      -- databit d5 pin
         var   bit  lcd_d6        is  pin_C0      -- databit d6 pin
         var   bit  lcd_d7        is  pin_C2      -- databit d7 pin
.
   2. Set the chosen LCD dataport and handshake pins to output:
         pin_A4_direction    = output
         pin_A5_direction    = output
      and
         portA_low_direction = all_output
      or
         pin_A3_direction    = output            -- set data pin as output
         pin_A1_direction    = output            -- set data pin as output
         pin_C0_direction    = output            -- set data pin as output
         pin_C2_direction    = output            -- set data pin as 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-bit mode
    
    

Private

Functions


Related samples

Here are the list of samples which use this library:

16f648a16f648a_lcd_hd44780_4_4.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_t6603.jal
16f876a16f876a_lcd_hd44780_4_1.jal
16f876a16f876a_sht.jal
16f876a16f876a_rtc_lcd.jal
16f876a16f876a_tc77.jal
16f876a16f876a_lcd_hd44780_4_4.jal
16f877a16f877a_lcd_format.jal
16f877a16f877a_co2_t6603.jal
16f877a16f877a_backlight.jal
16f877a16f877a_keyboard_lcd.jal
16f877a16f877a_rtc_lcd.jal
16f877a16f877a_lcd_hd44780_4_1.jal
16f877a16f877a_lcd_hd44780_4_4.jal
16f8816f88_lcd_hd44780_4_1.jal
16f8816f88_lcd_hd44780_4_4.jal
16f8816f88_backlight.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_4.jal
18f455018f4550_lcd_hd44780_4.jal
18f468518f4685_lcd_hd44780_4_1.jal
18f468518f4685_lcd_hd44780_4_4.jal
18f631018f6310_lcd_hd44780_4_4.jal
18f631018f6310_lcd_hd44780_4_1.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)
Compiler >=2.4g

Description

   Port interface for HD44780 compatible alphanumeric LCD screens.
   Uses 8 bit wide datapath + 2 handshake lines (total 10 PIC pins).
   Expects: - 2 pins for handshake: 'lcd_rs' and 'lcd_en'
            - 1 complete port for data: 'lcd_dataport'
   or
            - 2 pins for handshake: 'lcd_rs' and 'lcd_en'
            - 8 lines for data: 'lcd_d0' .. 'lcd_d7'
   note:    a 'port nibble' - the lower or higher 4 bits of a port - give
            faster and more compact code then random selected data lines.
.
   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  lcd_rs        is  pin_D2      -- cmd/data select
         var   bit  lcd_en        is  pin_D3      -- trigger
      and variables (aliases):
         var   byte lcd_dataport  is  portF       -- 8 data pins
       or
         var   byte lcd_dataport_low  is portD_high  -- 4 low order data pins
         var   byte lcd_dataport_high is portC_high  -- 4 high order data pins
       or
         var   bit  lcd_d0        is  pin_D0      -- databit d0 pin
         var   bit  lcd_d1        is  pin_D1      -- databit d1 pin
         var   bit  lcd_d2        is  pin_C6      -- databit d2 pin
         var   bit  lcd_d3        is  pin_C7      -- databit d3 pin
         var   bit  lcd_d4        is  pin_B0      -- databit d4 pin
         var   bit  lcd_d5        is  pin_B1      -- databit d5 pin
         var   bit  lcd_d6        is  pin_C0      -- databit d6 pin
         var   bit  lcd_d7        is  pin_C2      -- databit d7 pin
.
   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 half data ports to output:
         portD_high_direction = ALL_OUTPUT
         portC_high_direction = ALL_OUTPUT
     or 8 individual pins to outout
         pin_D0_direction     = output -- set data pin as output
         pin_D1_direction     = output -- set data pin as output
         pin_C6_direction     = output -- set data pin as output
         pin_C7_direction     = output -- set data pin as output
         pin_B0_direction     = output -- set data pin as output
         pin_B1_direction     = output -- set data pin as output
         pin_C0_direction     = output -- set data pin as output
         pin_C2_direction     = output -- set data pin as 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()

    Initialise the LCD controller and API
    
    

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..2009, all rights reserved.
Adapted-by Joep Suijs
Compiler >=2.4j

Description

Common API for HD44780 based LCD
.
 Procedures which can be used by application program:
.
* lcd_write_char( byte in value ):
  writes 'value' to lcd
  example: lcd_write_char( "E" )  or lcd_write_char( 69 )
.
* lcd = value:
  writes 'value' to lcd
  example: lcd = "E"  or lcd = 69
.
* lcd_cursor_position(byte in line, byte in pos):
  places the cursor on position (pos) in line (line) (zero based!)
  example: lcd_new_line_cursor_position (1, 8)
.
* lcd_shift_left(byte in value):
  shifts the display [value] times to the left without changing DDRAM data.
  example: lcd_shift_left(4)
  or       lcd_shift_left(variable)
.
* lcd_shift_right(byte in value):
  shifts the display [value] times to the right without changing DDRAM data.
  example: lcd_shift_right(12)
  or       lcd_shift_right(variable)
.
* lcd_cursor_shift_left(byte in value):
  shifts the cursor [value] times to the left without changing display
  contents and DDRAM data.
  example: lcd_cursor_shift_left(8)
  or       lcd_cursor_shift_left(variable)
.
* lcd_cursor_shift_right(byte in value):
  shifts the cursor [value] times to the right without changing display
  contents and DDRAM data.
  example: lcd_cursor_shift_right(3)
  or       lcd_cursor_shift_right(variable)
.
* lcd_clear:
  Write "20H" to DDRAM and set DDRAM address to "00H" from AC
  This will clear the display.
.
* lcd_home:
  Set DDRAM address to "00H" from AC and return cursor to its original
  position if shifted. The contents of DDRAM are not changed.
.
* lcd_cursor_blink_display(bit in cursor,bit in blink,bit in display):
  sets the underline cursor on/off, let the block-cursor blinking/off
  and puts the display on/off
  example: lcd_cursor_blink_display(on,off,on)
.
* lcd_clear_line ( byte in line  )
  clears the line [line] of the lcd including DDRAM data of that line
  example: lcd_clear_line(1)
.
* lcd_progress(byte in line, byte in amount)
  create a progress bar on line [line] with a lenght of [amout]
  example: lcd_progress(2,12)


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)
    
    

  • _hd44780_init()

    _hd44780_init - Initialise display (not realy internal, but not for users)
    
    This procedure is called from lcd_init of the interface used. lcd_init brings
    up the interface and powers up the display.
    This procedure sets the display in the pre-defined startposition (clear
    screen, no cursor etc).
    
    


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
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


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


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_pata_hard_disk.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.
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
16f8816f88_data_eeprom.jal
16f8816f88_remember_me.jal
18f24218f242_data_eeprom.jal
18f262018f2620_data_eeprom.jal



print

Writes variables to output device

Author Joep Suijs, Copyright (c) 2007..2008, all rights reserved.
Adapted-by Joep Suijs
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)


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:

16f648a16f648a_random.jal
16f648a16f648a_serial_hw_int_cts.jal
16f648a16f648a_serial_hardware.jal
16f648a16f648a_serial_print.jal
16f648a16f648a_backlight.jal
16f648a16f648a_i2c_sw_l1.jal
16f876a16f876a_adc.jal
16f876a16f876a_keyboard_lcd.jal
16f876a16f876a_t6603.jal
16f876a16f876a_sht.jal
16f876a16f876a_rtc_lcd.jal
16f876a16f876a_tc77.jal
16f87716f877_adc.jal
16f877a16f877a_print_serial_numbers.jal
16f877a16f877a_i2c_sw_l1.jal
16f877a16f877a_co2_t6603.jal
16f877a16f877a_serial_hardware.jal
16f877a16f877a_i2c_hw_slave_msg.jal
16f877a16f877a_backlight.jal
16f877a16f877a_serial_hw_int_cts.jal
16f877a16f877a_keyboard_lcd.jal
16f877a16f877a_rtc_lcd.jal
16f877a16f877a_i2c_hw_l1.jal
16f877a16f877a_random.jal
16f877a16f877a_serial_print.jal
16f877a16f877a_i2c_hw_slave_eeprom_simulator.jal
16f8816f88_serial_hardware.jal
16f8816f88_random.jal
16f8816f88_i2c_sw_l1.jal
16f8816f88_remember_me.jal
16f8816f88_adc_highres.jal
16f8816f88_print_serial_numbers.jal
16f8816f88_i2c_hw_slave_msg.jal
16f8816f88_i2c_hw_slave_eeprom_simulator.jal
16f8816f88_serial_print.jal
16f8816f88_backlight.jal
16f8816f88_serial_hw_int_cts.jal
16f8816f88_adc_lowres.jal
18f14k5018f14k50_i2c_hw_l1.jal
18f14k5018f14k50_serial_hardware.jal
18f14k5018f14k50_i2c_hw_slave_eeprom_simulator.jal
18f14k5018f14k50_serial_hw_int_cts.jal
18f14k5018f14k50_serial_print.jal
18f14k5018f14k50_usb_serial.jal
18f14k5018f14k50_i2c_sw_l1.jal
18f14k5018f14k50_random.jal
18f14k5018f14k50_i2c_hw_slave_msg.jal
18f14k5018f14k50_usb_hid_generic.jal
18f14k5018f14k50_usb_hid_mouse.jal
18f14k5018f14k50_usb_bootloader.jal
18f14k5018f14k50_usb_hid_keyboard.jal
18f14k5018f14k50_i2c_hw_l0.jal
18f245018f2450_i2c_sw_l1.jal
18f245018f2450_lcd_hd44780_4.jal
18f245018f2450_usb_hid_keyboard.jal
18f245018f2450_usb_serial.jal
18f245018f2450_random.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_usb_hid_mouse.jal
18f245018f2450_serial_hardware.jal
18f245018f2450_serial_print.jal
18f245018f2450_usb_bootloader.jal
18f245018f2450_serial_hw_int_cts.jal
18f455018f4550_i2c_hw_slave_eeprom_simulator.jal
18f455018f4550_usb_hid_keyboard.jal
18f455018f4550_usb_hid_generic.jal
18f455018f4550_i2c_hw_l0.jal
18f455018f4550_i2c_hw_slave_msg.jal
18f455018f4550_random.jal
18f455018f4550_serial_hardware.jal
18f455018f4550_serial_print.jal
18f455018f4550_i2c_hw_l1.jal
18f455018f4550_usb_serial.jal
18f455018f4550_usb_bootloader.jal
18f455018f4550_i2c_sw_l1.jal
18f455018f4550_lcd_hd44780_4.jal
18f455018f4550_serial_hw_int_cts.jal
18f455018f4550_usb_hid_mouse.jal



pwm_ccp1

hardware PWM control, dedicated to register CCP1

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

Description

performs PWM operations on CCP1
The target must support this.


Notes

this is a heavy refactoring of the original pwm_hardware.jal
Stef's lib


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm1_off()

    No documentation found

  • pwm1_set_percent_dutycycle(byte in percent)

    This procedure set duty cycle using a percentage
    According to what has been computed by pwm_set_frequency(),
    it converts the duty percent to a value suitable for the
    selected pwm frequency.
    

  • pwm1_set_dutycycle_highres(word in duty)

    sets dutycyle in high resolution mode
    the word passed to the procedure represents the high resolution value
    of the duty cycle:
     * duty1h<0:1> are the 2 LSbits
     * duty1h<2:9> are the 8 MSbits
    Because duty cycle is coded on 10 bits, the given value can't greater than 1024
    If not active yet, calling this procedure will enable PWM
    

  • pwm1_set_dutycycle(byte in duty)

    Sets dutycyle in low resolution mode.
    The 2 LSbits take their value from ccp1con_shadow, by default 0
    This means if duty1 = 0, there's no pwm, if duty1 = 255, you're closed to
    (but not at) the maximum pwm
    

  • pwm1_on()

    No documentation found

Functions


Related samples

No sample found


pwm_ccp2

hardware PWM control, dedicated to register CCP2

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

Description

performs PWM operations on CCP2
The target must support this.


Notes

this is a heavy refactoring of the original pwm_hardware.jal
Stef's lib


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm2_set_percent_dutycycle(byte in percent)

    This procedure set duty cycle using a percentage
    According to what has been computed by pwm_set_frequency(),
    it converts the duty percent to a value suitable for the
    selected pwm frequency.
    

  • pwm2_on()

    No documentation found

  • pwm2_off()

    No documentation found

  • pwm2_set_dutycycle(byte in duty)

    Sets dutycyle in low resolution mode.
    The 2 LSbits take their value from ccp2con_shadow, by default 0
    This means if duty2 = 0, there's no pwm, if duty2 = 255, you're closed to
    (but not at) the maximum pwm
    

  • pwm2_set_dutycycle_highres(word in duty)

    sets dutycyle in high resolution mode
    the word passed to the procedure represents the high resolution value
    of the duty cycle:
     * duty2h<0:1> are the 2 LSbits
     * duty2h<2:9> are the 8 MSbits
    Because duty cycle is coded on 10 bits, the given value can't greater than 1024
    If not active yet, calling this procedure will enable PWM
    

Functions


Related samples

No sample found


pwm_ccp3

hardware PWM control, dedicated to register CCP3

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

Description

performs PWM operations on CCP3
The target must support this.


Notes

this is a heavy refactoring of the original pwm_hardware.jal
Stef's lib


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm3_on()

    No documentation found

  • pwm3_set_dutycycle_highres(word in duty)

    sets dutycyle in high resolution mode
    the word passed to the procedure represents the high resolution value
    of the duty cycle:
     * duty3h<0:1> are the 2 LSbits
     * duty3h<2:9> are the 8 MSbits
    Because duty cycle is coded on 10 bits, the given value can't greater than 1024
    If not active yet, calling this procedure will enable PWM
    

  • pwm3_set_percent_dutycycle(byte in percent)

    This procedure set duty cycle using a percentage
    According to what has been computed by pwm_set_frequency(),
    it converts the duty percent to a value suitable for the
    selected pwm frequency.
    

  • pwm3_set_dutycycle(byte in duty)

    Sets dutycyle in low resolution mode.
    The 2 LSbits take their value from ccp3con_shadow, by default 0
    This means if duty3 = 0, there's no pwm, if duty3 = 255, you're closed to
    (but not at) the maximum pwm
    

  • pwm3_off()

    No documentation found

Functions


Related samples

No sample found


pwm_ccp4

hardware PWM control, dedicated to register CCP4

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

Description

performs PWM operations on CCP4
The target must support this.


Notes

this is a heavy refactoring of the original pwm_hardware.jal
Stef's lib


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm4_off()

    No documentation found

  • pwm4_set_percent_dutycycle(byte in percent)

    This procedure set duty cycle using a percentage
    According to what has been computed by pwm_set_frequency(),
    it converts the duty percent to a value suitable for the
    selected pwm frequency.
    

  • pwm4_on()

    No documentation found

  • pwm4_set_dutycycle_highres(word in duty)

    sets dutycyle in high resolution mode
    the word passed to the procedure represents the high resolution value
    of the duty cycle:
     * duty4h<0:1> are the 2 LSbits
     * duty4h<2:9> are the 8 MSbits
    Because duty cycle is coded on 10 bits, the given value can't greater than 1024
    If not active yet, calling this procedure will enable PWM
    

  • pwm4_set_dutycycle(byte in duty)

    Sets dutycyle in low resolution mode.
    The 2 LSbits take their value from ccp4con_shadow, by default 0
    This means if duty4 = 0, there's no pwm, if duty4 = 255, you're closed to
    (but not at) the maximum pwm
    

Functions


Related samples

No sample found


pwm_ccp5

hardware PWM control, dedicated to register CCP5

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

Description

performs PWM operations on CCP5
The target must support this.


Notes

this is a heavy refactoring of the original pwm_hardware.jal
Stef's lib


Dependencies


Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

  • pwm5_set_dutycycle_highres(word in duty)

    sets dutycyle in high resolution mode
    the word passed to the procedure represents the high resolution value
    of the duty cycle:
     * duty5h<0:1> are the 2 LSbits
     * duty5h<2:9> are the 8 MSbits
    Because duty cycle is coded on 10 bits, the given value can't greater than 1024
    If not active yet, calling this procedure will enable PWM
    

  • pwm5_set_dutycycle(byte in duty)

    Sets dutycyle in low resolution mode.
    The 2 LSbits take their value from ccp5con_shadow, by default 0
    This means if duty5 = 0, there's no pwm, if duty5 = 255, you're closed to
    (but not at) the maximum pwm
    

  • pwm5_on()

    No documentation found

  • pwm5_off()

    No documentation found

  • pwm5_set_percent_dutycycle(byte in percent)

    This procedure set duty cycle using a percentage
    According to what has been computed by pwm_set_frequency(),
    it converts the duty percent to a value suitable for the
    selected pwm frequency.
    

Functions


Related samples

No sample found


pwm_common

hardware PWM control, generic procedures

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

Description

this lib handles generic operation on PWM, 
whatever the channel number, etc...
It's aimed to be used with pwm_{register} lib (eg. pwm_ccp1.jal, ...)


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)

    initializes the PWM for high resolution (10 bits) and starts the PWM 
    While setting high resolution, prescaler can be used to adjust frequency. 
    The parameter corresponds to the prescaler value, and can be either:
      * 1 : high frequency
      * 4 : medium frequency
      * 16: low frequency
    
    Not all frequencies are available, you'll need the datasheet to actually
    compute the computed frequency according to the clock speed.
    
    FYI, here's a table showing frequency for common clock speed:
    
    ||*prescaler/clock* ||   *4MHz*   ||   *8MHz*   ||  *10MHz*   ||  *20MHz*   ||
    ||    1             ||    3.90kHz ||    7.81kHz ||   9.77kHz  ||   19.43kHz ||
    ||    4             ||     976Hz  ||    1.95kHz ||   2.44kHz  ||    4.88kHz ||
    ||    16            ||     244Hz  ||     488Hz  ||    610Hz   ||    1.22kHz ||
    
    

  • pwm_set_frequency(dword in freq)

    Initializes the PWM for accurate frequency and starts the PWM
    

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
Compiler >=2.4i

Description

just include this library if you want to use PWM.
Why this one ? It uses to conditional compile to selectively include
appropriate underlying pwm libs and number of PWM channels (up to 5),
according to the PIC configuration.



Ex: - 16f88 has 1 PWM channel: including pwm_hardware will configure PWM 
      for 1 channel (using pwm_ccp1.jal)
    - 16f877 has 2 PWM channels: including pwm_hardware will configure PWM
      for 2 channels (using pwm_ccp1.jal and pwm_ccp2.jal)



This is transparent for the user



Please refer to pwm_common, pwm_ccp1, pwm_ccp2, ... and pwm_ccp5 documentation
to understand how to use PWM.


Notes

this libraries uses conditional compilation. It requires
at least jalv2 2.4i compiler version


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:

16f877a16f877a_pwm_led.jal
16f8816f88_pwm_sound.jal
16f8816f88_ir_ranger_gp2d02.jal
16f8816f88_pwm_led_highres.jal
16f8816f88_pwm_led.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


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:

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


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 _rndx 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
16f877a16f877a_random.jal
16f8816f88_random.jal
18f14k5018f14k50_random.jal
18f245018f2450_random.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
Compiler >=2.4h

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. 


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



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_serial_hardware.jal
16f648a16f648a_serial_print.jal
16f648a16f648a_random.jal
16f648a16f648a_i2c_sw_l1.jal
16f648a16f648a_serial_format.jal
16f7716f77_adc_lowres.jal
16f876a16f876a_t6603.jal
16f876a16f876a_adc.jal
16f87716f877_pata_hard_disk.jal
16f87716f877_adc.jal
16f877a16f877a_serial_format.jal
16f877a16f877a_print_serial_numbers.jal
16f877a16f877a_random.jal
16f877a16f877a_serial_hardware.jal
16f877a16f877a_i2c_hw_slave_msg.jal
16f877a16f877a_co2_t6603.jal
16f877a16f877a_i2c_hw_l1.jal
16f877a16f877a_serial_print.jal
16f877a16f877a_i2c_sw_l1.jal
16f877a16f877a_i2c_hw_slave_eeprom_simulator.jal
16f877a16f877a_i2c_sw_master_echo.jal
16f8816f88_delay_basic.jal
16f8816f88_ir_ranger_gp2d02.jal
16f8816f88_random.jal
16f8816f88_i2c_sw_l1.jal
16f8816f88_remember_me.jal
16f8816f88_serial_hw_echo.jal
16f8816f88_adc_highres.jal
16f8816f88_i2c_sw_master_echo.jal
16f8816f88_print_serial_numbers.jal
16f8816f88_serial_print.jal
16f8816f88_i2c_hw_slave_msg.jal
16f8816f88_i2c_hw_slave_eeprom_simulator.jal
16f8816f88_serial_hardware.jal
16f8816f88_adc_lowres.jal
18f14k5018f14k50_i2c_hw_l1.jal
18f14k5018f14k50_serial_hardware.jal
18f14k5018f14k50_i2c_sw_master_echo.jal
18f14k5018f14k50_i2c_hw_slave_eeprom_simulator.jal
18f14k5018f14k50_serial_format.jal
18f14k5018f14k50_i2c_sw_l1.jal
18f14k5018f14k50_random.jal
18f14k5018f14k50_i2c_hw_slave_msg.jal
18f14k5018f14k50_serial_print.jal
18f14k5018f14k50_usb_hid_generic.jal
18f14k5018f14k50_usb_hid_mouse.jal
18f14k5018f14k50_usb_bootloader.jal
18f14k5018f14k50_usb_hid_keyboard.jal
18f14k5018f14k50_i2c_hw_l0.jal
18f245018f2450_i2c_sw_master_echo.jal
18f245018f2450_usb_hid_mouse.jal
18f245018f2450_usb_hid_keyboard.jal
18f245018f2450_serial_format.jal
18f245018f2450_serial_print.jal
18f245018f2450_random.jal
18f245018f2450_i2c_sw_l1.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_serial_hardware.jal
18f245018f2450_usb_bootloader.jal
18f455018f4550_i2c_hw_slave_eeprom_simulator.jal
18f455018f4550_usb_hid_keyboard.jal
18f455018f4550_usb_bootloader.jal
18f455018f4550_usb_hid_generic.jal
18f455018f4550_i2c_hw_slave_msg.jal
18f455018f4550_i2c_hw_l0.jal
18f455018f4550_serial_format.jal
18f455018f4550_serial_hardware.jal
18f455018f4550_i2c_sw_master_echo.jal
18f455018f4550_serial_print.jal
18f455018f4550_random.jal
18f455018f4550_i2c_hw_l1.jal
18f455018f4550_i2c_sw_l1.jal
18f455018f4550_usb_hid_mouse.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
       var  bit  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:

16f648a16f648a_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
18f455018f4550_serial_hw_int_cts.jal



serial_software

Software RS232 library

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

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 should be disabled during transmissions.
Transmission parameters are 8 databits, 2 stopbits, no parity, no handshake.


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:

16f8816f88_serial_sw_echo.jal



temperature_tc77

temp_TC77

Author Eur van Andel, eur@fiwihex.nl Copyright (c) 2008
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. 
This library assumes two pins: global bit SCK, wired to SCK of device and
global bit SIO,wired to SIO of device. SCK should be output, SIO input.
Writing the status_word is not supported here.


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:

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



unittest

unittests procedures

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

Description

set of procedures used to perform unittest


Dependencies

No dependency found



Summary

Global variables/contants

Procedures

Functions


API details

Global variables/contants

Procedures

Functions


Related samples

No sample found


usart_common

USART common

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

Description

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



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

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 (see also page 74/75 of DS40300B):
    {{{
    if TXSTA_BRGH = 0 (low speed)
     SPBRG = ( Fosc / ( 64 * Baudrate ) ) -1
    
    if TXSTA_BRGH = 1 (high speed)
     SPBRG = ( Fosc / ( 16 * 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.jal
18f14k5018f14k50_usb_hid_keyboard.jal
18f245018f2450_usb_hid_keyboard.jal
18f245018f2450_usb_bootloader.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_usb_hid_mouse.jal
18f455018f4550_usb_hid_keyboard.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.jal
18f14k5018f14k50_usb_hid_keyboard.jal
18f245018f2450_usb_hid_keyboard.jal
18f245018f2450_usb_bootloader.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_usb_hid_mouse.jal
18f455018f4550_usb_hid_keyboard.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.jal
18f14k5018f14k50_usb_hid_keyboard.jal
18f245018f2450_usb_hid_keyboard.jal
18f245018f2450_usb_bootloader.jal
18f245018f2450_usb_hid_generic.jal
18f245018f2450_usb_hid_mouse.jal
18f455018f4550_usb_hid_keyboard.jal
18f455018f4550_usb_bootloader.jal
18f455018f4550_usb_hid_mouse.jal
18f455018f4550_usb_hid_generic.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_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_usb_serial.jal