PIC sērijas dati

M

miryazdan

Guest
sveiki

PLZ help me rakstiski PIC kodam C transmittimg sērijas datu ......

 
Ataki DDoS należą do grupy najstarszych zagrożeń w Internecie, jednak wciąż plasują się w czołówce największych sieciowych plag. Wraz z rozwojem systemów bezpieczeństwa ewoluowały, a ich głównym celem stały się aplikacje i usługi.

Read more...
 
You ca Unse printf CCS sast.piemērus meklējiet šo ebook: plānošanas c pic mikrokontrolleru Nigel gadner

 
Ja jūs izmantojat CCS:

Kods:////////////////////////////////////////////////// ///////////////////////

/ / / / EX_ENCRY.C / / / /

/ / / / / / / /

/ / / / Šī programma parāda, kā ieviest divas sērijas ostas / / / /

/ / / / Pārsūtītu datus starp ostām un encrypt / atšifrēt / / / /

/ / / / No vienas puses, datu drošu komunikācijas saiti. / / / /

/ / / / / / / /

/ / / / ------ ----- ----- ------ / / / /

/ / / / | PC | | PIC | | PIC | | PC | / / / /

/ / / / | |====| |=============| B |====| B | / / / /

/ / / / ------ ----- Drošu ----- ------ / / / /

/ / / / Stieples / / / /

/ / / / / / / /

/ / / / Configure CCS prototips karti, kā aprakstīts turpmāk. / / / /

/ / / / / / / /

/ / / / Šis piemērs strādās ar AFL.
/ / / /

/ / / / Šādiem nosacījumiem apkopošanai līniju izmanto arī / / / /

/ / / / Derīgu ierīci katram sast. Mainīt ierīce, pulksteņu un / / / /

/ / / / RS232 tapas aparatūras, ja nepieciešams. / / / /

////////////////////////////////////////////////// ///////////////////////

/ / / / (C) Copyright 1996,2003 Custom Computer Services / / / /

/ / / / Šo pirmkodu drīkst izmantot tikai ar licencētiem lietotājiem CCS / / / /

/ / / / C kompilatoru. Šo pirmkodu drīkst izplatīt citām / / / /

/ / / / Licencētiem lietotājiem CCS C kompilatoru. Nevienai citai izmantošanai, / / / /

/ / / / Pavairošana vai izplatīšana ir atļauta bez rakstiskas / / / /

/ / / / Permission. Atvasinātie programmām, kas radītas, izmantojot šo programmatūru / / / /

/ / / / In objekta kodu veidā nav jebkādā veidā ierobežot. / / / /

////////////////////////////////////////////////// ///////////////////////# Ja defined (__PCM__)

# include <16F877.h>

# drošinātāji HS NOWDT, NOPROTECT, NOLVP

# izmantošanas kavēšanās (clock = 20000000)# elif defined (__PCH__)

# include <18F452.h>

# drošinātāji HS NOWDT, NOPROTECT, NOLVP

# izmantošanas kavēšanās (clock = 20000000)

# endif# define BUFFER_SIZE 32////////////////////////////////////////////////// /////////////// 1 PORT

# izmantot RS232 (Baud = 9600, xmit = PIN_C6, PS = PIN_C7)baits buffer1 [BUFFER_SIZE];

baits next_in1 = 0;

baits next_out1 = 0;# int_rda

anulēts serial_isr1 () (

int t;buffer1 [next_in1] = getc ();

t = next_in1;

next_in1 = (next_in1 1)% BUFFER_SIZE;

if (next_in1 == next_out1)

next_in1 = t; / / Buffer pilns!

)# define bkbhit1 (next_in1! = next_out1)baits bgetc1 () (

baits c;while (! bkbhit1);

c = buffer1 [next_out1];

next_out1 = (next_out1 1)% BUFFER_SIZE;

return (c);

)anulēts putc1 (char c) (

putc (c);

)////////////////////////////////////////////////// /////////////// PORT 2

# izmantot RS232 (Baud = 9600, xmit = PIN_B1, PS = PIN_B0)baits buffer2 [BUFFER_SIZE];

baits next_in2 = 0;

baits next_out2 = 0;# int_ext

anulēts serial_isr2 () (

int t;buffer2 [next_in2] = getc ();

t = next_in2;

next_in2 = (next_in2 1)% BUFFER_SIZE;

if (next_in2 == next_out2)

next_in2 = t; / / Buffer pilns!

)# define bkbhit2 (next_in2! = next_out2)baits bgetc2 () (

baits c;while (! bkbhit2);

c = buffer2 [next_out2];

next_out2 = (next_out2 1)% BUFFER_SIZE;

return (c);

)anulēts putc2 (char c) (

putc (c);

)////////////////////////////////////////////////// /////////////////////////////////////anulēts main () (

char c;enable_interrupts (global);

enable_interrupts (int_rda);

enable_interrupts (int_ext);printf (putc2, "\ r \ n \ kustības ... \ r \ n");do (

if (bkbhit1) (

c = bgetc1 ();

putc2 (c);

)

if (bkbhit2) (

c = bgetc2 ();

putc1 (c);

)

) While (true);

)

 

Welcome to EDABoard.com

Sponsor

Back
Top