Zulo
Newbie level 4
The Problem Have Solved... You can see it end of this page. Thanks
Hi guys,
I'm new here. i have checked many topics but cant find the problem like mine.
Thanks For all your helps.
What i have to do is:
Send data from MATLAB!
Receive it from PIC16f877!
control some pins...
*Problems
I can Send data from MATLAB
I can see it on Virtual Terminal out of RS232
But i cant see it out of PIC. The data changes...
*
I tried another one (without MAX232)
i send integer 11
But PIC can not understand the data which MATLAB sent...
//---The Codes--\\
MATLAB CODE FOR SERIAL DATA SEND
s=serial('COM1');
set(s,'BaudRate',9600)
fopen(s);
tx=11;
fprintf(s,'%d',tx);
fclose(s)
delete(s)
clear s
disp('SENT');
---
MICROC CODE FOR DATA RECEIVE AND SEND
unsigned int ii;
void main() {
TRISB=0;
PORTB=0xFF;
UART1_Init(9600);
Delay_ms(100);
while (1) {
if (UART1_Data_Ready()) {
ii = UART1_Read();
UART1_Write(ii);
}
}
}
---
The Proteus Design:
(Without MAX232)
***
What i have tried before and useles:
use 4 x 1uf for Max232
change PIC code like
unsigned char/ char / int / unsigned int
Change MATLAB code
char / fwrite / odd*even*none parity bits.
Sory For My Bad english:sad:
Hi guys,
I'm new here. i have checked many topics but cant find the problem like mine.
Thanks For all your helps.
What i have to do is:
Send data from MATLAB!
Receive it from PIC16f877!
control some pins...
*Problems
I can Send data from MATLAB
I can see it on Virtual Terminal out of RS232
But i cant see it out of PIC. The data changes...
*
I tried another one (without MAX232)
i send integer 11
But PIC can not understand the data which MATLAB sent...
//---The Codes--\\
MATLAB CODE FOR SERIAL DATA SEND
s=serial('COM1');
set(s,'BaudRate',9600)
fopen(s);
tx=11;
fprintf(s,'%d',tx);
fclose(s)
delete(s)
clear s
disp('SENT');
---
MICROC CODE FOR DATA RECEIVE AND SEND
unsigned int ii;
void main() {
TRISB=0;
PORTB=0xFF;
UART1_Init(9600);
Delay_ms(100);
while (1) {
if (UART1_Data_Ready()) {
ii = UART1_Read();
UART1_Write(ii);
}
}
}
---
The Proteus Design:
(Without MAX232)
***
What i have tried before and useles:
use 4 x 1uf for Max232
change PIC code like
unsigned char/ char / int / unsigned int
Change MATLAB code
char / fwrite / odd*even*none parity bits.
Sory For My Bad english:sad:
Last edited: