Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] pic 16f1824 problem with internal oscillator

Status
Not open for further replies.
untitled.JPG
this is the settings i used in project .where is PLLEN?
 

void main()
{

OSCCON=0x72;
ANSELA=0;
delay_ms(500);
UART1_Init(9600) ;

TXCKSEL_bit=1;
TRISA0_bit=0;
ANSELC=0x00;
TRISC0_bit=0;

delay_ms(2000);





while (1)
{
UART1_Write('A');
RC0_bit=1;
delay_ms(1000);
RC0_bit=0;
delay_ms(1000);


} }




this is the code used to test usart...but nothing write in the terminal..but the pin is toggling
 

this is the rar file containing the project

- - - Updated - - -

TXCKSEL_bit=1
this is bit in the APFCON0 Register
 

Attachments

  • pjcttest.rar
    735 bytes · Views: 92

Disable the comparators and the capacitive sensing module:
Code:
CM1CON0 = 0;
CM2CON0 = 0;
CPSON_bit = 0;

Does the program run with external oscillator?

- - - Updated - - -

Change value of OSCCON to 0x70.
 

Disable the comparators and the capacitive sensing module:
Code:
CM1CON0 = 0;
CM2CON0 = 0;
CPSON_bit = 0;

Does the program run with external oscillator?

- - - Updated - - -

Change value of OSCCON to 0x70.

OSCCON0=0X70 makes delay verly large.i dont have option to test with external oscillator
 

Try with this code:
Code:
    void main()
    {
    OSCCON=0x72;
    ANSELA=0;
    TRISA0_bit=0;
    
    TXCKSEL_bit=1;
    RXDTSEL_bit=1;
    //UART1_Init(9600);

    SPBRGH = 0;
    SPBRGL = 12;
    BRGH_bit = 0;
    BRG16_bit = 0;
    SYNC_bit = 0;
    SPEN_bit = 1;
    TX9_bit = 0;
    TXEN_bit = 1;
    
    delay_ms(500) ;

    CPSON_bit=0;
    C1ON_bit=0;
    GIE_bit=0;

    TRISA1_bit=1;
    TRISC5_bit=0;


    TRISC4_bit=1;


    // initialize UART1 module


    while (1)
    {
    TXREG = 'A';
    RC0_bit=1;
    delay_ms(1000);
    RC0_bit=0;
    delay_ms(1000);

    } }

2378241100_1353669485.png
 

Try with this code:
Code:
    void main()
    {
    OSCCON=0x72;
    ANSELA=0;
    TRISA0_bit=0;
    
    TXCKSEL_bit=1;
    RXDTSEL_bit=1;
    //UART1_Init(9600);

    SPBRGH = 0;
    SPBRGL = 12;
    BRGH_bit = 0;
    BRG16_bit = 0;
    SYNC_bit = 0;
    SPEN_bit = 1;
    TX9_bit = 0;
    TXEN_bit = 1;
    
    delay_ms(500) ;

    CPSON_bit=0;
    C1ON_bit=0;
    GIE_bit=0;

    TRISA1_bit=1;
    TRISC5_bit=0;


    TRISC4_bit=1;


    // initialize UART1 module


    while (1)
    {
    TXREG = 'A';
    RC0_bit=1;
    delay_ms(1000);
    RC0_bit=0;
    delay_ms(1000);

    } }

2378241100_1353669485.png
no tahmid its not working....
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top