Zwilorg
Member level 5
Hello,
I am having some trouble getting a proper connection between the pic 16F877 and the computer.
I am simulating everything with isis proteus and getting the with the program RS232analyzer
**broken link removed**
Altough the data packages get out the information does not arrive properly at the 232analyzer :S
a little bit of the code:
the uart.h, determinations
i don´t know what is happening :S maybe it is a proplem on the sync?
Best regards,
Zwi
I am having some trouble getting a proper connection between the pic 16F877 and the computer.
I am simulating everything with isis proteus and getting the with the program RS232analyzer
**broken link removed**
Altough the data packages get out the information does not arrive properly at the 232analyzer :S
a little bit of the code:
Code:
#define XTAL_FREQ 4MHZ
#include <stdio.h>
#include <htc.h>
#include <pic.h>
#include <math.h>
#include "lcd.h"
#include "usart.h"
#include <string.h>
void main(void)
{
System_init(); // Calling System_Init Subroutine
INTCON=0; // purpose of disabling the interrupts
init_comms(); // set up the USART - settings defined in usart.h
init_adc(); // Calling init_adc Subrotine
lcd_init(); // Calling lcd_init defined in lcd.h
lcd_goto(0); // select first line in LCD
lcd_puts("Encoder:"); // display text in first line
lcd_goto(0x40); // Select second line
lcd_puts("Tempera: "); // display text in second line
Counter=0; // Setting the step counter as 0
temp=0;
while(1)
{
lcd_goto(0x48); // Select second line
display_value(Counter);
lcd_putch('C');
lcd_goto(0x08);
display_value1(Counter);
lcd_putch('m');
__delay_ms(100);
printf("\n%004d%%%04d\n", Counter,temp);
Counter=Counter+1;
} // End of While(1)
} // End of void(main)
the uart.h, determinations
Code:
#define BAUD 9600
#define FOSC 4000000L
#define NINE 0 /* Use 9bit communication? FALSE=8bit */
#define SPEN 1;
#define CREN 1; //Enable Receiver (RX)
#define DIVIDER ((int)(FOSC/(16UL * BAUD) -1))
#define HIGH_SPEED 1
i don´t know what is happening :S maybe it is a proplem on the sync?
Best regards,
Zwi