Menu

eeadr and eedata error

2009-08-07
2013-05-30
  • Nobody/Anonymous

    #chip 16F916, 4 'mhz
    #config OSC=INTOSC, MCLRE=off, WDT=off
    #mem 256 'Chip has 128 bytes
    EEADRH = 1

    lcdcon = 0
    dim temp as byte
    dim temp2 as byte
    dir portc.0 in 'serial
    #define RecAHigh portc.0 on
    #define RecAlow portc.0 off
    Initser 1,r2400, 1+waitforstart, 8, 1, none, normal

    main:
    SerReceive 1, temp
    SerReceive 1, temp2
    EPWrite(temp,temp2)
    goto main

    I get symbol not defined eeadr, eedata?

     
    • Nobody/Anonymous

      Look! You are using the wrong syntax for the write command.  Read the help file.

       
    • Nobody/Anonymous

      from the help file:

      Syntax:   
          EPWrite (location, data)

      Explanation:
      EPWrite is used to write information to the EEPROM data storage, so that it can be accessed later by a programmer on the PC, or by the EPRead command. location represents the location to read data from, and varies from one chip to another. data is the data that is to be written to the EEPROM, and can be a value or a variable.

      Example:
          'This program will take a measurement from Analog Input 2 every
          'second, and then log the reading to EEPROM for future access.
          DataPosition = 1
          Main:
              EPWrite(DataPosition, ReadAD(AN2))
              DataPosition = DataPosition + 1
          goto Main

      It looks right to me, what so you see that I don't?

       
    • J Olson

      J Olson - 2009-08-09

      Not that this will help but I have never used a variable as the address.  I have always used a literal number for the address like the following example and I call out each storage location this way.

      EPRead (400, Y_Reg_Lo)
      EPRead (401, Y_Reg_Mid)
      EPRead (402, Y_Reg_Hi)

      Jz

       
    • Nobody/Anonymous

      I need to use a varible for the location can this be done?

       
    • Hugh Considine

      Hugh Considine - 2009-08-12

      Yes, using the variable for the location should work fine.

       
    • Nobody/Anonymous

      but why do i get the errors when i compile it?

       
    • Hugh Considine

      Hugh Considine - 2009-08-14

      What version of GCBASIC do you have there? There is a bug in the 0.9.3.0 release, that I know will cause that error. However, I'm pretty sure it's fixed in the update patch, which you can get from http://gcbasic.sourceforge.net/update.html

      Also, if you downloaded the version of GCBASIC that includes gputils, make sure that you're using the latest version of gputils. This is available at http://gputils.sourceforge.net/

       
    • Nobody/Anonymous

      that did it, thanks

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.