Serial sofware + hardware

22 views
Skip to first unread message

Chris Peeters

unread,
Nov 4, 2019, 7:59:45 AM11/4/19
to jallib
Hello all,

I'm struggling with the serial software library. My intention is to pass the data on the serial_hw_RX to the serial_sw_TX and the serial_sw_RX to the serial_hw_TX.
Just to pass through some data.

This block works.   
   if PIR1_RCIF == 1 then
        serial_hw_read(hwread)
        delay_10us(1)
        serial_sw_write(hwread)
        hwread = 0
    end if

And this one works:
   if serial_sw_read(swread) then
        delay_10us(1)
        serial_hw_write(swread)
        swread = 0
    end if

But not together. 
Does anyone know what the problem could be ?

Thnaks

Kind regards 
Chris Peeters


Uit_16F88_hwserial_naar_swserial.jal

Oliver Seitz

unread,
Nov 4, 2019, 11:31:23 AM11/4/19
to jal...@googlegroups.com
Hi! 

Serial_sw_read is blocking, the function will not return until a byte ist received. Serial_sw_read can only be used alone, you can't do anything else while waiting for a byte.


Greets
Kiste


Am Mo., Nov. 4, 2019 at 13:59 schrieb Chris Peeters
--
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 jallib+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jallib/9f3bd016-d6f7-411e-b034-f42e9a169b4f%40googlegroups.com.

Chris Peeters

unread,
Nov 5, 2019, 3:21:51 AM11/5/19
to jallib
Of course. If you are so focussed on the problem you not see the wood for the trees.
I've copied the serieal_read routine to my program and adapted it a bit.
The interrupt pin is now de serial_sw_Rx with interrupt on neg edge (startbit)
Works like a charm

Thanks for your help

Regards
Chris

Op maandag 4 november 2019 17:31:23 UTC+1 schreef Kiste:
Hi! 

Serial_sw_read is blocking, the function will not return until a byte ist received. Serial_sw_read can only be used alone, you can't do anything else while waiting for a byte.


Greets
Am Mo., Nov. 4, 2019 at 13:59 schrieb Chris Peeters
Hello all,

I'm struggling with the serial software library. My intention is to pass the data on the serial_hw_RX to the serial_sw_TX and the serial_sw_RX to the serial_hw_TX.
Just to pass through some data.

This block works.   
   if PIR1_RCIF == 1 then
        serial_hw_read(hwread)
        delay_10us(1)
        serial_sw_write(hwread)
        hwread = 0
    end if

And this one works:
   if serial_sw_read(swread) then
        delay_10us(1)
        serial_hw_write(swread)
        swread = 0
    end if

But not together. 
Does anyone know what the problem could be ?

Thnaks

Kind regards 
Chris Peeters


--
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 jal...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages