project_23

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

project_23

Postby hokelvin66 » Fri Jul 05, 2013 12:14 am

i had purchase the RR23_B recently: http://www.cytron.com.my/viewProduct.php?pcode=PR23-B&name=Multifunction%20Mobile%20Robot%20Rev2
the project work find with provided the PIC16F887A
however when i switch the PIC16F887A to PIC18F4550,the SW1(RE0) does not work even-though i try the simple LED blinking with
RE0 as input and RE2 as output(LED and buzzer) :?:
i had made an assumption that the SW1 for PIC18F4550 is not RE0 :(
pls help me take a look for my source code,is there something wrong since the i can build the code successfully :D

compiler:XC8
IDE:MPLAB X
hokelvin66
Novice
 
Posts: 22
Joined: Mon Jan 14, 2013 7:49 pm

Re: project_23

Postby hokelvin66 » Fri Jul 05, 2013 12:17 am

tis is the code :mrgreen:
Attachments
Pr_23_alter_version.rar
(11.14 KiB) Downloaded 264 times
hokelvin66
Novice
 
Posts: 22
Joined: Mon Jan 14, 2013 7:49 pm

Re: project_23

Postby yonghui » Fri Jul 05, 2013 9:33 am

portE on PIC18F4550 has analog channel attached to it, have u configure the ADCON1 properly? the analog register on PIC16F877A is diffrerent from PIC18F4550.


for all digital on PIC18F4550 : least significant 4 bits of ADCON1 need to be all 1s. ADCON1=0b00001111;
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: project_23

Postby hokelvin66 » Fri Jul 05, 2013 1:03 pm

thx,u had solve my problem. :) however,how do i make the port E as digital only and others are analog??
hokelvin66
Novice
 
Posts: 22
Joined: Mon Jan 14, 2013 7:49 pm

Re: project_23

Postby hokelvin66 » Fri Jul 05, 2013 2:05 pm

is RC3 available on P18F4550 since VUSB had substitute it slot?
hokelvin66
Novice
 
Posts: 22
Joined: Mon Jan 14, 2013 7:49 pm

Re: project_23

Postby robosang » Fri Jul 05, 2013 2:33 pm

Refer datasheet mah...
robosang
Expert
 
Posts: 1239
Joined: Wed Jun 10, 2009 5:37 pm

Re: project_23

Postby hokelvin66 » Fri Jul 05, 2013 3:15 pm

i change the PIC18F4550 to PIC18F4520(not much different) and the project work....i think the pr_23 is not compatible with P18F4550 since the RC3(attach to motor) is not available in this PIC...........thx for those reply :D
hokelvin66
Novice
 
Posts: 22
Joined: Mon Jan 14, 2013 7:49 pm


Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 29 guests