Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

Project Request

Return
Willy Lievens
willy.zon

posted on 2013/02/01 10:42:30 AM CET

Communication > USB

Menu Tools USART Terminal for USB-communication

Hello,

I work with EasyPIC-7/MikroC PRO for PIC/16F887, a wonderful platform!
My PC has no tradional RS232 COM-port (DSUB-9).
So, I want to use the USB UART (at the left side of the 4x7-segment display)
My PC recognice the USB-connection with the build-in USART Terminal (on USB/COM-3).
There is communication... but the program doesn't work. I receive only strange characters.
The USART-terminal settings for this are:
Bits per second: 9600, Data Bits: 8, Parity: None, Stop bits: 1, Flow control: None.
What's my problem?

Can you help me?
Willy

void newline()
{
UART1_Write(13); // Carriage Return
UART1_Write(10); // Line Feed
}

void main()
{
unsigned char MyError, Temp;

ANSEL = ANSELH = 0x00;
C1ON_bit = C2ON_bit = 0; // Disable Comparators
TRISB = 0b00000010;
UART1_Init(9600);
Delay_ms(100);
UART1_Write_Text("Testing UART! ");
newline();

do
{
UART1_Write_Text("Type in a Number: ");
while(!UART1_Data_Ready());
Temp = UART1_Read();
newline();
UART1_Write_Text("You entered: ");
UART1_Write(Temp);
newline();
} while(1);
} // End main()

USER Comments

dany
Dany

posted on 2013/04/28 06:56:46 AM CEST

Hoi Willy,

Meest waarschijnlijk heeft het iets te maken met de settings in de PIC: de MCU clockfrequentie bvb.
Weet je zeker dat het PIC programma wel loopt?
Moest ik jou zijn, dan zou ik de communictatie van PIC naar PC eerst testen in plaats van het volledige programma.
Dus: laat de PIC continue een text zenden naar de PC en debug deze opstelling.
Heb je een oscilloscoop om de Uart output van de PIC the checken (baud rate enz...)?

  • Rating:
0
No Abuse Reported

Do you want to report abuse comment ID: 701 in "Menu Tools USART Terminal for USB-communication" request.