PDA

View Full Version : *very* low speed data transfer



jswayze
- 24th November 2004, 15:52
I've got an interesting application that requires a very low-speed data transfer to occur in order to configure code on my PIC (a 16F648A.)

The PIC software has 70 word-length variables that I'd like to generate from a Visual Basic program on a PC and then download into the PIC. This is a very small, light device and as opposed to coming up with some sort of one-button programming interface, I thought a VB program would be much easier to use.

I plan to transfer this data by means of one or two phototransistors on my board. The board and phototransistors would be placed up against the monitor and a "programming rectangle" on the computer monitor would transmit the 70 bytes of data by flashing between white and black. I've tested this on a scope, and am able to get a good differentiation between white and black. I plan to use the VREF and comparator to gate the signal.

My question is, is there a way to use the built-in serial routines to do a very slow data rate, say 30 bps? I think I can only count on 60Hz from the screen, so I'd need to go a bit lower to guarantee a good signal. Has anyone seen this done before?

I realize this is kind of a clunky option for programming, but it's the one that requires the fewest components (one.) My other thought was to add a serial cable to the package and solder an IR LED to the output. Then I could hold the LED up to the phototransistor and transmit using normal serial routines. This of course requires a cable, connector, solder, etc. and adds cost that I'd like to avoid.

Thanks for any input,

Jeff

mister_e
- 24th November 2004, 16:45
original way to transfer data, why not using serial COM port instead??

BTW, you can perform slow serial data... as low as you want. With the built-in... ive got no idea... maybe some trick in the choice of crystal and DEFINE OSC can do something but, i think the easiest way is to build your own.
Using internal timer ticks for accurate bit testing.

good luck!

jswayze
- 24th November 2004, 18:13
Yeah, serial port would be a LOT easier, but it would require that I also include a cable with the product... one more thing to buy, package, etc.

This is definitely my fallback though.

Jeff

mister_e
- 24th November 2004, 19:04
ok, so in this case i suggest build your own serial procedure using internal timer. Maybe interrupts will be an intelligent way to monitor serial comm start bit if your device do something else while receiving data.

but as i told previously, there's maybe some trick to do with crystal choice.... let's say SERIN @ 300 baud @ 4MHZ... 400KHZ crystal can maybe acheive SERIN @ 30 BAUD with a DEFINE OSC 4

regards