Peter Fender
New Member
I spent a few days banging my head on this problem until I finally figured it out.
I have a 28X2 with a DS18B20 temperature sensor that displays the temp on a 20x2 LCD display.
It also sends the temp via hserout to an XBee module and then to my PC.
I configured hsersetup for automatic background receive to the scratchpad, and periodically show the serial text received from the PC (via the XBee's) on the LCD display.
It mostly works, but occasionally garbled characters came in on the serial port.
I chased a few dead ends, mostly looking at the electrical interface between the PICAXE and the XBee (the 28X2 and LCD run at +5v, and the XBee needs 3.3v). This is the first time I've used XBee's, and I'm using this setup to learn how they work and how to convert the signal levels.
Turns out when the readtemp12 command executes, it temporarily changes the clock speed from the 28X2 default of 8MHz down to 4MHz.
So any characters received in the background during this command are decoded at the wrong baud rate.
I had to change the clock speed to 4MHz all the time to get the serial data to always be received correctly.
Does anyone know of a better way to work around this that can run the 28X2 at 8MHz or more?
(I'd like to speed up the display speed on the LCD eventually.)
I may try to connect the DS18B20 to a 08M2, trigger a reading with one pin from the 28X2, and read back the temp with a simple serin command on another pin.
I have a 28X2 with a DS18B20 temperature sensor that displays the temp on a 20x2 LCD display.
It also sends the temp via hserout to an XBee module and then to my PC.
I configured hsersetup for automatic background receive to the scratchpad, and periodically show the serial text received from the PC (via the XBee's) on the LCD display.
It mostly works, but occasionally garbled characters came in on the serial port.
I chased a few dead ends, mostly looking at the electrical interface between the PICAXE and the XBee (the 28X2 and LCD run at +5v, and the XBee needs 3.3v). This is the first time I've used XBee's, and I'm using this setup to learn how they work and how to convert the signal levels.
Turns out when the readtemp12 command executes, it temporarily changes the clock speed from the 28X2 default of 8MHz down to 4MHz.
So any characters received in the background during this command are decoded at the wrong baud rate.
I had to change the clock speed to 4MHz all the time to get the serial data to always be received correctly.
Does anyone know of a better way to work around this that can run the 28X2 at 8MHz or more?
(I'd like to speed up the display speed on the LCD eventually.)
I may try to connect the DS18B20 to a 08M2, trigger a reading with one pin from the 28X2, and read back the temp with a simple serin command on another pin.