Serial Port Complete Second Edition adds firmware examples for PICBASIC PRO, Microchip’s. An example of a microcontroller with a serial port is Parallax Inc.’s. PicBasic PRO Examples. These examples are designed to demonstrate how to use a PIC16F877 and PicBasic PRO to. The SRF01 uses a single pin for both serial input and. PicBasic PRO Examples. These examples are designed to demonstrate how to use a PIC16F877 and PicBasic PRO to. The SRF01 uses. :: Programming Clues Hardware Clues PBP examples written for PIC12F675 running on the LAB-X4 The 12F675 has been replaced by the 12F683. The 675 is a finicky chip that requires calibration to reliably use the internal oscillator. PICBASIC PRO program to display result of 10-bit A/D conversion on Lab-X4 serial LCD. PICBASIC PRO program to display result of 8-bit A/D conversion on Lab-X4 serial LCD. PICBASIC PRO program to blink an LED connected to GPIO.0 about once a second PICBASIC PRO program for LAB-X4 serial LCD controller - PIC16F676. PICBASIC PRO program to show button press on LED. PICBASIC PRO program for LCD clock using On Interrupt. ![]() Uses TMR0 and prescaler. Watchdog Timer should be set to off at program time and Nap and Sleep should not be used. Button may be used to set time PICBASIC PRO program to send 'Hello World' on serial port (and LCD) PICBASIC PRO program to read and write to I2C SEEPROMs Write to the first 16 locations of an external serial EEPROM, and then read first 16 locations back and send to LCD repeatedly. Note this example is for SEEPROMs with byte-sized address. PICBASIC PRO program to display 'Hello World' on LCD (and serial port) PICBASIC PRO program for recovering factory OSCCAL calibration values. Run this program in a 12F675 on the LAB-X4 Experimenter Board. It will display gibberish on the LCD until the calibration value is incremented to a value that lets the serial communication work. It will continue to display hex calibration values until incremented beyond the working range. Let it run, monitor the LCD for values followed by 'Correct?' Pick one of the values that work - midway after it starts working and before it stops working. PICBASIC PRO test program for LAB-X4 (12F675) PICBASIC PRO code example showing upper case serial filter. PICBASIC PRO program to measure voltage (0-5VDC) and display on LCD with 2 decimal places. This program uses the */ operator to scale the ADC result from 0-1023 to 0-500. The */ performs a divide by 256 automatically, allowing math which would normally exceed the limit of a word variable. Connect analog input to channel-3 (RA4) Copyright 2015 ME Labs, Inc. 2845 Ore Mill Road, STE 4 Colorado Springs CO 80904 (719) 520-5323 (719) 520-1867 fax email. Example for M2 parts Echo 1 serial byte at a time at 9600 baud Code Example: hsersetup B9600_4,%00; baud 9600 at 4MHz main: w1 = $FFFF; set up a non-valid value hserin w1; receive 1 byte into w1 if w1 $FFFF then; if a byte was received hserout 0,(w1); echo it back out end if goto main; loop Submit Your Own Code! You must be logged in to submit code examples.. Comments • Posted by thomasfoltz 06 January 2013 I have noticed the example above shows a word value used for hserin. Doesn't the M2 version of hserin only work with byte values? • Posted by hippy 09 January 2015 In Example 2; the word variable is used to receive a byte value, with its most significant byte being used to indicate when a byte has been received. • to leave a comment. Serial comunication can be annoying (custom cable connections, RS232 to TTL voltage levels, baud rates, etc). Use a feedback loop (connect serial port's 'out' pin with the 'in' pin) and hyperterminal (free prog that comes with windows) to test your computer's serial output before you try to connect to external electronics (like the PIC). Yeah, I guess I'm self taught, I started with BasicStamps and worked up to PICs when the basic stamp wasn't good enough for my projects. The PIC code is just in PICBasic, not assembly language. It would be really long and messy if it was in assembly. They do have assembly language interupt code examples in the PICBasic manual though.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2019
Categories |