| |
simple1.pwp
//-------------------------------------------------------------------------
//
// PicoWeb Project File for Simple LED Control
//
//-------------------------------------------------------------------------
//
// application-specific preprocessor definitions
//
#define BANNER "\r\nPicoWeb WebLED\r\n"
#define EEPROM_IP /* use file "ip" for IP address */
#define ENABLE_WATCHDOG /* use Atmel watchdog timer hardware */
#define DEBUGGER /* include debugger firmware */
#define SERIAL_BAUD_DIVISOR 25 /* serial port speed: 19200 baud @ 8 MHz */
//
// application-specific HTML and image file names
//
simple1.htm // ii00 (default Web page)
simple2.htm // ii01
simple3.htm // ii02
simple4.htm // ii03
//
// application-specific CGI routines
//
led_on.cgi // iu00 (turn LED on)
led_off.cgi // iu01 (turn LED off)
led_pulse.cgi // iu02 (pulse LED on)
//
// included application-specific pcode and/or AVR assembly language follows
//
#avr_reset
;--------------------------------------------------------------------------
; this code is executed each time microcontroller is reset
;--------------------------------------------------------------------------
;
sbi ddrd,LED_BIT ; make LED driver pin an output
#avr_slow
;--------------------------------------------------------------------------
; this code is executed each trip through "slow idle" loop (~1 sec period)
;--------------------------------------------------------------------------
;
#avr_fast
;--------------------------------------------------------------------------
; this code is executed each trip through "fast idle" loop
;--------------------------------------------------------------------------
;
#avr_asm
;--------------------------------------------------------------------------
; application-specific CGI pcode and AVR assembly routines go here
;--------------------------------------------------------------------------
.eseg
led_off: ; drive LED bit high
pmovb buf,PORTD+0x20 ; get PORTD state
#ifdef NO_PORWI
pandwi buf,~(1<<LED_BIT) ; OR in LED bit
pxorwi buf,1<<LED_BIT
#else
porwi buf,1<<LED_BIT ; OR in LED bit
#endif
pmovb PORTD+0x20,buf ; write back updated PORTD state
pret
led_on: ; drive LED bit low
pmovbi buf,PORTD+0x20 ; get PORTD state
pandwi buf,~(1<<LED_BIT) ; mask off in LED bit
pmovb PORTD+0x20,buf ; write back updated PORTD state
pret
led_pulse:
pcall led_off
pcall my_delay
pcall led_on
pcall my_delay
pcall led_off
pret
my_delay:
pmovwi buf,0xff ; set delay loop count
my_loop:
pwdr ; reset watchdog timer
pdecw buf ; decrement counter
pjumpne my_loop ; loop back if not down to zero
pret
Back
|
|
|