shawn
- 10th February 2007, 20:40
Goal is to create a data logger of some type.
I can not figure out how to comunicate from pic18F458 to pc. I've read and searched the forums and google and have found some good info. I just need help putting it together.
Question 1.
If I connect to the tx line of a DB9 com. port can I do that directly or do I need a RS232 connector. I would like to use a simple serout comand. It sounded like in the PBP manual a resistor was the only thing required but I've interpeted lots of info on both ways.
I'm using VB.net for my PC interface. I can program barely in VB.net but I am confident I can make this end work by following the guide posted here. http://www.codeworks.it/net/VBNetRs232.htm It is an aplication program to read and write to com ports using vb.net.
I have been using this program to test my PBP code on my pic. I am having no luck. To start off I am just trying to pass one byte of info to PC from Pic and have the aplication program read the one byte. My pbp code is as follows.
Define Loader_USED 1
Include "MODEDEFS.BAS"
S Var Byte
W Var Byte
s = 2
Main:
pause 2000
Serout PortB.1, 8, [#S]
goto Main
I'm using a 4Mhz crystal.
Question 2.
Is it my code or is my connection to the com port bad. Meaning do I need a RS232 translator in the circuit. I ran Portb.1 pin through a resistor and directly to tx line on com port.
Please any help would be apreciated.
Question 3.
What would be the best way to do this other than hardware usart. Using the program I downloaded from here. http://www.codeworks.it/net/VBNetRs232.htm
Thanks
Shawn
I can not figure out how to comunicate from pic18F458 to pc. I've read and searched the forums and google and have found some good info. I just need help putting it together.
Question 1.
If I connect to the tx line of a DB9 com. port can I do that directly or do I need a RS232 connector. I would like to use a simple serout comand. It sounded like in the PBP manual a resistor was the only thing required but I've interpeted lots of info on both ways.
I'm using VB.net for my PC interface. I can program barely in VB.net but I am confident I can make this end work by following the guide posted here. http://www.codeworks.it/net/VBNetRs232.htm It is an aplication program to read and write to com ports using vb.net.
I have been using this program to test my PBP code on my pic. I am having no luck. To start off I am just trying to pass one byte of info to PC from Pic and have the aplication program read the one byte. My pbp code is as follows.
Define Loader_USED 1
Include "MODEDEFS.BAS"
S Var Byte
W Var Byte
s = 2
Main:
pause 2000
Serout PortB.1, 8, [#S]
goto Main
I'm using a 4Mhz crystal.
Question 2.
Is it my code or is my connection to the com port bad. Meaning do I need a RS232 translator in the circuit. I ran Portb.1 pin through a resistor and directly to tx line on com port.
Please any help would be apreciated.
Question 3.
What would be the best way to do this other than hardware usart. Using the program I downloaded from here. http://www.codeworks.it/net/VBNetRs232.htm
Thanks
Shawn