​ ​ ​ ​ Editor 6 and Terminal Window ???
Results 1 to 9 of 9

Thread: Editor 6 and Terminal Window ???

  1. #1
    Senior Member
    Join Date
    Jul 2014
    Location
    Earth - United States - Nevada - Las Vegas
    Posts
    115

    Default Editor 6 and Terminal Window ???

    Hi,

    When I send a little program down to the PICAXE 28X2 to simply send data back to the PC via the programming/download cable the terminal window doesn't open and if I manually open the terminal window it says the serial port is in use ??? What's wrong?

    ; 28X2+TerminalWindowTests.bas

    #picaxe 28X2 ; Define the Processor Type
    #terminal 9600

    let b1 = 65
    do
    sertxd("The data is ",#b1,13,10)
    pause 1000
    loop
    end
    Last edited by SolidWorksMagi; 03-08-2018 at 14:24.

  2. #2
    Senior Member
    Join Date
    Jan 1970
    Location
    Perth, Western Australia
    Posts
    4,482

    Default

    I have not had the same problem but I'm using Version 6.0.9.1 of the PICAXE Editor. What version are you using? And what operating system does your host computer use?

    Try adding a pause at the start of your program to allow the terminal window time to open:
    Code:
    ; 28X2+TerminalWindowTests.bas
    
    #picaxe 28X2 ; Define the Processor Type
    #terminal 9600
    
    Pause 1000              '<<<<<<<<<<<<<<<
    symbol b1
    
    let b1 = 65
    do
       sertxd("The data is ",#b1,13,10)
       pause 1000
    loop
    end 

  3. #3
    Senior Member
    Join Date
    Jul 2014
    Location
    Earth - United States - Nevada - Las Vegas
    Posts
    115

    Default

    Hi,

    I am using version 6.0.9.3 in Windows 10.

    I just added the pause 1000 and it works for the shorter program. Weird!

    But when I added even a pause 3000 in a much larger program I don't get the Terminal window. Something is really wrong with the editor.

  4. #4
    Senior Member
    Join Date
    Jan 1970
    Location
    Nova Scotia, Canada
    Posts
    2,853

    Default

    Quote Originally Posted by SolidWorksMagi View Post
    ... when I added even a pause 3000 in a much larger program I don't get the Terminal window
    You haven't used SETFREQ to set a higher frequency before the pause, have you? If you have, then you need to adjust the pause to account for the increased speed. For instance, if you have used "SETFREQ m16", then you would need "PAUSE 8000" to have a two-second pause (which is what I typically use before any SERTXD).

    If you continue to have problems, post your code.

  5. #5
    Senior Member
    Join Date
    Jul 2014
    Location
    Earth - United States - Nevada - Las Vegas
    Posts
    115

    Default

    Hi,

    There is no SETFREQ ... I am using the basic PICAXE 28X2 module the code is in the very first post for the SERTXD problem, however, the actual sertxd I'm using is to send a bunch of data to the Terminal window on the PC from a camera module. For some reason the larger program doesn't open the Terminal window while the cut down versions of the program do still using the same header and variables etc...

    #picaxe 28X2 ; Define the Processor Type
    #terminal 9600
    pause 1000

    Symbol RX_PIN = C.3
    Symbol RX_BAUD = T9600

    symbol i = b0
    symbol range = b15

    do
    SerIn RX_PIN, RX_BAUD, ($AA), b1, b3,b2, b5,b4, b7,b6, b9,b8, b11,b10, b13,b12

    sertxd("The data is ",#b1,13,10)
    pause 1000
    loop
    end

  6. #6
    Senior Member
    Join Date
    Jan 1970
    Location
    Nova Scotia, Canada
    Posts
    2,853

    Default

    Are you sure you are getting to your SERTXD? (That is, past the blocking SERIN qualifier of $AA?) Sure that your incoming serial is 9600 baud and idles high? Can you see the serial on a terminal on your PC (e.g., with putty)?

    Try changing "pause 1000" to "pause 2000" and follow that immediately with 'sertxd("Starting",cr,lf)'.

    You may do well to have a timeout on your SERIN.

  7. #7
    Senior Member
    Join Date
    Jul 2014
    Location
    Earth - United States - Nevada - Las Vegas
    Posts
    115

    Default

    Hi,

    Interesting, when I added the 'sertxd("Starting",cr,lf)' after the #terminal 9600 in the larger program, then the terminal window opened.

    Now I still need to do some more work with the camera, but I'm hoping this resolves the problem for this and future programs. Thanks!


    #picaxe 28X2 ; Define the Processor Type
    #terminal 9600
    pause 3000
    sertxd("Starting",cr,lf)

    Symbol RX_PIN = C.3
    Symbol RX_BAUD = T9600

    symbol i = b0
    symbol range = b15

    do
    SerIn RX_PIN, RX_BAUD, ($AA), b1, b3,b2, b5,b4, b7,b6, b9,b8, b11,b10, b13,b12

    gosub routines4a
    loop

    routines4a:
    really big program
    return
    end

  8. #8
    Senior Member
    Join Date
    Jan 1970
    Location
    Nova Scotia, Canada
    Posts
    2,853

    Default

    Note that it's unlikely that adding SERTXD at the beginning of your program solved any problems--it just revealed that the problem isn't where you thought it was. I'd still put another SERTXD immediately after your SERIN to make sure that you are actually receiving what you think you are.

  9. #9
    Technical Support
    Join Date
    Jan 1970
    Location
    UK
    Posts
    24,438

    Default

    Not really sure what is going on. The serial terminal opens immediately after download if it is going to be opened, not when the first data is sent from the PICAXE. It should open even if no data is ever sent.

    The serial terminal only appearing when the first SERTXD is executed would however be expected when simulating rather than downloading.

    It could be there was some DEBUG command in the larger program which opened the debugging link after download, and in that case it won't auto-launch the Terminal.

    Manually opening the Terminal does report the port is already being used for debugging, shows the Terminal window anyway, but doesn't show any data because the port isn't actually opened for the Terminal. Attempting to open the port within Terminal will again produce the port already being used for debugging message.

    It is done this way so one can debug the PICAXE but also watch serial data on another port.

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •