Menu

FlashForth and MPLAB

mva2se
2007-11-16
2012-11-19
  • mva2se

    mva2se - 2007-11-16

    Hi.

    Sorry, but I can not get the code to compile under MPLAB and MPASMWIN. Are there any description somewhere on how to do this?

    I downloaded version 3.0, which by the way was only one big file which I had to cut apart myself. Then I created an 18F452 project in MPLAB, included the 18F452.inc file, but this gives 100+ errors or so.

     
    • Mikael Nordman

      Mikael Nordman - 2007-11-17

      Hi,
      Sorry for that.
      I am using linux and gpasm.

      Maybe som other FF user that knows MPLAB
      can help you.

      If you find only one file in the archive,
      You have a problem with the compression
      program.

      At least winrar can open the tgz file.

      -- Micke

       
    • mva2se

      mva2se - 2007-11-17

      Hi, and thanks for your prompt answer!

      About unzipping, I have tried WinRAR 3.71, but it only gives one, large file. I have also tried WinZip, but the same result.

      About to MPLab, I guess I have to try to tweak the project settings to get it to work. If anybody have experience with this, help is appreciated.

      Or, I can fire up my Linux-box, I guess that gpasm can produce a hex-file that works in MPLAB (since I only have the ICD2 for programming).

      Best regards
      /Mats Andreasen, Gothenburg

       
    • Mikael Nordman

      Mikael Nordman - 2007-11-17

      Hej Mats,
      I was playing with MPLAB a bit.

      Create a project with only the FlashForth_30.asm file.

      In the Assembler Macro definitions you have to add
      P18F252
      which takes care of all processors belonging
      to the 242/252/442/448 processor family.

      Then you have to update the P18F252.asm file
      to fit with your environment and preferences.

      -- Mikael

       
    • Pete Zawasky

      Pete Zawasky - 2007-11-17

      Hi Mats and Mikael,

      I have been using WinZip 9.0 on FF releases with no problems decompressing .tgz from Mikael.

      I have been using MPLAB all since May 2007, mostly for the Pic18F4520.

      1. Must assemble as linear file....not relocatable.

      2. Watch out for 'Bad Ram' addresses in the xxx.inc file.   Comment them out in the xxx.inc file.

      3. If  '; __CONFIG has been deprecated for PIC18 devices.  Use directive CONFIG.' appears, it is your choice to do nothing or change to the new CONFIG directive.

      4. For the PIC18F4520
         MPLAB -- in FF_30.mcp  I put FLashForth_30.asm in folder   Source Files
                                I put P18F4520.asm in folder    Other Files
               -- in Build Otions MPASM Assembler I select Use Alternate Settings and type in
                                /dP18F4520

      Pete  AG7C

       
    • w7net

      w7net - 2007-11-17

      Greetings all,

      I've been assembling FF using MPLAB V7.5 on w2k es xp with success by adding the following to FlashForth_Vnn.asm:

      #define P18Fnnnn  ; so far, i've been unable to configure MPLAB environment for automagic select of correct P18Fnnnn.asm  ??

               errorlevel -219,  -230  ; addresses issue with depreciated config spec and whining about other MPLAB changes.

      at the head of the file.

      Hope this helps,  73

      --
      joe

       
    • mva2se

      mva2se - 2007-11-18

      Hi all, and thanks for you help.

      - I managed to get it to work after unzipping with 'ZipGenius', (I guess Winzip 9.0 should have worked also, as noted above).
      - Then converting the source-files to Win (cr/lf) with 'Notepad++', otherwise 'mpasm' seems to complain.
      - After this it built in MPLAB, with the 'P18F252' switch, as mentioned above.
      - I programmed with ICD2 to a 'PICDEM-2' eva-kit from Microchip.
      - I Connected to Hyperterminal, and voila it worked right away, almost, I needed to uncheck 'Send line feed...' otherwise FlashForth seems to be confused by the extra lf. 
      - Sending Forth-source to FlashForth seems to work with HyperTerminal also, without extra delays, seems xon/xoff works correctly.
      - I also tried with the Windows-version of 'gpasm' and it works fine also.

      Nice work Mikael!

      Just one small question. 'forget' does not work, but it seems to be implemented in the source? Or have I missed something?

      Best regards
      /Mats

       
    • Mikael Nordman

      Mikael Nordman - 2007-11-19

      Hi Mats,
      Nice you got it to work.

      I downloaded the FF from SF and there was no need to
      covert the EOL to CR/LF with MPLAB 8.0.

      Did you compile forget ? It is not in the core.
      Forget refuses to forget words in the FF core.
      It should forget user defined words.

      Or maybe I have screwed it up.

      /Micke

       
    • mva2se

      mva2se - 2007-11-19

      Hi.

      Hmm, no, I still cant get forget to work. I have tried to compile the word from the core.fth file and it seems to compile correctly, but still forth refuses to recognise the word and only issues a question-mark. Strange.

      Maybe the problem is that I am running a 18F452 and the source is for 18F252. It is not a big problem, I can use cold instead.

      I also noticed a comment in the version history, that forget was removed because it was "unstable"?

      /Mats

       
    • Mikael Nordman

      Mikael Nordman - 2007-11-20

      Hej Mats,
      Forget works very well on all PICs I have tried.

      It could be that you have a bad individual of the chip.
      The Flash memories of the 3 digit pics have problems.

      What is your xtal frequancy ? Are you using the  PLL.
      It could be that changing the crystal frequency helps.

      I dont think there are any differences between 252 and 452
      that would require a code change regarding this issue.

      Forget was removed from the core because it cannot
      forget memory allocations in ram and eeprom.
      Marker can do that. And cold of course :-)

      Try the following

      cold COLD!O
      FlashForth V3.1

      test bl word latest @ find1 ; ok <16,2>
      ok <16,2>
      test test ok <16,2>2008 ffff
      ' test cfa>nfa nfa>lfa @ ok <16,2>2008 ffff 1f36
      ' marker cfa>nfa ok <16,2>2008 ffff 1f36 1f36

      Does test find the dictionary entry ?

      Does the other two rows return the same address?

      mvh Mikael

       
    • mva2se

      mva2se - 2007-11-20

      Hi.

      I have tried the snippets you showed, and it seems to work as you say. Test works, and the last two lines gives the same result.

      I run the cpu on 10MHz, but there might be some problem with the flash as you say, or some other error. I will try it on another board and with another cpu and see what happens. If I find what was wrong I will let you know.

      Anyway, I found that 'marker' does the same job, but better. I have not seen that word before, it been a while since I used Forth...

      Best
      /Mats

       

Log in to post a comment.