Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

PICC18 how to use puts function

Status
Not open for further replies.

mike2002

Member level 2
Joined
Sep 16, 2002
Messages
47
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
c/c++ programming
Activity points
328
PICC18

Do anybody know how to use "puts" function for serial port.
I got working putch(), getch() - but not puts(). Looks like skiping over string. I used sources provided with PICC18 but not succesfull.
printf() works fuzzy - outputs caracters zig-zag over the terminal screen.
Chip in use - PIC18F2320
Can anybody help???
:(
 

SAR

Advanced Member level 4
Joined
Sep 25, 2002
Messages
107
Helped
5
Reputation
10
Reaction score
2
Trophy points
1,298
Activity points
988
Picc18

Without seeing your code can't tell much except make sure your baud rate and stop bits, data bits and handshaking are all set according to your code.
Are u using a max232 type chip to interface? If not you need to set your polarity correctly, ie invert or true according to your hardware.
I use this software for the serial port it's very good: http://bray.velenje.cx/avr/terminal/

Best regards....SAR
 

froggy

Member level 5
Joined
Jul 6, 2001
Messages
84
Helped
3
Reputation
6
Reaction score
1
Trophy points
1,288
Activity points
699
A question, when using printf, did you remember to include the new-line
character (\n) in the end of each line, if you didn't that could explain the zig-zag output you mentioned.

puts() should just take one zero terminated string as parameter, and use
putch() to output each char. puts() replace the string termination \0 with a \n.

/Froggy
 

mike2002

Member level 2
Joined
Sep 16, 2002
Messages
47
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
c/c++ programming
Activity points
328
PICC18 /puts/printf

I did everything what Froggy suggest but still problem.
Froggy, Could you post piece of code of how you did?
Even if I put in printf("....\n"); - desn't go to the new line.
Is it necessary special treatment of flash strings???
Thanks
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top