Hi Majid, Did your scross the wires? So TX of PIC1 is connected to the RX of PIC2 and the RX of PIC1 is connected to the TX of PIC2?
Also. I you want to test if the data is transmitted between the PICs, first minimize your program to see if that works before adding all other code. I changed your code and simplified it to test the communication only if a button is pressed on PIC1 it sends "1"to PIC2 and the LED on PIC1 goes off. If PIC2 receives a "1" the LED on PIC2 goes on. If a button is pressed on PIC2 it sends "2" to PIC1 and the LED on PIC2 goes off. If PIC1 receives a "2" the LED on PIC1 goes on. If this works then you know your communication is working. See attached simplified programs. I did not test this since I do not have the hardware but the program speaks for itself. Kind regards, Rob ________________________________ Van: [email protected] <[email protected]> namens majid ebru <[email protected]> Verzonden: dinsdag 20 april 2021 18:23 Aan: jallib <[email protected]> Onderwerp: Re: [jallib] How to send & receive data with interrupt in RS232 please help me this is important for me majid ebru در تاریخ سهشنبه ۲۰ آوریل ۲۰۲۱ ساعت ۲۰:۵۰:۴۸ (UTC+4:30) نوشت: i downloaded last version JALlib Thanks but i yet can't send and receive data between two PICs i clear my program please see again my program i send data from pic number 2 (B7.jal) to pic number 1(A7.jal) when i pressed button1 from pic1 , i send data with use "serial_hw_write(255)" to pic2 . majid ebru در تاریخ سهشنبه ۲۰ آوریل ۲۰۲۱ ساعت ۱۹:۵۴:۴۵ (UTC+4:30) نوشت: I download jallib from github I download jallib JALPack 2.4.o 0 0.9.0.9 from just another language site Where should I download new jallib?! majid ebru در تاریخ سهشنبه ۲۰ آوریل ۲۰۲۱ ساعت ۱۹:۵۲:۱۰ (UTC+4:30) نوشت: [20210420_194852~01.jpg] sorry ,i can't edit my post so i should send new post. i just want send and receive data between two PIC majid ebru در تاریخ سهشنبه ۲۰ آوریل ۲۰۲۱ ساعت ۱۹:۴۲:۵۶ (UTC+4:30) نوشت: when i use your program , i have some Error ----------------------- Compilation started at :4/20/2021 6:41:55 PM jal 2.4o (compiled May 8 2011) [Error] (lib/serial_hw_int_cts.jal) [Line 357] "serial_overflow_discard" not defined [Error] (lib/serial_hw_int_cts.jal) [Line 357] ')' expected (got 'serial_overflow_discard') [Warning] (lib/serial_hw_int_cts.jal) [Line 357] boolean expression expected [Error] (lib/serial_hw_int_cts.jal) [Line 357] 'then' expected (got 'serial_overflow_discard') [Warning] (lib/serial_hw_int_cts.jal) [Line 357] boolean expression expected Compiler CommandLine: C:\JALPack2\compiler\jalv2.exe "G:\Project\PCB\Temp\Temp_JAL_2\Temp_A_1\A7_USART\A7_1.jal" -s "C:\JALPack2\lib" -no-variable-reuse Errors :3 Warnings :1 majid ebru در تاریخ سهشنبه ۲۰ آوریل ۲۰۲۱ ساعت ۱۹:۴۰:۱۱ (UTC+4:30) نوشت: Thank you very very much to answer i attache two pic program i read your update [email protected] در تاریخ سهشنبه ۲۰ آوریل ۲۰۲۱ ساعت ۱۸:۵۹:۴۴ (UTC+4:30) نوشت: Hi Majid I find the code difficult to read and you are doing too much here. Some observations: * You include the same library more than once, you should not do that. * The serial interrupt routine is part of the library so you do not need it here * Your program uses an interrupt routine so you expect that it is called becauses there is an interrupt routine in the serial library but this is not a good practice. I do not know if it is your intention to do stuff in an interrupt routine otherwise I would just move it to the main loop and put the check (this is not a wait) using ' if serial_hw_read(your_data)' in your main program. I did some cleanup of your program but since I do not understand what you are trying to achieve it might be wrong. Kind regards, Rob ________________________________ Van: [email protected] <[email protected]> namens majid ebru <[email protected]> Verzonden: dinsdag 20 april 2021 15:23 Aan: jallib <[email protected]> Onderwerp: Re: [jallib] How to send & receive data with interrupt in RS232 hi again can any body say me what is my wrong?? Compilation started at :4/20/2021 4:48:38 PM jal 2.4o (compiled May 8 2011) [Error] (lib/serial_hw_int_cts.jal) [Line 224] "serial_ctsinv" not defined [Error] (lib/serial_hw_int_cts.jal) [Line 224] 'end' expected (got 'serial_ctsinv') [Error] (lib/serial_hw_int_cts.jal) [Line 224] {IF starts at C:\JALPack2\lib/serial_hw_int_cts.jal:214} [Error] (lib/serial_hw_int_cts.jal) [Line 224] "serial_ctsinv" not defined [Error] (lib/serial_hw_int_cts.jal) [Line 224] 'end' expected (got 'serial_ctsinv') [Error] (lib/serial_hw_int_cts.jal) [Line 224] {IF starts at C:\JALPack2\lib/serial_hw_int_cts.jal:212} [Error] (lib/serial_hw_int_cts.jal) [Line 224] "serial_ctsinv" not defined [Error] (lib/serial_hw_int_cts.jal) [Line 224] 'end' expected (got 'serial_ctsinv') [Error] (lib/serial_hw_int_cts.jal) [Line 224] {procedure starts at C:\JALPack2\lib/serial_hw_int_cts.jal:206} [Error] (lib/serial_hw_int_cts.jal) [Line 224] "serial_ctsinv" not defined [Error] (lib/serial_hw_int_cts.jal) [Line 224] unexpected token: "serial_ctsinv" Thank you -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/d03b52e4-da68-46ce-873a-7849b0d3b697n%40googlegroups.com<https://groups.google.com/d/msgid/jallib/d03b52e4-da68-46ce-873a-7849b0d3b697n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]<mailto:[email protected]>. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/bbb797c2-641c-4c1c-be65-24bf65a0da56n%40googlegroups.com<https://groups.google.com/d/msgid/jallib/bbb797c2-641c-4c1c-be65-24bf65a0da56n%40googlegroups.com?utm_medium=email&utm_source=footer>. -- You received this message because you are subscribed to the Google Groups "jallib" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/AM0PR07MB62416C0E8C8A5BCEBB04E448E6489%40AM0PR07MB6241.eurprd07.prod.outlook.com.
<<attachment: Small_Demo.zip>>
