javahits.pwp


//-------------------------------------------------------------------------
//
// PicoWeb Project File for CLOCK
//
//-------------------------------------------------------------------------
//
// application-specific preprocessor definitions
//
#define BANNER "\r\nPicoWeb Java Clock\r\n"
#define EEPROM_IP         /* use file "ip" for IP address */
#define NET_CONFIG_IP     /* allow IP address reconfiguration via net */
#define ENABLE_WATCHDOG   /* use Atmel watchdog timer hardware */
#define DEBUGGER          /* include debugger firmware */

//#define CLOCK 8000000
#define CLOCK 7372000     /* processor clock rate (Hz) */
#define BAUD_RATE 19200   /* serial port baud rate */

//
// application-specific HTML and image file names
//
javahits.htm    // (default Web page)
hits.class      // (Java Applet)
hits.htm        // (returns HTML page with ACSII temp reading)

//
// application-specific CGI routines
//
hits.cgi        // (returns ASCII temperature reading (deg-f)

//
// application-specific assmbly language files
//
//mycode.asm

//
// included application-specific pcode and/or AVR assembly language follows
//
#avr_reset
;--------------------------------------------------------------------------
; this code is executed each time microcontroller is reset
;--------------------------------------------------------------------------
;
    clr r17                 ; clear hits counter
    sts hit_count,r17
    sts hit_count+1,r17

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

;--------------------------------------------------------------------------
.data
hit_count:   .skip   2

.cseg
hits:
    pincw hit_count               ; bump hit counter
    pmovwi buf,[hit_count]        ; move into buf
    pprintswi [buf]               ; output as decimal ascii
    pret

Back