Txc1 & rxb1

marzan

Senior Member
Hello. I was wondering if it is possible to communicate between picaxes using TXC1`s and RXB1`s without using holtek modulator/demodulator chips ? It`s not a complicated data transfer that I need. The reciever only has to get a single value between 1 and 3. If it is possible are there any tutorials that anyone knows of to interface with PICAXE chips?

Thanks.
Marz.
 

marzan

Senior Member
It most certainly IS possible - the Holtek way became near obsolete due to inbuilt PICAXE features. Do you already have these modules ? If not the Dorji ASK ones are far superior to the TCX1 & RXB1, & they're also cheaper. See => www.picaxe.orconhosting.net.nz/dorjiask.pdf
Yes I have had them sitting around for a project that has been off and on for years thanks to other priorities. Maybe the Dorji ones might be more suitable. as it lessens the chip count on the pcb, seeing I don`t have a lot of room. I will read up on them. Thanks Manuka. :)

Marz
 

marzan

Senior Member
My new Dorji modules have arrived. now I just need the time to get them working :eek:

Marz.
 

SAborn

Senior Member
Im just down the road from you if you need help, you have my contacts.
Although i know you like to work things out yourself, but if you get stuck im happy to help, although what Stan cant shed light on with these modules, i doubt anyone else can, Guru Stan when it comes to using the Dorji modules.

You should have said you needed some dumb modules, as i have several sets here doing nothing you could of have free, after using the Dorji tranceivers the dumb modules just become clutter as redundant parts that i doubt i will ever find a use for again.
 

marzan

Senior Member
Im just down the road from you if you need help, you have my contacts.
Although i know you like to work things out yourself, but if you get stuck im happy to help, although what Stan cant shed light on with these modules, i doubt anyone else can, Guru Stan when it comes to using the Dorji modules.
Thanks Pete. I will finally be able to start putting all the individual pieces of this project together in the next couple of weeks. I will probably need some help to get it all the fiddly bits working.

