Learn-about-electronics.com Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Learn-about-electronics.com Forum

This forum is an extension of Learn-about-electronics.com and is a place where thousands of students, hobbyists and professionals from around the world can come to share knowledge and ideas.
 
HomeHome  PortalPortal  GalleryGallery  Latest imagesLatest images  SearchSearch  RegisterRegister  Log inLog in  
Latest topics
» Circuit Analyze Software
PIC 16f1527  EmptyMon Oct 20, 2014 9:47 am by aimaty

» Pharmacodynamics Lect.1.ppt
PIC 16f1527  EmptyFri Mar 28, 2014 5:45 am by renardill

» HOT! Visions Of Ecstasy Fragman Izle
PIC 16f1527  EmptyWed Mar 26, 2014 1:04 am by renardill

» Histopathology_frcpath_mcq_exam_books.zip
PIC 16f1527  EmptyTue Mar 25, 2014 11:51 pm by renardill

» Technical Writing
PIC 16f1527  EmptySun Mar 23, 2014 10:58 pm by renardill

» Cars 2 Full Movie Free In Arabic
PIC 16f1527  EmptyTue Mar 18, 2014 6:50 pm by renardill

» Cars 2 Full Movie Free In Arabic
PIC 16f1527  EmptyTue Mar 18, 2014 6:49 pm by renardill

» Are we losing our independence?
PIC 16f1527  EmptySat Aug 10, 2013 2:55 am by ryaanjasper

» Electronics for the modern world
PIC 16f1527  EmptySat Aug 10, 2013 2:47 am by ryaanjasper

Search
 
 

Display results as :
 
Rechercher Advanced Search
Affiliates
free forum

May 2024
MonTueWedThuFriSatSun
  12345
6789101112
13141516171819
20212223242526
2728293031  
CalendarCalendar
Electronics for the modern world
PIC 16f1527  EmptyThu May 24, 2012 11:24 pm by Admin
Can we get along without electronics? Would the world be a better place without technology? I don't want to find out. I love my technology and gadgets. Electronics make our world function better. Can you live without electronics? What are your thoughts?

Comments: 2
Frequency and Speed
PIC 16f1527  EmptyWed Oct 31, 2012 2:17 pm by Admin
So, I recently had a visitor to LAE asking the following:

I have a 100 year old fan with a labeled frequency of 133Hz. Will the fan rotate slower or faster if I plug it in to a 60Hz outlet?

Would anyone care to answer this question?

Comments: 0
Your first subject
PIC 16f1527  EmptyThu May 24, 2012 10:13 pm by Admin
Take some time to read this information before starting to use the administration of your forum:

How to access your administration panel ?
In the top menu, click on Log In, a new page is displayed. Fill in the username "admin" and the password you have choosen during your registration. If you have lost or forgot it, click here. Once you are logged in, click on the link "Administration Panel" at …

[ Full reading ]
Comments: 0
Translate

 

 PIC 16f1527

Go down 
AuthorMessage
rparthiban69




Posts : 1
Join date : 2013-03-14

PIC 16f1527  Empty
PostSubject: PIC 16f1527    PIC 16f1527  EmptyThu Mar 14, 2013 2:03 am

PIC 16f1527 have a two UART ports. Am using UART1 for my application. See my UART program,any problem in UART1 configuration registers?

I need standard (tested) UART program or UART configure register format. FOSC=20MHZ.

Baudrate calculated by using datasheet SPBRG baudrate value(Table22-5) depends upon SYNC,BRGH and BRG16.

How to configure 8bit SPBRG and 16bit SPBRG?

Code:
#include<pic.h>

__CONFIG(FOSC_HS & WDTE_OFF & PWRTE_ON & MCLRE_OFF & CP_OFF & BOREN_ON & CLKOUTEN_OFF & IESO_ON & FCMEN_ON);
__CONFIG(WRT_OFF & VCAPEN_OFF & LPBOR_OFF & STVREN_OFF & BORV_HI & LVP_OFF);


unsigned int flag=0,rx_count=0,count;
bank1 unsigned char a[75]={0};
void send_message(unsigned char const *msg);
void main()
{
// UART checking
TRISA=0X3F;
TRISB=0XFF;
TRISC=0X80;
TRISD=0xFF;
TRISE=0X07;

PORTA=0;
PORTB=0;
PORTC=0;
PORTD=0;
PORTE=0;

TX1STAbits.BRGH=1; /* high baud rate */
SPBRG=520; /* set the baud rate */


BAUD1CONbits.BRG16 = 1;
BAUD1CONbits.ABDOVF = 0;
BAUD1CONbits.RCIDL = 0;
BAUD1CONbits.SCKP = 0;
BAUD1CONbits.WUE = 0;
BAUD1CONbits.ABDEN = 0;


TX1STAbits.SYNC = 0; /* asynchronous */
TX1STAbits.SENDB = 1;
TX1STAbits.CSRC = 0;
TX1STAbits.TXEN = 1; /* enable the transmitter */
TX2STAbits.TXEN = 0; /* disable the transmitter2 */


RC1STAbits.SPEN = 1; /* enable serial port pins */
RC1STAbits.CREN = 1; /* enable reception */
RC1STAbits.SREN = 0; /* no effect *///
RC2STAbits.SPEN = 0; /* disable serial port2 pins */
RC2STAbits.CREN = 0; /* disable reception2 */

OSCCONbits.IRCF3=1; //16 MHz Internal osc freq
OSCCONbits.IRCF2=1;
OSCCONbits.IRCF1=1;
OSCCONbits.IRCF0=1;
OSCCONbits.SCS1=1;
OSCCONbits.SCS0=0;

INTCONbits.GIE=PEIE=1;
PIE1bits.RC1IE=1;
send_message("0x35");


while(1)
{
//if(flag==1)
//{
LATC3=0xFF;
for(count=0;count<50000;count++);
for(count=0;count<50000;count++);
for(count=0;count<50000;count++);
LATC3 =0x00;
for(count=0;count<50000;count++);
for(count=0;count<50000;count++);
for(count=0;count<50000;count++);
rx_count=0;
flag=0;
send_message("\r\n");
send_message("UART Receive");
send_message("\r\n");
//}
}

}
void send_message(unsigned char const *msg)
{
while(*msg!='\0')
{
TX1REG=*msg;
while(!TX1STAbits.TRMT);
msg++;
}
}
void interrupt isr()
{
if(PIR1bits.RC1IF==1)
{
PIR1bits.RC1IF=0;
rx_count++;
if(rx_count>70)
rx_count=1;
a[rx_count]=RC1REG;

if(a[rx_count]==0x0d)//Press Enter button
{
flag=1;
}
}


}
Back to top Go down
 
PIC 16f1527
Back to top 
Page 1 of 1

Permissions in this forum:You cannot reply to topics in this forum
Learn-about-electronics.com Forum :: Microcontrollers, Programming, and Embedded Systems Chat :: Programming-
Jump to: