DATA statements with PIC16F88


Results 1 to 2 of 2

Threaded View

  1. #1

    Default DATA statements with PIC16F88

    I am using PBP2.50c with MCSP 3.0.0.5 with MPASM 5.03. The target PIC is the 16F88.

    I always try and store the latest program revision number in the first 50 or so bytes of EEROM and display this on startup. It works a treat with 18F4620 which is my main PIC chip.

    I now find code that works fine on the 18F4620 will not work at all on the 16F88.

    The following code should output repeatedly two different lines of text. The first should be the data stored in EEROM locations 0 to 54 and the second line should be "This is a test of the TouchPad serial output".

    All I get is the second line with the software revision line being just a string of blank or unprintable characters.

    Are there any special requirements for the DATA statement with a PIC16F88?

    <code>
    data @0, 13, 10, "TouchPad v0.00 26 July 2009 ", 13, 10

    ' Device = PIC16F88
    ' Programmed with MeLabs Serial (USB) programmer.
    ' Configuration set to:-
    ' IntRC(IntIO2), WDT_OFF, PWRT_ON, MCLR_ON, BOR_ON, LVP_OFF,
    ' Flash Pgm Mem Write_ON, CCP multiplexed with RB0, CODE not protected
    ' Data EEPROM not protected, Fail safe clock monitor disabled,
    ' Int/Ext switch over disabled


    DEFINE OSC 8
    DEFINE DEBUG_REG PORTA 'Debug pin port
    DEFINE DEBUG_BIT 0 'Debug output pin bit
    DEFINE DEBUG_BAUD 19200 'Debug baud rate
    DEFINE DEBUG_MODE 0 'Debug mode: 0 = True, 1 = Inverted
    DEFINE DEBUGIN_REG PORTB 'Debugin pin port
    DEFINE DEBUGIN_BIT 3 'Debugin pin bit
    DEFINE DEBUGIN_MODE 0 'Debugin mode: 0 = True, 1 = Inverted
    define Char_Pacing 2000


    '************************* Variable allocation *******************
    A var byte
    B var byte

    '************************* initialise *******************************
    Initialise:
    ANSEL = %00000000 ' set all pins to digital
    TRISA = %00000000 ' all outputs
    TRISB = %01111110 ' mixed I/O
    CMCON = %00000111 ' comparators OFF
    OSCCON = %01110000 ' select 8 MHz
    ' OSCTUNE = %00100000 'minimum freq
    ' OSCTUNE = %00011111 'maximum freq
    OSCTUNE = %00001011 'experiment to give exactly 20 uSec high period.

    'SetOscTune:
    ' porta.0 = 1
    ' pauseus 20 'Scoped with Tektronix digital CRO for 20.0 uS
    ' porta.0 = 0
    ' pauseus 50
    ' goto setosctune

    ShowRevision:
    for a = 0 to 53
    read a,b 'read first 54 locations in EEROM
    debug b 'display EEROM contents
    next a
    pause 1000
    debug 13, 10, "This is a test of the TouchPad serial output", 13, 10
    pause 1000

    goto showrevision
    </code>
    Last edited by BrianT; - 29th July 2009 at 02:47.

Similar Threads

  1. Using Nokia LCD
    By BobP in forum mel PIC BASIC Pro
    Replies: 300
    Last Post: - 3rd May 2018, 04:47
  2. Read/Write Problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th February 2010, 01:51
  3. Big characters on HD44780 4x20
    By erpalma in forum mel PIC BASIC Pro
    Replies: 23
    Last Post: - 7th January 2007, 02:21
  4. LCD + bar graph
    By DynamoBen in forum mel PIC BASIC Pro
    Replies: 13
    Last Post: - 5th October 2005, 14:50
  5. Sinus calculating !
    By Don Mario in forum mel PIC BASIC Pro
    Replies: 29
    Last Post: - 28th November 2004, 23:56

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