You should have said you needed some dumb modules, as i have several sets here doing nothing you could of have free, after using the Dorji tranceivers the dumb modules just become clutter as redundant parts that i doubt i will ever find a use for again.
I decided that the Dorji models looked a lot better than the ones I had, and by the look of it far easier to use. Am I right in assuming you can use the serout command to use them ?
If so, that is going to make them so much better than the ones I had.
I have one issue that I haven`t really looked into. I have the RTC in a loop on the main picaxe chip displaying the elapsed time. on another separarate circuit I have used an 08M to run 3 infrared beams through a NOR gate. What it does is when any of the 3 beams goes low, it sends a signal to the main chip wirelessly ( hence the Dorjis ) The sticking point that I can see is how do I use serin while still displaying the elapsed time? Do I need to use the parallel programming available on some picaxes?

Marz.
 

lbenson

Senior Member
"Parallel" processing (actually fast task-switching) does not help--serin is still blocking. If you are using X2 parts you can use hserin with background receive to the scratchpad.
 

marzan

Senior Member
The data I need to send is not complicated. I have 3 transmitters. I need to send a 1,2 or 3 depending which transmitter has been activated. That will tell the main program weather it was the start, split or finish. Is that possible?
 

lbenson

Senior Member
Yes, that is possible--I've had 4 or 5 transmitters for one receiver. There is the possibility of simultaneous transmission which would cause missed transmissions. In my case, this wasn't critical (as well as being not likely because of the infrequency of transmission). If you can't stand to have missed transmissions, you must set up some kind of acknowledgement scheme, which adds complication.

For wireless with bare 433mHz parts, hserin is problematic, because the receiver is likely to fill the scratchpad with random data (and I believe the M2 parts don't have background receive). I used a dedicated 08m which sat in serin all the time. The transmissions used "UUUU" wake-up preambles, a qualifier, and a code to designate which transmitter the message was from--you wouldn't need a code if your data byte told you which the message was from. In my case, the 08m was a front-end for a little linux device, but it could just as easily be for another picaxe. Receiver signals input with a high pin, master picaxe ACKs with another high pin and goes into serin, receiver sends byte.
 

manuka

Senior Member
Agreed! It looks feasible, but perhaps first also tell us much more about the overall setup - power supplies,ranges, local interference, obstacles, rate of sending etc etc. It's often the dead boring things that matter in wireless & portable applications...

Back in 2009 I'd some success with PULSIN reading (which does timeout) as a handy bypass for SERIN hangups. This used HopeRF TTL transceivers in "ping pong" mode,but could readily be modified to suit
Code:
hopettl:
high 1                   'bring HopeRF out of hiberation
serout 2,t2400,(85,85,85,85,"ttl",b0) 'tx beacon
pulsin 4,0,b1            'listen & briefly await any reply
if b1=0 then hopettl     'if nothing heard then resend beacon

serin 4,t2400,("ttl"),b0 'if signal heard then accept serial data 
low 1                    'enter low drain TTL sleep 
sleep 13                 'PICAXE low current SLEEP (~30 secs)
goto hopettl             'repeat routine
Stan.
 
Last edited:

marzan

Senior Member
I used a dedicated 08m which sat in serin all the time.
.
I was thinking to do the same thing. I thought if I use an 08 to recieve, then use 3 pins as outputs to the main picaxe. That way I could tell it to ignore the inputs unless they are in the correct order. Plus I could put in a fourth transmitter for a timer reset.
 

marzan

Senior Member
Agreed! It looks feasible, but perhaps first also tell us much more about the overall setup - power supplies,ranges, local interference, obstacles, rate of sending etc etc. It's often the dead boring things that matter in wireless & portable applications...
I am trying to build a wireless elapsed time setup with a split time for use with agility dogs, accurate to tenths of a second. Each transmitter consists of 3 ir beams, Infrared transmitter pulsed at 38khz with a 555 timer to limit interference. going to ir recievers sending to a NOR gate set up on an 08M2. This chip operates the IR receivers, Green/red LEDS and now hopefully the dorji transmitter. there are 3 of these setups. One for the start, one for the split time, and one for the finish. (although later on I may need a fourth, but i digress) Each transmitter will send a unique ID(say 1 or 2 or 3 ) to the receiver. The receiver would start with processing the transmissions through another 09M2 to give 3 pins as outputs. this would be sent to the main picaxe chip, whicjh I havent decided which it will be as it depends on final pin count as well as chip capabilities. At this point I have the timer part of it running on a 28x2. The main chip then figure out if the transmissions are in the correct order and eithe starts the clock, flashes the split time for 5 seconds, stops the clock, or resets.
The main unit I will power with an sla battery. the remotes with NiMH batteries.

I would expect that it will not have to transmit more than a hundred yards max with a direct line of sight.

How does that sound?

Marz
 

manuka

Senior Member
OK- I'm a dog fancier but competitive "agility" is beyond my mongrel! So does the dog break the IR beam as it pases? False triggers from tails etc an issue? Aside-did you know that 08Ms have inbuilt IR commands (IRIN/IROUT) for both sending & receiving ? This has pretty much revolutionised IR work & made 555 based approaches near historic. See manual
 

marzan

Senior Member
OK- I'm a dog fancier but competitive "agility" is beyond my mongrel! So does the dog break the IR beam as it pases? False triggers from tails etc an issue? Aside-did you know that 08Ms have inbuilt IR commands (IRIN/IROUT) for both sending & receiving ? This has pretty much revolutionised IR work & made 555 based approaches near historic. See manual
Haha I teach agility to others. I have trained everything from kelpies to british bulldogs to do agility. I don`t do competition because I figure my dog can`t read a piece of paper to say he`s a champion. My club operates on the come one, come all when it comes to agility, as long as it remains fun :)

The split timer is so I can show them that there are faster ways around a course than they first think.

I feel I might not have explained properly how the beams work. The 555 timer and IR transmitter is in one pole, and the receiver and 08m and Dorji transmitter is in another, and there are 3 beams across the gap I have found after exhaustive research that there is only one IR receiver module that I know of that can remain low for long periods of time. Most only allow burst transmission. Seeing I needed 3 of them to be working at once it seemed easier to set up a NOR gate to achieve this rather that IRIN Also I have it sort of "debounced". once it is tripped it remains "on" for a second with a wait command.

Marz
 

lbenson

Senior Member
If you're running one dog at a time, then you don't need to worry about transmission conflicts. Your idea of 4 outputs and one input on an 08M will work--input on pin 3, outputs on 0, 1, 2, 4.
 

hippy

Technical Support
Staff member
Not entirely sure about what hardware you are looking at but; three or more poles, IR beams, transmitter to a base station, and at the base station a receiver and controlling an elapsed time clock / stopwatch should be feasible.

It would make things easier at the base station to have two PICAXE, one handling the RF messages received, and another running the stop watch. You can probably use an 08M2 as the RF handler so little extra overhead.
 

marzan

Senior Member
Not entirely sure about what hardware you are looking at but; three or more poles, IR beams, transmitter to a base station, and at the base station a receiver and controlling an elapsed time clock / stopwatch should be feasible.

