Menu

ProgramWrite only for specific chips?

Help
2019-05-08
2019-05-17
  • Gert vd Walt

    Gert vd Walt - 2019-05-08

    I wrote a program in Picbasic Pro that stored settings in the flash for a 12f1571. I want to make a similar program in GCB because my trail period for PBP expired but get the following error when trying to compile the program:

    eeprom.h (303): Error: Incorrect parameters in Set, expected: Set variable.bit status
    eeprom.h (324): Error: Incorrect parameters in Set, expected: Set variable.bit status

    The current program tests if it works and sends the result to the serial port (attached)

    tx

     
    • Anobium

      Anobium - 2019-05-08

      We should be able to help.

      What version of Great Cow BASIC?

       
  • Gert vd Walt

    Gert vd Walt - 2019-05-08

    latest and greatest 0.98.05

     
    • Anobium

      Anobium - 2019-05-08

      No errors here. Please post the ASM .

       
  • Gert vd Walt

    Gert vd Walt - 2019-05-08

    here you go

     
  • Gert vd Walt

    Gert vd Walt - 2019-05-08

    seems like I posted the wrong program, sorry. this is the correct one:

     
  • Gert vd Walt

    Gert vd Walt - 2019-05-08

    I had all the programread and write commands commentes out in search of the problem in the first post. the last one I posted is the one that gives the errors. sorry, my bad

     
  • Gert vd Walt

    Gert vd Walt - 2019-05-08

    and the "serout" should be commented out, it is from PBP

     
  • Anobium

    Anobium - 2019-05-09

    The 12f1571 is HEF capable MCU. Use the HEF library as this is intended to correctly handle HEF. This MCU has no EEPROM.

    HEF is 128bytes, therefore you can use addresses 0 to 127. An example.

    #chip 12f1571, 4
     #option explicit                     ' all variables must be declared !
    
     dim adval as word
     HEFWrite (127,0x55)   'write 0x55 to HEF location 127
     HEFRead (127,adval)   'read location 127 to variable. 
    

    If you have the ASM from the 'other' programming language for this MCU then I would like to see it. I think (note think) this MCU requires a memory block wrrite operation and this is implemented for HEF but not for ProgramWrite - which I guess we should support.

     
  • Chris Roper

    Chris Roper - 2019-05-17

    It is optimised for space and performance, but you would need to use the accompanying initialisation etc.
    The Old Software serial routines are there for backwards compatibility.
    The Optimised routines should be used for new code.
    The choice is yours but it is all or nothing, you shouldn't mix and match.

     
  • Anobium

    Anobium - 2019-05-17

    Ser1send differ from Sersend

    What a good question. Ser1Send essentially does the same as SerSend but Ser1Send can support faster communication rates, more channels, lower memory usages and a lot easier to setup.

    I am sure others will chime in so give more insights but yesterday I choose Ser1Send as I wanted it to work 'out of the box' and I did not want to study the constants required to make SerSend work. :-)

     
    • Chris Roper

      Chris Roper - 2019-05-17

      Likewise I am Using Ser3Send as I needed a port that was rarely but easily used.
      if anything it is easier to set up than a USART and is perfect at 19200 Baud so far, I could probably push it higher.
      I wanted PortA.0 and PortA.1 as my Tx and Rx Pins so the total initialisation code was:

        #define SER3_TXPORT PORTA
        #define SER3_TXPIN  0
        #define SER3_RXPORT PORTA
        #define SER3_RXPIN  1
       #define SER3_BAUD 19200
       wait 5 s ' Time to setup the terminal
       Ser3Print "Hello World!"
      

      You can't get much easier than that.

       

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.