CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

ethernet module

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Tektronix



Joined: 13 Feb 2010
Posts: 4

View user's profile Send private message

ethernet module
PostPosted: Sat Feb 13, 2010 3:08 pm     Reply with quote

I am trying to send serial data to a Parallax Internet Netburner embedded Ethernet module. I am using the PCWH compiler version 4.104. The documentation from Parallax shows how to send serial data to the module using a basic stamp. I am trying to use a pic18f452 chip and the PCWH compiler.
Part of my code is:
Code:

#include <18F452.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=10000000)
…..
#use rs232(baud=9600, xmit=PIN_B1, rcv=PIN_B0,STREAM=NET,ERRORS,TIMEOUT=20, BRGH1OK )
….
fprintf (NET,"!NB0W21:TEST");

I do not think that the pins are not switched around because the fprintf statement will work about 60% of the time.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Feb 13, 2010 3:31 pm     Reply with quote

Quote:

#use rs232(baud=9600, xmit=PIN_B1, rcv=PIN_B0,STREAM=NET,ERRORS,TIMEOUT=20, BRGH1OK )

You're using a software UART. Are you using interrupt routines in your
program ? If so, when interrupts occur, they will disrupt the bit timing of
the software UART. You can prevent that by adding the DISABLE_INTS
parameter to your #use rs232() statement. From the manual:
Quote:

#USE RS232

DISABLE_INTS -
Will cause interrupts to be disabled when the routines get or put a
character. This prevents character distortionfor software implemented
I/O and prevents interaction between I/O in interrupt handlers and the
main program when using the UART.


Quote:

#use rs232(baud=9600, xmit=PIN_B1, rcv=PIN_B0,STREAM=NET,ERRORS,TIMEOUT=20, BRGH1OK )

Also, on a software UART, the parameters shown in bold don't do anything.
The compiler ignores them.
Tektronix



Joined: 13 Feb 2010
Posts: 4

View user's profile Send private message

PostPosted: Sat Feb 13, 2010 4:20 pm     Reply with quote

That was very good information. I wished the manual was a little clearer on which options are for software UART and which are for the hardware UART. I am still having trouble with the Ethernet module. The data is still not showing up. It might be a problem with the Netburner Ethernet module. Thanks again.
jaimechacoff



Joined: 14 Feb 2010
Posts: 24
Location: Santiago, Chile

View user's profile Send private message

PostPosted: Sun Feb 14, 2010 12:14 pm     Reply with quote

hey, I think your problem with the Netburner is because you are connecting it through a router and because that now you cant see the information.

I know this because I have used the Netburner, and I had the same problem and it was just because the Netburner doesnt work under a router.

good luck.
Tektronix



Joined: 13 Feb 2010
Posts: 4

View user's profile Send private message

PostPosted: Sun Feb 14, 2010 5:42 pm     Reply with quote

It’s possible that the netburner does not work well with a router, but not sure. I had the netburner module hooked up using a basic stamp which worked very well. I used the examples from the Parallax web site. Does anyone know an example in which serial data is sent or received from a PIC chip to a basic stamp? The basic stamp commands can send and receive serial data with a delay (pace) option. I am not sure how much delay is actually between characters being sent. What is the best way to send a null character through the serial port?
I have modified the code for the PIC18F452 chips many times and then tested, but still no luck.
Code:
#include <18F452.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=10000000)
#define CLS 0
#use rs232(baud=9600, xmit=PIN_B1, rcv=PIN_B0,stream=net,errors,timeout=20,disable_ints )
void main
 fprintf (net," !NB0W04:WORKS OK \0");   
 fprintf (net," !NB0W04:WORKING OK%s",CLS);   
  while(TRUE){   
  }   
      fprintf (net," !NB0W04:Test");
      delay_ms(1000);                 
     
     }
jaimechacoff



Joined: 14 Feb 2010
Posts: 24
Location: Santiago, Chile

View user's profile Send private message

PostPosted: Mon Feb 15, 2010 5:42 am     Reply with quote

Hi Tektronix,

Is this your Netburner?:

http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/PINK/List/0/SortField/4/ProductID/40/Default.aspx

If that one is yours, you should take a look of this:

http://www.parallax.com/Portals/0/Downloads/docs/prod/comm/30013-PINKdocs-v2.1.pdf

and in the first page says:

Quote:

You should also understand firewalls and functionality of any router or switch in your network as well as how the settings may affect network traffic with the PINK.


I would like to help you more, but I program PICs in Basic and I am just learning about CCS C.

bye.
Tektronix



Joined: 13 Feb 2010
Posts: 4

View user's profile Send private message

PostPosted: Mon Feb 15, 2010 7:30 pm     Reply with quote

The netburner displays the web pages just fine with the router setup I have. I just trouble getting the PIC18F452 to update variables on the displayed web pages. The same netburner with a basic stamp does update the variables as expected with basic code.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group