My first 16f88 code is here. Microstudio says it compiles correctly. I now need to try and load it into the pic!!
It should recieve 12 bytes of 9600,8,E,1 data via Usart RX the then squirt it out the other side via Usart TX.
Any glaring errors or ommisions?
Code:'------------------------------------- ' PBP Fake BCM CODE 21/10/09 V.04 '------------------------------------- @ DEVICE PIC16F88,INTRC_OSC_NOCLKOUT @ DEVICE PIC16F88,PROTECT_OFF @ DEVICE PIC16F88,WDT_OFF @ DEVICE PIC16F88,PWRT_ON @ DEVICE PIC16F88,MCLR_OFF @ DEVICE PIC16F88,BOD_OFF @ DEVICE PIC16F88,LVP_OFF @ DEVICE PIC16F88,CPD_OFF @ DEVICE PIC16F88,DEBUG_OFF @ DEVICE PIC16F88,CCPMX_OFF DEFINE OSC 8 ; set oscilator speed to 8mHz DEFINE HSER_BAUD 9600 DEFINE HSER_BITS 9 DEFINE HSER_EVEN 1 DEFINE HSER_CLROERR 1 ; Clear overflow automatically OSCCON=%01111000 '8 Mhz ANSEL = 0 'ALL DIGITAL CMCON = 7 'COMPARATORS OFF INTCON = 0 ;Disable interrupts TRISB = %00000100 ;RB2(RX) as input, others to Output TRISA = %11111111 ;SET PORTA AS INPUTS PORTB.4 = 1 DATAIN VAR BYTE[12] loop HSERIN [str DATAIN\12] HSEROUT [str DATAIN\12] goto looP END




Bookmarks