Menu

[Help] Problem with 2nd Software Serial PIC12F675

2023-05-19
2023-05-20
  • Roamir Williams

    Roamir Williams - 2023-05-19

    Hi

    Im trying code to comunicate a PIC12F675 with a GSM SIM800L, this is my first code:

     #chip 12F675, 4
     #option Explicit
     #include <SoftSerial.h>
    
      #DEFINE RELE      GPIO.0
      #DEFINE DEBUG_TXD GPIO.1
      #DEFINE CALL_INT  GPIO.2
      #DEFINE DEBUG_RXD GPIO.3
      #DEFINE GSM_RXD   GPIO.4
      #DEFINE GSM_TXD   GPIO.5
    
      DIR RELE      OUT
      DIR DEBUG_TXD OUT
      DIR CALL_INT  IN
      DIR DEBUG_RXD IN
      DIR GSM_RXD   IN
      DIR GSM_TXD   OUT
    
        #define SER1_BAUD 9600     ; baudrate must be defined
        #define SER1_TXPORT GPIO  ; I/O port (without .bit) must be defined
        #define SER1_TXPIN 1       ; portbit  must be defined
        #define SER1_RXPORT GPIO  ; I/O port (without .bit) must be defined
        #define SER1_RXPIN 3       ; portbit  must be defined
    
        #define SER2_BAUD 9600     ; baudrate must be defined
        #define SER2_TXPORT GPIO  ; I/O port (without .bit) must be defined
        #define SER2_TXPIN 5       ; portbit  must be defined
        #define SER2_RXPORT GPIO  ; I/O port (without .bit) must be defined
        #define SER2_RXPIN 4       ; portbit  must be defined
    
        wait 500 ms
        Ser1Print "Debug Port"  'send a text
        wait 500 ms
        Ser2Print "GSM Port"  'send a text
    
        END
    

    The first Software Serial works fine but the Second Send Garbage, Anyone can help me?

    Thanks for you Help.

     
  • Anobium

    Anobium - 2023-05-20

    No expert here ... but,

    Does Ser2 work when Ser1 is not configured?
    If you flip the serial ports from Ser2 to Ser1 does that work ?

    I just looked at the ASM. Looks good comparing Ser1 to Ser2 routines. So, try the changes above as this will inform us.

     

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.