Author: [email protected]
Date: Wed Mar 18 12:26:11 2009
New Revision: 868
Added:
trunk/test/board/board_18f4550_af.jal
trunk/test/peripheral/usb/test_usb_cdc.jal
- copied, changed from r865,
/trunk/test/peripheral/usb/usb_test_cdc.jal
trunk/test/peripheral/usb/test_usb_hid_generic.jal
- copied, changed from r865,
/trunk/test/peripheral/usb/usb_hid_generic_test.jal
trunk/test/peripheral/usb/test_usb_hid_keyboard.jal
- copied, changed from r865,
/trunk/test/peripheral/usb/usb_hid_keyboard_test.jal
trunk/test/peripheral/usb/test_usb_hid_mouse.jal
- copied, changed from r865,
/trunk/test/peripheral/usb/usb_hid_mouse_test.jal
Removed:
trunk/include/peripheral/usb/usb_board.jal
trunk/test/peripheral/usb/usb_hid_generic_test.jal
trunk/test/peripheral/usb/usb_hid_keyboard_test.jal
trunk/test/peripheral/usb/usb_hid_mouse_test.jal
trunk/test/peripheral/usb/usb_test_cdc.jal
Log:
reorganized USB library files, sample file are now generated based on board
description file
Added: trunk/test/board/board_18f4550_af.jal
==============================================================================
--- (empty file)
+++ trunk/test/board/board_18f4550_af.jal Wed Mar 18 12:26:11 2009
@@ -0,0 +1,130 @@
+-- ------------------------------------------------------
+-- Title: BOARD FILE for [see filename]
+-- Author: Albert Faber, Copyright (c) 2008..2008, all rights reserved.
+-- Adapted-by:
+-- Compiler: >=2.4g
+--
+-- This file is part of jallib (http://jallib.googlecode.com)
+-- Released under the BSD license
(http://www.opensource.org/licenses/bsd-license.php)
+--
+-- Description: This file defines the configuration of a specific
test-board.
+-- --
+-- BOARD DESCRIPTION
+-- -----------------
+-- --
+-- This file is the setup for my homebrew, PICDEM like 18f4550 board
+-- The board consist of a reset button switch to gnd (tided to pin1, with
4k7 pull up)
+-- A program button switch to gnd (tided to pin37, with 4k7 pull up)
+-- A 20 MHz external crystal and 15pf caps connected to OSC1/2
+-- pin 18 (Vusb) with a 220 nF capacitor to the ground
+-- The connection between PC and the 18F4450
+-- +5v to power the board
+-- data- wire to pin 23 (D-)
+-- data+ wire to pin 24 (D+)
+-- ground wire to the Vss of the PIC
+--
+-- In addition, a MAX232 chip connccted to the USART pins, for serial
(mainly to debug)
+-- communication.
+-- The board is loaded with the standard microchip bootloader, therefore
the examples
+-- are compiled with the following JAL compiler flags: -loader18 -no-fuse
+--
+-- Sources:
+-- Sources: http://www.microchip.org for PICDEM docs
+--
+-- Notes:
+--
+-- ------------------------------------------------------
+
+-- This board is used as a reference while generating samples
+;@jallib preferred
+
+;@jallib section chipdef
+-- chip setup
+include 18f4550
+
+-- even though the external crystal is 20 MHz, the configuration is such
that
+-- the CPU clock is derived from the 96 Mhz PLL clock (div2), therefore set
+-- target frequency to 48 MHz
+pragma target clock 48_000_000
+
+
+-- fuses
+pragma target PLLDIV DIVIDE_BY_5__20MHZ_INPUT_
+pragma target CPUDIV _OSC1_OSC2_SRC___1__96MHZ_PLL_SRC___2_
+pragma target USBPLL CLOCK_SRC_FROM_96MHZ_PLL_2
+pragma target OSC HS_PLL
+pragma target FCMEN DISABLED
+pragma target IESO DISABLED
+pragma target PWRTE DISABLED -- power up timer
+pragma target VREGEN ENABLED -- USB voltage regulator
+pragma target VOLTAGE V20 -- brown out voltage
+pragma target BROWNOUT DISABLED -- no brownout detection
+pragma target WDTPS P32768 -- watch dog saler
setting
+pragma target WDT DISABLED -- no watchdog
+pragma target CCP2MUX RC1 -- CCP2 pin
+pragma target PBADEN DIGITAL -- digital input port<0..4>
+pragma target LPT1OSC DISABLED -- low power timer 1
+pragma target MCLR EXTERNAL -- master reset on RE3
+pragma target STVR DISABLED -- reset on stack
over/under flow
+pragma target LVP DISABLED -- no low-voltage
programming
+pragma target ENICPORT DISABLED -- In circuit debugger
+pragma target XINST ENABLED -- extended instruction
set
+pragma target BACKBUG DISABLED -- background debugging
+pragma target CP_0 DISABLED -- code block 0 not
protected
+pragma target CP_1 DISABLED -- code block 1 not
protected
+pragma target CP_2 DISABLED -- code block 2 not
protected
+pragma target CP_3 DISABLED -- code block 3 not
protected
+pragma target CPB DISABLED -- bootblock code not
write protected
+pragma target CPD DISABLED -- eeprom code not
write protected
+pragma target WRT_0 DISABLED -- table writeblock 0
not protected
+pragma target WRT_1 DISABLED -- table write block 1
not protected
+pragma target WRT_2 DISABLED -- table write block 2
not protected
+pragma target WRT_3 DISABLED -- table write block 3
not protected
+pragma target WRTB DISABLED -- bootblock not write
protected
+pragma target WRTD DISABLED -- eeprom not write
protected
+pragma target WRTC DISABLED -- config not write
protected
+pragma target EBTR_0 DISABLED -- table read block 0 not
protected
+pragma target EBTR_1 DISABLED -- table read block 1 not
protected
+pragma target EBTR_2 DISABLED -- table read block 2 not
protected
+pragma target EBTR_3 DISABLED -- table read block 3 not
protected
+pragma target EBTRB DISABLED -- boot block not protected
+
+
+;@jallib section led
+-- LED IO definition
+var bit led is pin_b3
+var bit led_direction is pin_b3_direction
+var bit led2 is pin_b1
+var bit led2_direction is pin_b1_direction
+
+;@jallib section serial
+const serial_hw_baudrate = 115_200
+
+
+
+;@jallib section lcd_hd44780_4
+-- LCD IO definition
+var bit lcd_rs is pin_b4 -- LCD command/data select.
+var bit lcd_rs_direction is pin_b4_direction
+var bit lcd_en is pin_b0 -- LCD data trigger
+var bit lcd_en_direction is pin_b0_direction
+
+var byte lcd_dataport is porta_low -- LCD data port
+var byte lcd_dataport_direction is porta_low_direction
+const byte LCD_ROWS = 2 -- 2 lines
+const byte LCD_CHARS = 16 -- 16 chars per line
+
+;@jallib section i2c
+-- I2C io definition
+var volatile bit i2c_scl is pin_b4
+var volatile bit i2c_scl_direction is pin_b4_direction
+
+-- b3 is pin-compatible with 16f648a board file, b1 is on hardware pins
+;var volatile bit i2c_sda is pin_b3
+;var volatile bit i2c_sda_direction is pin_b3_direction
+var volatile bit i2c_sda is pin_b1
+var volatile bit i2c_sda_direction is pin_b1_direction
+
+;@jallib section ccp
+-- ccp setup
+var volatile bit pin_ccp1_direction is pin_b3_direction
Copied: trunk/test/peripheral/usb/test_usb_cdc.jal (from r865,
/trunk/test/peripheral/usb/usb_test_cdc.jal)
==============================================================================
--- /trunk/test/peripheral/usb/usb_test_cdc.jal (original)
+++ trunk/test/peripheral/usb/test_usb_cdc.jal Wed Mar 18 12:26:11 2009
@@ -52,11 +52,37 @@
--
--
+;@jallib use chipdef
+include delay
+;@jallib section serial
+
+
+-- whether or not using the serial port
+const HAS_SERIAL_DEBUG_PORT = 1
+
+if defined( HAS_SERIAL_DEBUG_PORT ) == true then
+
+ const serial_hw_baudrate = 115_200
+
+ include serial_hardware
+ include format
+ include print
+
+ -- intialze serial device
+ serial_hw_init()
+
+ procedure serial_print_spc() is
+ serial_hw_write( " " )
+ end procedure
+
+ procedure serial_newline() is
+ serial_hw_write( 10 )
+ -- serial_hw_write( 13 )
+ end procedure
+end if
--- note, include order is important
-include usb_board
-- uncomment lines for debugging
const bit USB_DEBUG = false
Copied: trunk/test/peripheral/usb/test_usb_hid_generic.jal (from r865,
/trunk/test/peripheral/usb/usb_hid_generic_test.jal)
==============================================================================
--- /trunk/test/peripheral/usb/usb_hid_generic_test.jal (original)
+++ trunk/test/peripheral/usb/test_usb_hid_generic.jal Wed Mar 18 12:26:11
2009
@@ -24,8 +24,38 @@
--
-- compiled with following flags: -loader18 -no-fuse -no-variable-reuse
--- note, include order is important
-include usb_board
+;@jallib use chipdef
+
+include delay
+
+;@jallib section serial
+
+-- whether or not using the serial port
+const HAS_SERIAL_DEBUG_PORT = 1
+
+if defined( HAS_SERIAL_DEBUG_PORT ) == true then
+
+ const serial_hw_baudrate = 115_200
+
+ include serial_hardware
+ include format
+ include print
+
+ -- intialze serial device
+ serial_hw_init()
+
+ procedure serial_print_spc() is
+ serial_hw_write( " " )
+ end procedure
+
+ procedure serial_newline() is
+ serial_hw_write( 10 )
+ -- serial_hw_write( 13 )
+ end procedure
+end if
+
+
+
const bit USB_DEBUG = false
const bit USB_DEBUG_HIGH = false
Copied: trunk/test/peripheral/usb/test_usb_hid_keyboard.jal (from r865,
/trunk/test/peripheral/usb/usb_hid_keyboard_test.jal)
==============================================================================
--- /trunk/test/peripheral/usb/usb_hid_keyboard_test.jal (original)
+++ trunk/test/peripheral/usb/test_usb_hid_keyboard.jal Wed Mar 18 12:26:11
2009
@@ -23,8 +23,38 @@
--
--
--- note, include order is important
-include usb_board
+;@jallib use chipdef
+
+include delay
+
+;@jallib section serial
+
+
+-- whether or not using the serial port
+const HAS_SERIAL_DEBUG_PORT = 1
+
+if defined( HAS_SERIAL_DEBUG_PORT ) == true then
+
+ const serial_hw_baudrate = 115_200
+
+ include serial_hardware
+ include format
+ include print
+
+ -- intialze serial device
+ serial_hw_init()
+
+ procedure serial_print_spc() is
+ serial_hw_write( " " )
+ end procedure
+
+ procedure serial_newline() is
+ serial_hw_write( 10 )
+ -- serial_hw_write( 13 )
+ end procedure
+end if
+
+
const bit USB_DEBUG = false
const bit USB_DEBUG_HIGH = false
Copied: trunk/test/peripheral/usb/test_usb_hid_mouse.jal (from r865,
/trunk/test/peripheral/usb/usb_hid_mouse_test.jal)
==============================================================================
--- /trunk/test/peripheral/usb/usb_hid_mouse_test.jal (original)
+++ trunk/test/peripheral/usb/test_usb_hid_mouse.jal Wed Mar 18 12:26:11
2009
@@ -23,8 +23,40 @@
--
--
--- note, include order is important
-include usb_board
+;@jallib section board_description
+
+
+;@jallib use chipdef
+
+include delay
+
+;@jallib section serial
+
+-- whether or not using the serial port
+const HAS_SERIAL_DEBUG_PORT = 1
+
+if defined( HAS_SERIAL_DEBUG_PORT ) == true then
+
+ const serial_hw_baudrate = 115_200
+
+ include serial_hardware
+ include format
+ include print
+
+ -- intialze serial device
+ serial_hw_init()
+
+ procedure serial_print_spc() is
+ serial_hw_write( " " )
+ end procedure
+
+ procedure serial_newline() is
+ serial_hw_write( 10 )
+ -- serial_hw_write( 13 )
+ end procedure
+end if
+
+
const bit USB_DEBUG = false
const bit USB_DEBUG_HIGH = false
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---