- This topic has 0 replies, 1 voice, and was last updated 10 years, 10 months ago by .
Viewing 1 post (of 1 total)
Viewing 1 post (of 1 total)
- You must be logged in to reply to this topic.
|
Microcontroller › PIC › UART simulator MPLAB X IDE
Hello, I tried to use the logic analyzer to test the USART module but it does not work.
So I want to try the uart I/Osimulator on MPLAB X. The PIC is 18F4431. I check enable UART I/O on simulator properties and set window in output field.
Where is the window where appear the data trasmitted? I don’t find it. I see in the output -> simulator window but is written only this:
<cite>Resetting peripherals
Running
Single breakpoint: @0x3F2E
Running
Resetting SFRs
Resetting peripherals
Resetting SFRs
Resetting peripherals
Running
Single breakpoint: @0x3F76
Running
Running
Running
Resetting SFRs
Resetting peripherals
Running
Running</cite>
This is the code:
<code>
#include <stdio.h>
#include <stdlib.h>
#include <xc.h>
#include <plib/usart.h>
int main(int argc, char** argv) {
int word = 0b10101010;
baudUSART(BAUD_IDLE_CLK_LOW & BAUD_8_BIT_RATE & BAUD_WAKEUP_OFF & BAUD_AUTO_OFF);
OpenUSART(USART_TX_INT_OFF & USART_RX_INT_OFF & USART_BRGH_LOW & USART_SYNC_MASTER & USART_EIGHT_BIT & USART_ADDEN_OFF, 1);
//ReadUSART();
//printf(“hello”);
while(1){
if(TXSTAbits.TRMT==1){
WriteUSART(word);
}
}
return (EXIT_SUCCESS);
}
</code>
Thanks.