Tomas
- 2nd March 2004, 00:34
Hi there,
I have connected pin 5 of the the DB9 to GND.
My crydtal speed is 4MHz.
But don't know which DEFINEs to include in the code and no idea what "TRUE" mode is and how to do it, sorry.
Where do i set this mode? I have told that 9600 will not work for a 4MHz crystal and so changed the mode to 4800, see the code below.
Have tested the Hyterterm, COM-Port, Serial Cable it is as explained no problem.
The problem might be with MAX232, one of the pins gives only 0V and the other one gives between the range of -1.5V up to -8.6V.
Pin 12 (R1 OUT) of the MAX232 which is connected to pin 26 (RX) of '877 gives 0V
Pin 11 (T1 IN) of MAX232 which is connected to pin 25 (TX) of '877 gives 2.80V and 4V
Pin 13 (R1 IN) of the MAX232 which is connected to pin 3 of DB9 gives almost 0V
Pin 14 (T1 OUT) of the MAX232 which is connected to pin 2 of DB9 gives between -1.5V up to -8.6V
What do you think where should i look for mistakes?
I just want to get the code below work to see my first "Hellow World"
' PicBasic Pro program to send "Hello World" on serial port
' Define LOADER_USED to allow use of the boot loader.
' This will not affect normal program operation.
'Define LOADER_USED 1
'Include "modedefs.bas" ' Mode definitions for Serout
TRISC = %00000010
loop: Serout2 PORTC.6,4800,["Hello",10,13] ' Display "Hello", next line
Pause 500 ' Wait .5 second
Serout2 PORTC.6,4800,["World",10,13,10,13] ' Display "World", skip a line
Pause 500 ' Wait .5 second
Goto loop ' Do it forever
End
Best Regards,
Tom.
I have connected pin 5 of the the DB9 to GND.
My crydtal speed is 4MHz.
But don't know which DEFINEs to include in the code and no idea what "TRUE" mode is and how to do it, sorry.
Where do i set this mode? I have told that 9600 will not work for a 4MHz crystal and so changed the mode to 4800, see the code below.
Have tested the Hyterterm, COM-Port, Serial Cable it is as explained no problem.
The problem might be with MAX232, one of the pins gives only 0V and the other one gives between the range of -1.5V up to -8.6V.
Pin 12 (R1 OUT) of the MAX232 which is connected to pin 26 (RX) of '877 gives 0V
Pin 11 (T1 IN) of MAX232 which is connected to pin 25 (TX) of '877 gives 2.80V and 4V
Pin 13 (R1 IN) of the MAX232 which is connected to pin 3 of DB9 gives almost 0V
Pin 14 (T1 OUT) of the MAX232 which is connected to pin 2 of DB9 gives between -1.5V up to -8.6V
What do you think where should i look for mistakes?
I just want to get the code below work to see my first "Hellow World"
' PicBasic Pro program to send "Hello World" on serial port
' Define LOADER_USED to allow use of the boot loader.
' This will not affect normal program operation.
'Define LOADER_USED 1
'Include "modedefs.bas" ' Mode definitions for Serout
TRISC = %00000010
loop: Serout2 PORTC.6,4800,["Hello",10,13] ' Display "Hello", next line
Pause 500 ' Wait .5 second
Serout2 PORTC.6,4800,["World",10,13,10,13] ' Display "World", skip a line
Pause 500 ' Wait .5 second
Goto loop ' Do it forever
End
Best Regards,
Tom.