EPP mode parallel port comms


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: EPP mode parallel port comms

    Thanks Dave, but thats where my brain gets foggy. For instance I can see how I would put a timer value in the EEPROM, then read it at boot time. But what if the user doesn't want to use the timer at all? Do I have an IF NoTimer then skip the timer section? And then would this get checked every time through the loop? that seems like the wrong way to implement it. But I can't think how to do it.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: EPP mode parallel port comms

    I think this is something like you want. It is quick and dirty with ON INT
    Code:
    '  18F6680  24FC1025
    '<FL_PIC18F6680>'
        DEFINE OSC 20
        @ __CONFIG    _CONFIG1H, _OSC_HS_1H
        @ __CONFIG    _CONFIG2H, _WDT_OFF_2H & _WDTPS_128_2H
        @ __CONFIG    _CONFIG4L, _LVP_OFF_4L
        DEFINE LCD_DREG     PORTG
        DEFINE LCD_DBIT     0
        DEFINE LCD_RSREG    PORTE
        DEFINE LCD_RSBIT    0
        DEFINE LCD_EREG     PORTE
        DEFINE LCD_EBIT     1
        DEFINE LCD_BITS     4
        DEFINE LCD_LINES    4
        DEFINE LCD_COMMANDUS    3000
        DEFINE LCD_DATAUS   150
        PAUSE 1000
        DPIN    VAR PORTB.2    'I2C DATA PIN
        CPIN    VAR PORTB.1    'I2C CLOCK PIN
        ADDR    VAR WORD
        DATI    VAR BYTE[45]
        DATO    VAR WORD
    
        BOOT:
        LCDOUT $FE,1,"BOOTING"
        ADDR = 1
        'FOR TESTING DO A WRITE/READ TO THE EEPROM
        'CHANGE THE VALUE IN I2CWRITE TO TURN THE
        'TIMER ON OR OFF... THE SAME CAN BE DONE
        'FOR T0CON FOR DIFFERENT PWM
        I2CWRITE DPIN,CPIN,$A0,ADDR,[1]
        PAUSE 100
        I2CREAD DPIN,CPIN,$A0,ADDR,[INT_VAR]
        PAUSE 100
        INT_VAR VAR BYTE
        INTCON.5 = INT_VAR    'ENABLE/DISABLE TMR0
        T0CON = %10000000
        ON INTERRUPT GOTO TLOOP
    
        MAIN:
        LCDOUT $FE,1,"RUNNING"
        PAUSE 100
        GOTO MAIN
    
        DISABLE
        TLOOP:
        INTCON.2=0:TOGGLE PORTG.4
        RESUME: ENABLE
    Dave
    Always wear safety glasses while programming.

  3. #3
    Join Date
    Aug 2010
    Location
    Maryland, USA
    Posts
    869


    Did you find this post helpful? Yes | No

    Default Re: EPP mode parallel port comms

    Thanks Dave, starting to have the fog clear a little now.
    -Bert

    The glass is not half full or half empty, Its twice as big as needed for the job!

    http://foamcasualty.com/ - Warbird R/C scratch building with foam!

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts