Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

TX different values

Status
Not open for further replies.

bee

Member
I am needing help again with some coding :D

This is what i need is 2 x 12f675 transmitting a different values from each one,To one reciever that is a 16f676,this then gets displayed via two seven segs
I have this working with one transmitter and one reciever
The value is from a strain guage and is from 0-5volts on the analog input 12f675

1 Transmit values from 12f675 from left hand one
2 Transmit values from 12f675 from right hand one
3 Decode sent value and distinguish LH or RH and output LH or RH s/seg 0-9
4 RA 4,5 are used for left and right hand s/seg

I have this working with the left one only at present,Just need some way of testing if its the right hand one or left,And turning on said port
I could just set up another decode section but there must be a more efficient way

Any advise is appreciated

Cheers
bee
 

Attachments

  • RX2CA.asm
    14.8 KB · Views: 127
  • TX3a.asm
    12.6 KB · Views: 118
Yoiu say you're 'transmitting', but how?

Is it radio, IR, or just down a wire?.

If it's anything but wire, it's unlikely to work reliably, because you're just sending timed RS232 type signals, and neither radio or IR preserve the accurate timing, you need to use Manchester coding or similar.
 
Nigel
Iam Transmiting with a 433mhz radio module
It works on one signal, but i am trying to send and decode two
bee
 
Nigel

I have got it working with manchester coding ,With a little help from your tutorials very good stuff Thanks
But i have another question
1 Am i better to send the value straight from the ad conversion and calculate at reciever end
2 or calculate adc then send known value plus value from a or b transmitter
3 There needs to be 10 different values from each transmitter sent depending on adc reading plus a designator for transmitter
Thanks for your help
bee
 
Personally I would probably convert it to ASCII before transmission, although with a packet system it doesn't really matter that much.

But a ten byte ASCII packet consisting of "A1023B1023" can easily be sent via packet, or just plain ASCII.

If speed is an issue then use a binary (hex) packet, so 4 bytes "3FFF3FFF", each data word is identified by it's position in the packet - but it's no good for plain ASCII.
 
I dont think i explained my problem very well
I have two transmitters the same connected to 12f675 with adc,Transmitting approx .5s apart
The adc reading needs to be sent approx every .5 second displaying from 1-9 on the reciever,depending on adc reading

cheers
bee
 
I have the transmissions switched,
So one turns on and transmits then the other at .5s apart
That should be enough time to do its thing
I have decided to send 2 bytes of data
1 byte contains the transmitter designator and 1 byte contains the adc value
Then sort it out at the reciever end, and output to s/seg

bee
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top