Announcement

Collapse
No announcement yet.

Odd behaviour using UART

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Odd behaviour using UART

    Hi, i have a uLCD-32PT usign it in GFX mode. A microcontroller sends information to the LCD in order to show the information on the screen. I am still developing and trying the 4DGL software so i am downloading it into the RAM. When i connect RX0 to the microcontroller, workshop doesnt recognize the LCD in order to download the program to RAM. But if i connect it to TX0 it works ok. I am using a connector i made myself because i cant find a connector for this. It maybe is a shortcircuit? Or something wrong?
    Thanks

  • #2


    It's unclear exactly what you are doing, can you show us a circuit diagram?

    You are aware that TX and RX need to be swapped at the 'interface', aren't you?
    Mark

    Comment


    • #3


      Yeah i know that about TX and RX. The PIC receive all the information from the LCD but the PIC cant send information to the LCD because i cant program it. I have discovered something, the problem is maybe a shortcircuit or something like that because if i disconnect the cable from the PIC (no from the LCD) it works ok, if i put the pin through a 10K resistor to +5V or GND i works too so the problem seems to be in the connection to the PIC it is directly connected:
      LCD RX0 PIC RX
      All is supplied by a 5V 5A power supply. Does the LCD have internally pull up resistors for UART?
      Thanks

      Comment


      • #4


        Are you trying to connect to you Pic and Workshop at the same time? You can't do that as TX is always active and there will be a fight between TXs
        Mark

        Comment


        • #5


          Hoooo nooo can i use the same TX and RX pins i use to program the LCD? I am using the COM0 port of the LCD pins 27 and 29 to comunicate whit the PIC, the PIC doesnt send information until the LCD send first and ACK to indicate that it is on, then the PIC responds whit another ACK.

          Comment


          • #6


            You have two com ports on the display, so you can use both simultaneously.

            You just can't connect one com port to multiple TXs. This is an RS232 (regardless of +-12v 0-5v or 0-3.3v levels) restriction.

            If you want to use Com0 for both programming and your PIC you are going to need to switch TXs so you don't have two connected at the same time
            Mark

            Comment


            • #7


              Hooo ok i write the program into flash and then disconnect the serial connector and it worked fine . Just a question... What is the limit of write cycles of the flash memory?

              Comment


              • #8


                Hmm, you should get at least 10,000, but you don't want to get complacent, it's amazing how quickly they clock up
                Mark

                Comment


                • #9


                  Ok thanks but loading the program in RAM there is no limit right?

                  Comment


                  • #10


                    Correct
                    Mark

                    Comment


                    • #11


                      Dumb question can you interface a GPS module with a stamp ? If so where do you download the program codes ?

                      Comment


                      • #12


                        Gee, is this a left field post or what?

                        I presume it's a question about our GPS modules, so I imagine that if a Stamp can receive 4800 serial then yes, it would be possible to interface our GPS module with a stamp.

                        As for code, well that is up to the user to write, it shouldn't be that hard
                        Mark

                        Comment


                        • #13
                          I am doing a frequency meter, a microcontroller read the frequency and then send it through the UART number by number to the LCD. It is the piece of PIC program which sends the frequency:for(n=0;FREQ[n]!='\0';++n){ putc(FREQ[n]); }putc(0x00); //end of lineFREQ is an array where i save the frequency value. The PIC is sending the frequency ok but the LCD always returns -1 whit serin():Init:com_Init(combuffer,40,0); com_SetBaud(COM0,960); Receive:for(n:=0,k:=0x48;k!=0x00 k := serin(); //take char from buffer
                          txt_MoveCursor(0,0); //debug
                          print("k = ",k);

                          if(k > 0)
                          frec[n] := k;
                          ++n;
                          endif
                          pause(200);
                          next
                          frec[n] := 0x00;

                          txt_MoveCursor(0,0); //debug
                          print("Fk = ",k);
                          pause(500);

                          serin() always return -1 and for bucle doesnt exit when it finds 0x00 it just break in the first character received it seems. I saw the examples and i dont know what i am doing wrong. I have a previous rutine sendind ACK and NAK and works great ut when i have to send the frequency it get always -1. Hope u can help me.
                          Thanks

                          Comment


                          • #14


                            Are you sure that FREQ is not empty?
                            Mark

                            Comment


                            • #15
                              Yeah because whithout frequency it sends 0x48 ('0') and then 0x00 ('\0') that is the strange. Any opinion?

                              Comment

                              Working...
                              X