View previous topic :: View next topic |
Author |
Message |
jahan
Joined: 04 Apr 2005 Posts: 63
|
NetMedia / SitePlayer interface with 16F877A |
Posted: Mon Jun 13, 2005 10:36 am |
|
|
Hello all,
I'm very new to C programming. I've purchased a NetMedia web server and would like to interface it's serial PINs to a 16F877A.
I'm not sure how to go about writing C codes to send serial data to the siteplayer and receive back data from it.
I read about getc() and putc() but I cannot put the two together to make any sense from it.
SitePlayer has 1 TX and 1 RCV pin which I can connect to B1 and B2 of the PIC chip. default speed for siteplayer is 9600 8N.
any simple code is greatly appriciated.
Thankx |
|
|
jahan
Joined: 04 Apr 2005 Posts: 63
|
I'm surprised nobody has done this before!!! |
Posted: Mon Jun 13, 2005 4:50 pm |
|
|
can anybody show me a link or sample code to learn more about this?
Thankx in advance. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
|
jahan
Joined: 04 Apr 2005 Posts: 63
|
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jun 14, 2005 1:10 am |
|
|
That board isn't really setup to easily modify by adding an external
microcontroller to talk directly to the SitePlayer's RS232 pins.
The SP_RXD and SP_TXD pins on the SitePlayer chip are hardwired
to the ST232 chip.
It could still be done. It just depends on what you want to do.
Here is a way:
1. PIC Tx to SitePlayer Rx pin:
You could remove resistor R26. Then connect a wire between
pin C6 on your 16F877, and pin 7 of Header H4.
2. PIC Rx to SitePlayer Tx pin:
Connect a wire between Pin C7 on the PIC, and pin 8 of Header H4.
3. You've also got to do the handshaking pins, RTS and CTS in a similar
way. And add a ground wire. Is this really worth it ?
Another way:
Leave the SitePlayer board un-touched. I presume you have a 16F877
board. Add a MAX232 chip to that board and also a DB-9 connector,
and just plug it into the SitePlayer board.
------
The SitePlayer board apparently uses hardware flow control --
ie., the CTS and RTS signals on the RS-232 connector.
You're going to have to write routines for your serial i/o in your PIC
that use those signals. Maybe you should email them or look in
their documentation somewhere and confirm if they really use it.
If they don't use it, then this would save you some work.
Or, hopefully, someone on this board has already made some simple
RTS/CTS routines that they can post for you. |
|
|
jahan
Joined: 04 Apr 2005 Posts: 63
|
updates on the project |
Posted: Tue Jun 14, 2005 8:40 am |
|
|
Thank you for your comments. I finally connected NetMedia RX/TX to B1/B2 of 16F877 and have them talk 9600.
why would I need RTS/CTS?
Is there anywhere on the net I can read about these signals?
Thankx again. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Jun 14, 2005 9:25 am |
|
|
If you look at the schematic in the back of the SitePlayer Development
Manual, it shows RTS and CTS going from the SitePlayer chip, to
the ST232, and then on to the DB-9 connector.
As I said in my post, I don't know if the SitePlayer chip uses them.
Sometimes, designers will put in features "just in case" they may
need them in the future. If you've got it working without CTS/RTS,
then good. |
|
|
|