EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise
You are here: Home / Topics / 18F4431 USART MPALB X Logic Analyzer don’t work

18F4431 USART MPALB X Logic Analyzer don’t work

|

Microcontroller › PIC › 18F4431 USART MPALB X Logic Analyzer don’t work

  • This topic has 2 replies, 2 voices, and was last updated 11 years, 3 months ago by giuseppe.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 10, 2014 at 7:45 am #2935
    giuseppe
    Participant

    Hi everybody,

    I try PIC18F4431 to transmit a character with usart module on MPLAB X V2.05 simulator, but the logic analyzer of MPLAB remain flat.

    Why? I don’t understand, the code is simple. Bug on the simulator?

     

    This is the code:

    <code>

    #include <xc.h>

    //******************************************  

     //MAIN  
     //******************************************  
     int main(int argc, char** argv) {  
     
    int word=0b10101010;  
         PWMCON0bits
    .PWMEN2=0;   //PWM of on portB
         PWMCON0bits.PWMEN1=0;  
         PWMCON0bits
    .PWMEN0=0;  
         
    SSPCONbits.SSPEN=0;     //SSP off  
         ADCON0bits.ADON = 0;    //disable ADC module
         ANSEL0 = 0x00;          //disable A/D input
     
         
    INTCONbits.GIE = 0;   //disable interrupt
     
         
    TRISCbits.RC6 = 0;              //usart out pin
         TRISCbits.RC7 = 0;              //usart out pin
     
         TXSTA
    =0;                    //reset register
         RCSTA=0;                    //reset register
         BAUDCON=0;                    //reset register
         TXSTAbits.CSRC=1;            //clock from BRG  
         TXSTAbits.TX9=0;            //8 bit  
         TXSTAbits.SYNC=1;            //syncro
         TXSTAbits.BRGH=1;            //high speed  
     
         SPBRGH
    =0;                   //baud rate  
         SPBRG=16;  
     
         
    RCSTAbits.SPEN=1;           //serial port enable bit  
         TXSTAbits.TXEN=1;            //enable TX  
     
         TXREG
    =word;                 //transmit
         while(1);  
         
    return 0;  
     
    } </code>

    March 19, 2014 at 1:41 pm #11335
    AJISH ALFRED
    Participant

    Hi,

    Keep the code excluding the register settings inside the while (1) loop and try again.

    March 19, 2014 at 3:50 pm #11340
    giuseppe
    Participant

    No, the logic analyzer of MPLAB don’t simulate USART peripheral. I asked it on microchip forum.

  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

RSS Recent Posts

  • I Wanna build a robot July 13, 2025
  • Wierd makita battery July 13, 2025
  • using a RTC in SF basic July 13, 2025
  • Is AI making embedded software developers more productive? July 13, 2025
  • ac current limiting July 13, 2025

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2025 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
  • Advertise