It would make things easier at the base station to have two PICAXE, one handling the RF messages received, and another running the stop watch. You can probably use an 08M2 as the RF handler so little extra overhead.
Thanks hippy. We discussed the use of an 08M2 as SERIN and 4 outputs to main PICAXE chip. I bought a dozen 08M2 smd`s, so being so cheap, why not use an extra :)
 

marzan

Senior Member
If you're running one dog at a time, then you don't need to worry about transmission conflicts. Your idea of 4 outputs and one input on an 08M will work--input on pin 3, outputs on 0, 1, 2, 4.
Thanks for your input. I will start to collate all the relevant info now and start breadboarding some ideas.

Marz
 

eclectic

Moderator
Thanks hippy. We discussed the use of an 08M2 as SERIN and 4 outputs to main PICAXE chip. I bought a dozen 08M2 smd`s, so being so cheap, why not use an extra :)
Assuming you're using pin3 as input,
please see Man. 2, p.206 regarding the diode.

If you already know, then the info might be
useful to someone else in future.

e
 

marzan

Senior Member
Assuming you're using pin3 as input,
please see Man. 2, p.206 regarding the diode.

If you already know, then the info might be
useful to someone else in future.

e
I need constant reminders. I have scratched my head a few times when something didn`t work because no diode eas put in the circuit.

Marz
 

marzan

Senior Member
Well I have started to have a play with the Dorji Transmitter/Receiver setup. I am using what I assume is Manuka`s excellent pdf on the modules.

Here is my code for the transmitter
Code:
wait 5
MAIN:
	wait 2
	inc b1
	serout 4,n1200, (b1)
	if b1<4 then MAIN
	b1=0
	goto MAIN
I want it to increment b1 to 4,then reset and loop

My receive code :
Code:
	wait 3
	hsersetup n1200_4, %00
MAIN:	
	hserin b1
	if b1 = 1 then high c.0
	endif
	if b1 = 2 then high c.1
	endif
	if b1 = 3 then high c.2
	endif
	if b1 = 4 then high c.4
	endif
	pause 500
	low c.0  :low c.1 : low c.2 : low c.4
	goto MAIN
It all passes syntax, but all i get is c.0 high. Is the code right or could it be the aerials?
 
Last edited:

Technical

Technical Support
Staff member
Your transmitter use N polarity whereas your receiver use T polarity (default for hserin).
 

hippy

Technical Support
Staff member
First, simplify the code to the bare minimum ...

For the transmitter -
Code:
Wait 5
Do
  Wait 2
  SerOut 4, N1200, (b1)
  b1 = b1 + 1
Loop
For the receiver -
Code:
HSerSetup B1200_4, %100
Do
  w0 = $FFFF
  HSerIn w0
  If w0 <> $FFFF Then
    SerTxd( "Got ", #w0, CR, LF )
  End If
Loop
Added : Just noticed your HSERSETUP baud rate is N1200_4 - That's wrong, should be B1200_4, and the %00 is likely wrong if you want an Nxxxx polarity; you'll need %100.
 

hippy

Technical Support
Staff member
Is it possible to change to n on the receiver on an 08M ?
Presumably 08M2 because 08M doesn't support HSERIN, but the answer is no. You'll either need to use another PICAXE, hardware inversion, or simply use SERIN rather than HSERIN which shouldn't be a problem -

Code:
#Picaxe 08M2
#Terminal 4800
Do
  SerIn [i]pin[/i], N1200, b1
  SerTxd( "Got ", #b1, CR, LF )
Loop
 

nick12ab

Senior Member
The second time I've had to advertise it today - download Extra PICAXE wizards (for free!) which will calculate the hsersetup command for you.

It also shows that changing the polarity only changes that settings byte and the baud rate word is unaffected. The baudmode constants (N2400, T2400, N4800, etc.) have values like 4, 5, 6, etc. rather than 416, 207, etc. which the baud rate constants (B2400_8, etc.) have so the baudmode constants are not interchangeable with the baud rate constants at all and will produce an undesired result.
 

marzan

Senior Member
The second time I've had to advertise it today - download Extra PICAXE wizards (for free!) which will calculate the hsersetup command for you.

It also shows that changing the polarity only changes that settings byte and the baud rate word is unaffected. The baudmode constants (N2400, T2400, N4800, etc.) have values like 4, 5, 6, etc. rather than 416, 207, etc. which the baud rate constants (B2400_8, etc.) have so the baudmode constants are not interchangeable with the baud rate constants at all and will produce an undesired result.
Thanks Nick12ab. I have downloaded it. It says I cant invert on an 08m2. I wanted to invert it so it is low when not in use. I tried to get it running without the inversion to see if it works, but now it won`t let me re-program it. Have to find out why. More reading.... :)
 
Top