Jeremy Leach
Senior Member
Hi,
I'm trying to figure out why my comms isn't working between a master 18M2 and a slave 20M2. Both are set to 32MHz clock freq via SetFreq M32 command.
I'm only sending two bytes from my master : Serout c.6,N38400_32,("M",1)
The receiving 20M2 code is actually via the Serin pin : Serrxd [P_4000ms,Timeout],("M"),b6
The receiving code times out.
My understanding is that if the normal baud rate of the Serin pin using Serrxd is 4800 at 4MHz default clock freq, so it would be 4800 * 8 = 38400 at 32MHz clock. So I can't see anything wrong.
I've attached a picture of the received signal from my scope, but with a test of sending Serout c.6,N38400_32,(1,1).
The time to send one byte (10 bits taking acount of 1 start, 1 stop and 8 data bits) seems to be 0.33ms. So in 1 second this would be 1000/0.33 * 10 bits = 30303 bits (baud rate).
I might be miscalculating somehow or it might be the scope but this seems low compared to the 38400 it should be. So is it this?
Or is it that the picaxe can't receive properly using a qualifier at N38400_32.
Maybe I'm missing something obvious. Has anyone else used a qualifier successfully at N38400_32 ?
Thanks
I'm trying to figure out why my comms isn't working between a master 18M2 and a slave 20M2. Both are set to 32MHz clock freq via SetFreq M32 command.
I'm only sending two bytes from my master : Serout c.6,N38400_32,("M",1)
The receiving 20M2 code is actually via the Serin pin : Serrxd [P_4000ms,Timeout],("M"),b6
The receiving code times out.
My understanding is that if the normal baud rate of the Serin pin using Serrxd is 4800 at 4MHz default clock freq, so it would be 4800 * 8 = 38400 at 32MHz clock. So I can't see anything wrong.
I've attached a picture of the received signal from my scope, but with a test of sending Serout c.6,N38400_32,(1,1).
The time to send one byte (10 bits taking acount of 1 start, 1 stop and 8 data bits) seems to be 0.33ms. So in 1 second this would be 1000/0.33 * 10 bits = 30303 bits (baud rate).
I might be miscalculating somehow or it might be the scope but this seems low compared to the 38400 it should be. So is it this?
Or is it that the picaxe can't receive properly using a qualifier at N38400_32.
Maybe I'm missing something obvious. Has anyone else used a qualifier successfully at N38400_32 ?
Thanks
Attachments
-
34.5 KB Views: 19