Pic 18F24k22 wireless data transfer.

Thread Starter

Dodgydave

Joined Jun 22, 2012
11,284
I have built a weather station in the attic, works great displays seven segment four digits,in temp, windspeed, airpressure.
So i want to make another to display the same, do i



1, just make another pcb, chip etc.?

2, can i add a wireless transmit/reciever and send the data to the additional displays that will also use the same pic.?

3, run a cable from attic to second displays and use I2c, serial, usb, or other data transfer method.?

4, use a diferent pic?


datasheet
 
Last edited:

DickCappels

Joined Aug 21, 2008
10,153
Yes to all of the above.

Can you post the manual for the weather station or post a link to documentation so we can see what provisions if any they made for sending the data to remove displays?
 

ErnieM

Joined Apr 24, 2011
8,377
LOL... yep, yes to all.

A wire between displays is inconvenient, my preference would be for wireless. There are some inexpensive modules out there, but I am unsure about shipping to the UK. Sparkfun has several, and I've seen similar (identical?) units on EBay/China for less.
 

Thread Starter

Dodgydave

Joined Jun 22, 2012
11,284
The pic uses the A/D for temp and airpressure, so uses ADRESL/ADRESH files saved(4 files intotal)

The wind speed uses TMR1L/TMR1H

a total of 6 (8bit) files to be transmitted, the reciever can do the calculations and displays, i would prefer to send it wireless, maybe itsnot possible so may needto hardwire and use Usart, or I2C need help ??
 
Last edited:

Thread Starter

Dodgydave

Joined Jun 22, 2012
11,284
Ok so i can use Rx/Tx modules to the Usart pic, now i need to know how to use the usart first, thats going to be an headache!, as the datasheet is absoloutely useless, need some source code examples in ASM.
 
Last edited:

THE_RB

Joined Feb 11, 2008
5,438
PIC USARTS are pretty easy, once you do the setting of the baudrate register(s). That depends on xtal speed and oscillator options.

I really recommend getting it working with a wired connection between the two PIC USARTs first!

Once that is good and you have some preamble etc like the one on my web page it should be easy enough to connect the RF modules.

Having a 'scope to see the RX module output matches the TX module input will help a lot too!
 

Thread Starter

Dodgydave

Joined Jun 22, 2012
11,284
Thats what i was going to do, wire a 3 core between each pic Tx to Rx, then transfer the ADRESL file across and put it on port b say,but i can find any working examples of pic 18f working to get me started.
 

THE_RB

Joined Feb 11, 2008
5,438
The datasheet for 18F series usuall has a good blow by blow description of what to do.

Generally for transmit you just load a byte into the TXREG;
MOVLW byte
MOVWF TXREG

And the receive side has a bit flag, that flag gets set when a byte has been received. So on detecting the flag you take the byte out of RXREG;
MOVF RXREG,w
MOVWF final_dest

if receiving multiple bytes you need a way to handle that, generally a pointer so you put each new byte in a successive RAM location, then inc the pointer.
 

Thread Starter

Dodgydave

Joined Jun 22, 2012
11,284
Ok, will give it a go, i need to transmit 6 files,so i thought if i sent a dummy file with 9 bits as a synch pulse, then 6 files in order,and wait for the 9 bit sync file then start to receive the files and store them in order.
 
Top