Blazemaguire
Senior Member
Hi
I've been reading scary things about the error on the serial transmission rates for the 20x2 and 20m2 chips... annoyingly I have brought 2 of both for my first forage into the 'new picaxe' and am not sure if they are the cause of the problems I'm having, or if it's me being stupid as i'm totally new to serial communication. ( - I've only got 20x2 and 20m2 chips as I've been away from PICAXE for a while, the last chips I used were the 18x series!)
I've also brought two of the XRF wireless modules and am trying to send simple information back and forth between them - At present i'm just incrementing a variable on one chip every second, and transmitting it to another chip where I want the variable displayed on the LCD screen. - Code is below... 'Should' be really simple to do right?
TRANSMITTER
init:
pause 1000
b1=1
main:
inc B1
serout b.5,T9600_8,(b1) 'transmit through XRF
pause 1000
goto main
RECEIVER
init:
pause 1000
main:
serin b.6,T9600_8,b1 ; Read in wireless serial into b1
serout b.7,N2400,(254,1) ;clear LCD
serout b.7,N2400,(254,128) ;Goto line 1, pos 1 of LCD
serout b.7,N2400,(#b1) ; write variable B1
goto main
I'm definitely getting data transmission, as the LCD changes numbers every second in line with my transmission coding... sometimes I even get the numbers arriving in incremental order for maybe 8 times in a row, and then i'll get a random number. - If I cut power to the transmission PIC circuit then nothing arrives... hence I'm positive I've wired the modules correctly. The XRF's are apparantly supposed to handle all error checking and are supposedly 'plug and play'.... though, like I said, I'm a novice with this area of PICAXE!
Now.. because i'm such a complete novice at serial comms (and actually, BASIC as well... i'm used to the flowcharts, but quickly learning the benefits of BASIC) I don't know if its something i'm doing wrong, or if it's to do with the serial transmission error on the X2 and M2 chips that I've read about on this forum.
Annoyingly the XRF wireless modules are default configured to run at 9600 baud - They can be changed apparently, but I've no idea how to do this as the documentation is very unhelpful. - If I could change the baud of the XRF module then i'd try it at the more stable serial speeds and see if that helped.
Could someone wiser and better looking than me look at my coding above and tell me if there are any novice problems likely to be causing it. - Failing that, Are there any problems with my circuits? - Bad photo of the reciever circuit attached... the transmitter XRF module is wired the same way.
Thanks
Rob
I've been reading scary things about the error on the serial transmission rates for the 20x2 and 20m2 chips... annoyingly I have brought 2 of both for my first forage into the 'new picaxe' and am not sure if they are the cause of the problems I'm having, or if it's me being stupid as i'm totally new to serial communication. ( - I've only got 20x2 and 20m2 chips as I've been away from PICAXE for a while, the last chips I used were the 18x series!)
I've also brought two of the XRF wireless modules and am trying to send simple information back and forth between them - At present i'm just incrementing a variable on one chip every second, and transmitting it to another chip where I want the variable displayed on the LCD screen. - Code is below... 'Should' be really simple to do right?
TRANSMITTER
init:
pause 1000
b1=1
main:
inc B1
serout b.5,T9600_8,(b1) 'transmit through XRF
pause 1000
goto main
RECEIVER
init:
pause 1000
main:
serin b.6,T9600_8,b1 ; Read in wireless serial into b1
serout b.7,N2400,(254,1) ;clear LCD
serout b.7,N2400,(254,128) ;Goto line 1, pos 1 of LCD
serout b.7,N2400,(#b1) ; write variable B1
goto main
I'm definitely getting data transmission, as the LCD changes numbers every second in line with my transmission coding... sometimes I even get the numbers arriving in incremental order for maybe 8 times in a row, and then i'll get a random number. - If I cut power to the transmission PIC circuit then nothing arrives... hence I'm positive I've wired the modules correctly. The XRF's are apparantly supposed to handle all error checking and are supposedly 'plug and play'.... though, like I said, I'm a novice with this area of PICAXE!
Now.. because i'm such a complete novice at serial comms (and actually, BASIC as well... i'm used to the flowcharts, but quickly learning the benefits of BASIC) I don't know if its something i'm doing wrong, or if it's to do with the serial transmission error on the X2 and M2 chips that I've read about on this forum.
Annoyingly the XRF wireless modules are default configured to run at 9600 baud - They can be changed apparently, but I've no idea how to do this as the documentation is very unhelpful. - If I could change the baud of the XRF module then i'd try it at the more stable serial speeds and see if that helped.
Could someone wiser and better looking than me look at my coding above and tell me if there are any novice problems likely to be causing it. - Failing that, Are there any problems with my circuits? - Bad photo of the reciever circuit attached... the transmitter XRF module is wired the same way.
Thanks
Rob
Attachments
-
782 KB Views: 21