a.mattioli
Joined: 19 Jun 2007 Posts: 4
|
Arrays and pointers |
Posted: Tue Jun 19, 2007 7:46 am |
|
|
I have some problem about the character string to serial transmission with RS232. I use the PIC16F877 and in the book "Embedded C Programming and the Microchip PIC" of THOMSON (written by Barnett, Cox & O'Cull) to pg. 49 there is an example about the character string.
I would know the reason because on video I show:
" This is a test / "
Below, I write the code:
#include <16F877.h>
#fuses HS
#use delay(clock=20000000)
#use rs232(baud=9600, parity=N, xmit= PIN_C5, rcv=PIN_C7,stream=, bits=8)
#include <stdio.h>
void main()
{
char i;
char *p;
const char s[15] = {"This is a test"};
for(i=0; i<15; i++) putchar(s[i]);
p = s;
for(i=0; i<15; i++) putchar(*p++);
} |
|