PIC Basic Compiler Examples • • • - - - - - - PIC Basic Compiler Examples • • • • • • • • • • • • • • • PIC Basic Compiler Examples This page contains several complete examples where PIC Simulator IDE integrated PIC Basic compiler is used to get the HEX file ready to be programmed into a real PIC chip. All examples presented on this page were tested on the development board for PIC16F877A microcontroller that is documented on the Projects Page. All schematics are subsections of the schematics of the whole development board. EXAMPLE 1: Basic LCD test - Schematics: - The photo of the program execution: - Basic source program: Define CONF_WORD = 0x3f72 Define CLOCK_FREQUENCY = 12 AllDigital Define LCD_BITS = 8 Define LCD_DREG = PORTD Define LCD_DBIT = 0 Define LCD_RSREG = PORTE Define LCD_RSBIT = 0 Define LCD_RWREG = PORTE Define LCD_RWBIT = 1 Define LCD_EREG = PORTE Define LCD_EBIT = 2 Define LCD_READ_BUSY_FLAG = 1 Lcdinit 3 Dim a As Word a = 65535 loop: Lcdcmdout LcdClear Lcdout 'I am counting!' :: Programming Clues Hardware Clues microEngineering Labs, Inc.| 1-719-520-5323| Example Program - LCD.pbp PICBASIC PRO program to demonstrate operation of an LCD in 4-bit mode. ' Name: LCD.pbp ' Compiler: PICBASIC PRO Compiler 2.6 ' Assembler: PM or MPASM ' Target PIC: 16F or 18F ' Hardware: LCD display ' Oscillator: Any internal or external ' Keywords: LCDOUT ' Description: PICBASIC PRO program to demonstrate operation of an LCD in 4-bit mode. ' ' LCD should be connected as follows: ' LCD PIC ' DB4 PortA.0 ' DB5 PortA.1 ' DB6 PortA. Salsa and afro cuban montunos for piano pdf torrent. 2 ' DB7 PortA.3 ' RS PortA.4 (add 4.7K pullup resistor to 5 volts) ' E PortB.3 ' RW Ground ' Vdd 5 volts ' Vss Ground ' Vo 20K potentiometer (or ground) ' DB0-3 No connect Pause 500 ' Wait for LCD to startup mainloop: Lcdout $fe, 1 ' Clear LCD screen Lcdout 'Hello' ' Display Hello Pause 500 ' Wait.5 second Lcdout $fe, 1 ' Clear LCD screen Lcdout 'World' Pause 500 ' Wait.5 second Goto mainloop ' Do it forever End the program file. Copyright 2015 ME Labs, Inc. Extensive tutorials on 8-bit PIC microcontrollers, in assembly language and C. Programming PIC Microcontrollers in BASIC - mikroElektronika Table of Contents Preface Chapter 1: The Basics Chapter 2: Elements of BASIC Language.
![]() 2845 Ore Mill Road, STE 4 Colorado Springs CO 80904 (719) 520-5323 (719) 520-1867 fax email.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |