Menu

Ser1Print and Ser1Send command

Help
JB
2024-04-24
2025-05-15
<< < 1 2 (Page 2 of 2)
  • Anobium

    Anobium - 2024-04-27

    I think you are confused.

    Ser1Print 254 or Ser1Print 128 will send the byte value as string.
    Ser1Send 254 or Ser1Send 128 will send the raw number.

     
  • JB

    JB - 2024-04-27

    I guess I can use it as it is.

    Also I made a mistake while writing the code :
    omit the "ms" after "#DEFINE Ser1PrintInterCharDelay"

     

    Last edit: JB 2024-04-27
  • Anobium

    Anobium - 2024-04-27

    As I cannot see the actual code changes made in the .H file. I am not what is happening but the correct sytnax would be #DEFINE SER1_TXDELAY 1 ms. Note SER1 is used not SERR1 and the 1 ms.

     
  • JB

    JB - 2024-04-27

    Many Thank's Evan,
    Case Closed!
    (my mistake), back to normal, (with your modif for softserialch1.h)
    my regards.

    did the test with "#DEFINE SER1_TXDELAY 1"
    and it's running fast and accurate for all 4 x lines x 20 chr.
    for "ser1send" and "Ser1Print"

    ; Ser1Print "ABCDEFabcdef" TEST
    ; work ok
    ;
    #option explicit
    #chip tiny10, 1 ;1Mhz only
    #DEFINE SYSDEFAULTCONCATSTRING 0
     ; ----- Include library
        #include <SoftSerial.h>
    
        ; ----- Config Serial UART for sending:
        #define SER1_BAUD 4800     ; baudrate must be defined
        #define SER1_TXPORT PORTB  ; I/O port (without .bit) must be defined
        #define SER1_TXPIN 0       ; portbit  must be defined
        #define SER1_INVERT On     ; Polarity inverted On/Off
        #DEFINE SER1_TXDELAY 1     ; Tx delay for String.
    
    
    pause 50
    ser1send 255
    ser1send 8   ;LCD BackLight On
    
    do
    
    pause 500
    ser1send 254 ; must clear LCD first
    ser1send 1
    
    ;pause 50
    ser1send 254
    ser1send 128  ;Line 1
    Ser1Print "ABCDEFGHIJKLMNOPQRST"
    
    ser1send 254
    ser1send 192  ;Line 2
    Ser1Print "12345678901234567890"
    
    ser1send 254
    ser1send 148  ;Line 3
    Ser1Print "abcdefghijklmnopqrst"
    
    ser1send 254
    ser1send 212  ;Line 4
    Ser1Print "stuvwxyz()*<>?,./+[]"
    
    loop
    
     

    Last edit: JB 2024-04-27
    • Anobium

      Anobium - 2024-04-28

      Please upload your revised .H to this thread. I will update the Master code based. I will also update the Help.

      Else, you will lose these changes in the next release.

      Note. When you get the next update of GCSTUDIO your changes may be overwritten. So, save the .H somewhere safe ( another folder), update GCSTUDIO and then put your adapted .H back.


      Re code. Very nice and clean. And, we now know it woks on real silicon. :-)

       
      • JB

        JB - 2024-04-28

        here's the edited softserialch1.h

        I did what your recommended as for saving the .H file before any update, then started GCStudio, then the automatic update , and tried to compile again the latest code, and I've got a Text scrambling LCD see pic.

        Then I copy the .H file back , re-compile and everything is working

        Thank you Evan for the excellent support.

         

        Last edit: JB 2024-04-28
        • Anobium

          Anobium - 2024-04-28

          Thank you.

          I have updated Ser1, Ser2 and Ser3 with the same approach.
          I have updated the Help also. See https://github.com/GreatCowBASIC/Help/blob/main/source/relevantconstants3.adoc
          Build 1387 will have this new feature.

          27/04/2025 1387 New RS232 N/A Yes PIC/AVR/LGT Completed New: Add SerNDelay to routines to improved for serial devices that required intra byte processing time.[]

          Your name is now added to the GCBASIC contributors.

          Thank you.

           

          Last edit: Anobium 2024-04-28
  • JB

    JB - 2024-04-27

    Also my BitDefender found something about "GCBasicFloatCalculator.exe"

     

    Last edit: JB 2024-04-27
    • Anobium

      Anobium - 2024-04-27

      This is a false positive. Add, an exclusion to the checker.

      The program was specifically written in assembler for GCBASIC. We plan to rewrite in C to enable code signing in the near future.

       
  • JB

    JB - 2024-04-27

    and this

     
  • JB

    JB - 2024-04-27

    Good News..
    Thanks again Evan, for your help.

     
  • JB

    JB - 2024-05-04

    Hello,
    I've edited the "SoftSerialch1.h" as thinking for a greater control over the delay between sent bytes.
    What is your opinion, and could this be of any help.
    Thanks.
    In the .h file I used this:

    '#IFDEF Ser1_TXDELAYus
    wait Ser1_TXDELAYus us
    #ENDIF
    #IFDEF Ser1_TXDELAYms
    wait Ser1_TXDELAYms ms
    #ENDIF

    In GCStudio:
    ; ----- Config Serial UART for sending:
    #define Ser1_BAUD 4800 ; baudrate must be defined
    #define Ser1_TXPORT PORTB ; I/O port (without .bit) must be defined
    #define Ser1_TXPIN 0 ; portbit must be defined
    #define Ser1_INVERT On ; Polarity inverted On/Off
    ;#define Ser1_TXDELAY 250 ; Tx delay
    ;#define Ser1_TXDELAYms 1 ; Tx delay
    ;#define Ser1_TXDELAYus 250 ; Tx delay

    and here's the timing for both sequence:
    
     

    Last edit: JB 2024-05-04
  • Anobium

    Anobium - 2024-05-04

    I would need to actual .h file. Then, I can compare to the change I uploaded the other day.

     
  • Anobium

    Anobium - 2024-05-04

    I would need to actual .h file. Then, I can compare to the change I uploaded the other day.

     
  • JB

    JB - 2024-05-04

    here's the "SoftSerialch1.h"

     
  • Anobium

    Anobium - 2024-05-05

    Here at the released files. I have updated to support the constants you added.
    All three are updated.

    I have updated the Help, again. See the bottom of the table https://github.com/GreatCowBASIC/Help/blob/main/source/relevantconstants3.adoc

    Update you installation with these three files.

    The constants are:

    SER1_TXDELAY, SER2_TXDELAY, SER3_TXDELAY
    SER1_TXDELAYms, SER2_TXDELAYms, SER3_TXDELAYms, same as SERn_TXDELAY
    SER1_TXDELAYus, SER2_TXDELAYus, SER3_TXDELAYus

     
  • JB

    JB - 2024-05-05

    Many Thanks for the great support.

     
<< < 1 2 (Page 2 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.