Pic Simulator Ide

Páginas: 17 (4118 palabras) Publicado: 13 de diciembre de 2012
PIC Simulator IDE
Getting Started
There are eleven examples bundled with PIC Simulator IDE. They are located in application folder.
This is short step by step guide for the beginners that will help them to test these examples and in
that way explore the most important features of PIC Simulator IDE.
Example 1: Timer0 module simulation, TMR0 interrupts
Example 2: RB0/INT external interruptsExample 3: EEPROM data memory access simulation
Example 4: Math multiply routine, demonstration of compiler, assembler and debugger
Example 5: A/D module simulation
Example 6: Comparator and voltage reference modules simualtion
Example 7: LCD module simulation
Example 8: Hardware UART module simulation
Example 9: Software UART simulation interface
Example 10: 7-segment LED displayssimulation
Example 11: Signal generator and oscilloscope simulation modules
EXAMPLE 1
- Examine timer0.bas file from the application folder. This Basic program uses Timer0 module
interrupts to periodically change the value on PORTB pins. File timer0.asm was generated using
integrated Basic compiler. File timer0.hex was generated using integrated assembler.
TRISB = 0x00 'set all PORTB pins as outputsPORTB = %11111111 'make all PORTB pins high
INTCON.T0IE = 1 'enable Timer0 interrupts
INTCON.GIE = True 'enable all un-masked interrupts
OPTION_REG.T0CS = False 'set Timer0 clock source to internal instruction
cycle clock
End
On Interrupt 'interrupt routine
PORTB = PORTB - 1 'decrement the value on PORTB
INTCON.T0IF = 0 'enable new TMR0 interrupts
Resume
- Start PIC Simulator IDE.
-Click on Options\Select Microcontroller.
- Select 'PIC16F84' and click on Select button.
- Click on File\Load Program.
- Select timer0.hex file and click on Open. That will load the program into PIC program memory.
- Click on Tools\Microcontroller View. That will open the Microcontroller View window.
- Reposition the windows on the screen to get better view.
- Select the Rate\Extremely Fastsimulation rate.
- Click on Simulation\Start. The simulation will start immediately.
- This Basic program uses Timer0 module interrupts to periodically change the value on PORTB
pins.
- The simulation can be stopped any time by clicking on Simulation\Stop.
Note: If you would like to compile this example for some other PIC microcontroller model, it might be
necessary to change T0IE and T0IFbit names to TMR0IE and TMR0IF. You should check in the
datasheet of the model you want to use what are the correct bit names for INTCON register.
- Screenshot: view
EXAMPLE 2
- Examine rb0int.bas file from the application folder. This Basic program uses RB0/INT pin based
interrupts to change the value on PORTA. File rb0int.asm was generated using integrated Basic
compiler. File rb0int.hex wasgenerated using integrated assembler.
TRISA = 0x00 'set all PORTA pins as outputs
PORTA = 0xff 'make all PORTA pins high
INTCON.INTE = 1 'enable RB0/INT interrupts
INTCON.GIE = 1 'enable all un-masked interrupts
End
On Interrupt 'interrupt routine
PORTA = PORTA - 1 'decrement the value on PORTA
INTCON.INTF = 0 'enable new RB0/INT interrupts
Resume
- Start PIC Simulator IDE.
- Click onOptions\Select Microcontroller.
- Select 'PIC16F84' and click on Select button.
- Click on File\Load Program.
- Select rb0int.hex file and click on Open. That will load the program into PIC program memory.
- Click on Tools\Microcontroller View. That will open the Microcontroller View window.
- Reposition the windows on the screen to get better view.
- Select the Rate\Extremely Fastsimulation rate.
- Click on Simulation\Start. The simulation will start immediately.
- This Basic program uses RB0/INT pin based interrupts to change the value on PORTA.
- Clicking on T button associated with RB0/INT pin will keep toggling the logical state of this pin.
Interrupts will be triggered on the rising edge of the pulses. Every time the value on PORTA will be
changed.
- The simulation can...
Leer documento completo

Regístrate para leer el documento completo.

Estos documentos también te pueden resultar útiles

  • manual pic simulator ide
  • Pic simulator ide
  • Uso de software para pic, mplab y pic simulator
  • Manual de pic simulator
  • Manual pic simulator
  • Simulator
  • Pica Pica
  • El pico

Conviértase en miembro formal de Buenas Tareas

INSCRÍBETE - ES GRATIS