TODOPIC
Microcontroladores PIC => Lenguaje C para microcontroladores PIC => Mensaje iniciado por: ranica en 06 de Junio de 2003, 03:44:00
-
Hola, utilizo Mplab IDE para simular los programas en C, ¿Sabes como se simula la transmisión utilizando rs232?, verás para recibir se debe actibar el PIR1 flag RCIF y colocar el char en RCREG, para transmitir supongo que se activara el flag TXIF del PIR1 ¿Y que más? Grácias.
-
Desafortunadamente, no es posible simular la transmisión de Rs232, ya que los modulos ocupados por éste, son modificados mediante hardware, por lo tanto NO puedes modificar las banderas a las cuales te refieres
-
En una oportunidad tuve la misma inquietud. La informacion de como hacerlo está en el MPLAB:
Menu Help -> Topics -> MPLAB SIM (Doble click)
Click en pestaña Indice y escibes usart (enter)
Escojes "Using a USART/UART" click en Boton mostrar.
Allí encontrarás los siguientes apuntes.
Using a USART/UART
For devices that have a USART or UART peripheral, there are two ways in which to simulate this operation:
Using the UART1 I/O Tab - USART/UART simulation may be enabled and set up using the UART1 IO tab of the Settings dialog (Debugger>Settings). For more on this tab, see UART1 IO tab.
Using SCL Stimulus - USART/UART simulation may accomplished using SCL stimulus to USART registers. For more on SCL stimulus, see Using Stimulus.
For an example of simulating USART/UART operation, see below.
PIC18F MCU USART Example - Setup
PIC18F MCU USART Example - UART IO Tab
PIC18F MCU USART Example - SCL Stimulus
Updated PICDEM 2 Example Code
Espero haber podido ayudarte.
gfp