View previous topic :: View next topic |
Author |
Message |
Guest2 Guest
|
Serial data |
Posted: Sat Mar 08, 2008 7:11 am |
|
|
Is there some program which i can use for sending serial data from PC to my demo board ?. I hate to use hyper terminal and i need constant data transfer which will loop some defined data.
Any suggestions ? |
|
|
meereck
Joined: 09 Nov 2006 Posts: 173
|
|
|
Guest2 Guest
|
|
Posted: Sun Mar 09, 2008 2:37 pm |
|
|
I'm using the terminal that you have suggested and i must say it's quite simple but effective.
As example i have choose the ex_sisr.c example and this is what i get:
As delay time i have set 5 seconds.
I compile and run program on the demoboard and on the lcd display you can see "running".
I open the terminal program ( i tested with the hyperterminal too ) and i send some chars... "test" . After cca 5 second i get message Buffered data => and that is that. There is no test chars, no garbage chars etc.
How come ? |
|
|
Storic
Joined: 03 Dec 2005 Posts: 182 Location: Australia SA
|
|
|
Guest2 Guest
|
|
Posted: Mon Mar 10, 2008 12:59 pm |
|
|
The serial port monitor is great ! :-)
I can see that the process has started and i can see that data has been send, so the problem is in the software. Ok.
#include <16F877.h>
#fuses HS,NOWDT,NOPROTECT,NOLVP
#use delay(clock=20000000)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7)
#include "lcdDriver.c"
:
:
:
do {
delay_ms(3000);
printf(lcd_putc,"\r\n Data ");
while(bkbhit)
putc( bgetc() );
} while (TRUE);
Is the problem in lcd output ? I can see the "Data" text but that all.
Did someone used this example ? |
|
|
meereck
Joined: 09 Nov 2006 Posts: 173
|
|
Posted: Mon Mar 10, 2008 1:39 pm |
|
|
I have just tried the latest Terminal version.
As for me and my USB-RS232 adapter, the latest version of Bray's terminal can't send any data to the serial line.
It freezes immediately when I hit the Send button. I therefore use an old version released in 2006.
M. |
|
|
Guest2 Guest
|
|
Posted: Tue Mar 11, 2008 11:40 am |
|
|
Do you have some other software example which i can test cuz i think that serial connection is OK. ? |
|
|
Humberto
Joined: 08 Sep 2003 Posts: 1215 Location: Buenos Aires, La Reina del Plata
|
|
Posted: Tue Mar 11, 2008 1:52 pm |
|
|
Quote: |
Do you have some other software example which i can test cuz i think that serial connection is OK. ?
|
You should start with the most simplest code - like the one posted by PCM Programmer
in the following thread - to test this kind of problems.
If it run properly, you can be sure that the MCU in the board and the whole hardware is OK.
Then and after this, you would be able to test any PC communication software.
http://www.ccsinfo.com/forum/viewtopic.php?t=32831&highlight=rs232
Humberto |
|
|
guest2 Guest
|
|
Posted: Fri Mar 14, 2008 12:07 pm |
|
|
I established the connection but there in problem in formating, at least i think so...
I want to enter HEX value thru my keyboard and then i need to receive the same one in the HEX format. So i try with printf(lcd_putc,"%x",c); and this is the LCD output:
Keyboard input: 10
LCD output: f8
Keyboard input: 11
LCD output: f8
Keyboard input: 15
LCD output: f8
Keyboard input: 25
LCD output: fe
Is this just the formating problem or is this something else ? |
|
|
guest2 Guest
|
|
Posted: Sat Mar 15, 2008 1:47 am |
|
|
One more thing, that i forget to mention.
If i dont want to type the characters, if i just want to read the whole
string, can i pass this data as like thru file transfer ?
If so, then how to read this data on my picdem ?
E.g.
This is the text that i have writen before and this is what i want to see on
my LCD. 0x1,0x2,0x3,0x4, bla bla bla. |
|
|
|