The Godfather talking
You think I am funny guy huh?
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 26, 2024, 03:22:54 15:22


Login with username, password and session length


Pages: [1]
Print
Author Topic: Serial comm with PBP  (Read 4649 times)
0 Members and 1 Guest are viewing this topic.
MicroBox
Junior Member
**
Offline Offline

Posts: 35

Thank You
-Given: 11
-Receive: 0


« on: October 09, 2011, 03:25:56 03:25 »

Hi everyone, I'm sorry to post this question here, but I'm really stuck and I can not get any display to my LCD. I'm trying to read data from an Rfid module using Pic18F4550. Here is the code I'm using
Code:
Include "modedefs.bas"          ' Include serial modes
asm
    __CONFIG    _CONFIG1L, _PLLDIV_5_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    ;__CONFIG    _CONFIG1L, _PLLDIV_2_1L & _CPUDIV_OSC1_PLL2_1L & _USBDIV_2_1L
    __CONFIG    _CONFIG1H, _FOSC_XTPLL_XT_1H & _FCMEN_OFF_1H & _IESO_OFF_1H
                            ;                  ;               ; Oscillator Switchover mode disabled
                            ;                  ; Fail-Safe Clock Monitor disabled
                            ; XT oscillator, PLL enabled, XT used by USB
    __CONFIG    _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L  & _BORV_2_2L  & _VREGEN_ON_2L   
    __CONFIG    _CONFIG2H, _WDT_OFF_2H
    __CONFIG    _CONFIG3H, _MCLRE_ON_3H & _LPT1OSC_OFF_3H & _PBADEN_OFF_3H & _CCP2MX_ON_3H
    __CONFIG    _CONFIG4L, _STVREN_ON_4L & _LVP_OFF_4L & _ICPRT_OFF_4L  & _XINST_OFF_4L & _DEBUG_OFF_4L
    endasm
DEFINE OSC 48
DEFINE LCD_DREG PORTB
DEFINE LCD_DBIT 0
DEFINE LCD_EREG PORTB
DEFINE LCD_EBIT 5
DEFINE LCD_RSREG PORTB
DEFINE LCD_RSBIT 4
DEFINE LCD_BITS 4
DEFINE LCD_LINES 2
DEFINE LCD_COMMANDUS 2000
DEFINE LCD_DATAUS 50
PAUSE 100

TRISB.7=1
A0 var PORTB.7
DataRec Var byte

loop1:
     Serin A0,T9600,DataRec
     Lcdout $fe, 1        ' Clear screen
     Lcdout "V: ", DataRec
     pause 500   
     goto loop1
I hope you can help me.

thanks,
microbox
Logged
Wizpic
Global Moderator
Hero Member
*****
Offline Offline

Posts: 1197

Thank You
-Given: 541
-Receive: 408



« Reply #1 on: October 09, 2011, 08:31:27 08:31 »

I don't think think that PortB can be used for serial com
try this
TRISC.7=1
A0 var PORTC.7
I don't use PBP and there is just a slight defference between PDS and PBP
Logged

When you think, "I can't do anymore. I need a break," that is the time to challenge yourself to keep going another five minutes. Those who persevere for even an extra five minutes will win in life..
MicroBox
Junior Member
**
Offline Offline

Posts: 35

Thank You
-Given: 11
-Receive: 0


« Reply #2 on: October 10, 2011, 01:41:52 01:41 »

Hi, thanks for the tip, I got it working now. Smiley

regards,
microbox
Logged
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC