Menu

Serial comms with Scamp3 .. funny character after "ok" prompt

2023-11-07
2023-11-22
1 2 > >> (Page 1 of 2)
  • Bernard Mentink

    Bernard Mentink - 2023-11-07

    Hi, I have just bought a scamp3 from Udamonic in order to play with pic24. However I can't seem to get any code sent to it with ff-shell.tcl , I get funny characters in the terminal window .. see screenshot.
    Are the line endings not right for the scamp3? i.e CR,LF

    I don't get the same effect with linux "screen"

    Also is there any Linux/Macos code to flash these things (without purchasing pickit 5, I have a pickit2)
    Thanks.

     

    Last edit: Bernard Mentink 2023-11-07
  • Mikael Nordman

    Mikael Nordman - 2023-11-08

    ff-shell.tcl does not understand the VT100 codes. Maybe you can turn them off by changing the prompt to a do-nothing prompt.

    ' chars is prompt  \ ok+CRLF
    ' .st is prompt    \ ok+FF prompt+CRLF
    ' cr.s is prompt   \ ok+Scamp VT100 prompt+CRLF  ?????
    

    You need a pickit to flash that chip.

    BTW FF5.2 is not from me. It is from John Catsoulis... I don't know what modifications he has done.

     

    Last edit: Mikael Nordman 2023-11-08
  • Bernard Mentink

    Bernard Mentink - 2023-11-08

    Many Thanks, that helps. I can upload fine, but had to add 1ms delay per word, did not have to do that with atmega328. I guess your build supports the PIC24FJ64GB202 as well?

    Another quick question, do you support the PIC24FJ64GU205 used in the EV10K72A curiosity board? I have just purchased one ... or do I have to tweak the source code a bit and rebuild for that one?

     
    • Mikael Nordman

      Mikael Nordman - 2023-11-08

      PIC24FJ64GB202 should build after you add a section in configs.c.

      PIC24FJ64GU205 will not work out the box. You need to add a section in configs.c and in ff24.inc and construct a suitable config.inc file. That chip has the same (or similar) flash write commands as the 24E chips, where you have to write 2 (16-bit) words at a time.
      The flash has ECC which I have not designed any support for.

      Check this thread. Jose tried but did not report back with success.
      https://sourceforge.net/p/flashforth/discussion/726813/thread/e8e34b8e3e/

       
      • Mikael Nordman

        Mikael Nordman - 2023-11-10

        Actually, FF compiles out of the box for PIC24FJ64GU205. I looked the 202 part which does not compile out of the box. The problem that Jose had was the USB did not come up even tough the USB peripheral should be the same as on the PIC24FJ64GB202.

        In p24fj_ga_config.inc you have to

        ; Define the UART used for the operator
        .equ OPERATOR_UART, 3        ; 1 or 2 or 3=USB interface(USB_CDC=1)
        

        in order to get the USB terminal as default.
        But that does not affect if USB connection comes up or not.

        The code starts up in my MPLABX simulator and idles in RXU.

         
        • Mikael Nordman

          Mikael Nordman - 2023-11-10

          I had a look in the configs.c file and for the PIC24FJ64GU205 these lines must be updated in order for the USB to get right clock.

          // FOSCSEL
          #pragma config FNOSC = FRCPLL           // Oscillator Source Selection (Fast RC Oscillator with divide-by-N with PLL module (FRCPLL) )
          #pragma config PLLMODE = PLL96DIV2      // PLL Mode Selection (96 MHz PLL. Oscillator input is divided by 2 (8 MHz input))
          
           

          Last edit: Mikael Nordman 2023-11-10
  • Bernard Mentink

    Bernard Mentink - 2023-11-14

    Thanks, will give it a try, just received the hardware ..

     
  • Bernard Mentink

    Bernard Mentink - 2023-11-14

    Hmm, seems the latest version of MPLAB-X will not run correctly on WIN7 ... and that is the only platform I have to build on. My other machines are MacOS M1 and linux ..

     
    • Mikael Nordman

      Mikael Nordman - 2023-11-14

      MPLAB-X works fine on linux and I suppose on OSX also.

      I also uploded the changes to git, so hopefully that code should work on PIC24FJ64GU205 just by selecting the chip in MPLABX, compile and flash the chip.

       

      Last edit: Mikael Nordman 2023-11-14
      • Fred Zelders

        Fred Zelders - 2023-11-15

        Yes, MPLAB-X works on macOs / Mac mini M2 perfectly.

         
        • Bernard Mentink

          Bernard Mentink - 2023-11-15

          The Microchip web site says x86 only macos, does not support arm64, so how did you install it?

          From their website:

          MPLAB X IDE only supports computers with processors designed with Intel® 64 or AMD® 64-bit architectures.

           

          Last edit: Bernard Mentink 2023-11-15
          • Fred Zelders

            Fred Zelders - 2023-11-15

            I downloaded and ran the macos installer: MPLABX-v6.15-osx-installer.dmg
            MPLAB X IDE v6.15 runs perfect on my Mac mini M2.

             
            • Bernard Mentink

              Bernard Mentink - 2023-11-15

              Thanks .. working see below :)

               
              👍
              1
  • Bernard Mentink

    Bernard Mentink - 2023-11-14

    When I say Linux, I mean linux server ... headless. MPLAB won't run on arm64 M1 on macos only x86
    :(

     
  • Bernard Mentink

    Bernard Mentink - 2023-11-14

    Thanks for uploading the code changes. I will see if I can do something with a virtual machine on MACOS .. seems I can only install arm64 windows on macos virtual machine. So I am stumped, as there is no arm64 install of MPLABX

     

    Last edit: Bernard Mentink 2023-11-14
  • Bernard Mentink

    Bernard Mentink - 2023-11-15

    Ok, I got MPLAB X going on the MACOS M1, it seems it is dual architecture .. shame the info on the Microchip website is so misleading :)

    So I compiled the code and programmed the Curiosity Nano board, then connected to the other USB port and obtained the Forth prompt.

    However, typing anything like words or doing any other action, just does nothing, just returns the prompt. Is there anything else I need to do to get this board working?

    I have added screenshot of project Dashboard, let me know if you want any other logs ... (Build etc)

     
    👍
    2

    Last edit: Bernard Mentink 2023-11-15
    • Mikael Nordman

      Mikael Nordman - 2023-11-15

      It is really hard to say what is wrong without having the actual chip.
      At least the USB seems to be working which is good.
      Does inputting numbers work ?

      The list to file option needs to be selected in order for the assembler to compile the FF code correctly. See attached picture. There has been a bug in the assembler since the start (2010) that magically disappears with that option.
      Also I have seen indications of another compiler bug which caused problems. It magically disappears by inserting some extra NOPs or alignment directives.
      Both bugs have caused faulty code to be generated by XC16.

       
      • Bernard Mentink

        Bernard Mentink - 2023-11-15

        No inputting numbers does not work. I have done the "List to file" option for the assembler.
        No difference. See console operation:

        ok<#,ram>
        ok<#,ram>
        ok<#,ram>
        words ok<#,ram>
        ok<#,ram>
        ok<#,ram>
        23 . ok<#,ram>
        23 ok<#,ram>
        . ok<#,ram>
        ok<#,ram>

         

        Last edit: Bernard Mentink 2023-11-15
        • Mikael Nordman

          Mikael Nordman - 2023-11-16

          You could try to set WANT_X,1 in the config file. Or .palign 0x800,0xff somewhere near the beginning of the code. Those helped on the 24FJ64GB204 chip to make XC16 generate working code.

           
          • Bernard Mentink

            Bernard Mentink - 2023-11-16

            Hi Mikael, tried both of those, no difference I am afraid.

             
  • Bernard Mentink

    Bernard Mentink - 2023-11-15

    BTW, Is the following correct for FJ devices?

    ;;; Different flash write logic for E devices than HJ or FJ devices
    ;;; Double word instead of single word write.
    .equ PIC2433E, 1

    That's in p24fj_ga_config.inc

     
    • Mikael Nordman

      Mikael Nordman - 2023-11-15

      That's correct for the 24FJ64GU devices. Although I cannot verify that it works since I do not have the device.

       

      Last edit: Mikael Nordman 2023-11-15
  • Bernard Mentink

    Bernard Mentink - 2023-11-16

    Just a minor point, in the following should the flash size be 0xaf00 ?

    .ifdef __24FJ64GU205
    .equ FLASH_SIZE,     0xa800
    .equ RAM_SIZE,       0x2000
    .include "p24fj_ga_config.inc"
    .endif
    

    The manual has 0xaf00 as the end of flash. Should that change, or are you reserving some for Forth.
    I also notice this device has no eeprom, does that matter?

     

    Last edit: Bernard Mentink 2023-11-16
    • Mikael Nordman

      Mikael Nordman - 2023-11-16

      0xaf00 would be right here. 0xa800 was copy paste from another chip where config bits were documented in the flash block starting with 0xa800.
      The last flash block contains the device configuration bits. On this chip those are in the in the block starting with 0xaf00. The FLASH_SIZE is used for protecting those bits from accidental writes.

       
  • Bernard Mentink

    Bernard Mentink - 2023-11-16

    Have you tried building with XC16 v2.10 ? I notice you have v1.50, maybe there are differences?
    Also my mplab-x is v6.15, yours was v6.00 .. that is less important I guess.

     

    Last edit: Bernard Mentink 2023-11-16
1 2 > >> (Page 1 of 2)

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.