Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 03, 2016, 02:35:40 14:35


Login with username, password and session length


Pages: [1]
Print
Author Topic: 16f628A Simulation Problem  (Read 2409 times)
0 Members and 1 Guest are viewing this topic.
Shinta
Newbie
*
Offline Offline

Posts: 21

Thank You
-Given: 20
-Receive: 3


« on: February 02, 2008, 04:47:42 04:47 »

Hi, I design a little MikroBasic program for Pic 16F628A but in Isis Simulation PORTB.4 Doesn't work in output mode. The proteus Version is 7.1 SP2.

Is there a problem with Isis simulation software or what?
Logged
caveman508
Junior Member
**
Offline Offline

Posts: 41

Thank You
-Given: 12
-Receive: 6

READ, REAd, REad, Read


« Reply #1 on: February 06, 2008, 02:50:52 02:50 »

Shinta

Make sure that you have set the direction control register (TRISB) to be a 0 (zero) for bit 4.  A 1 makes it an Input, a 0 makes it an Output.  There is a TRISx register for each port on the PIC, and is a bit-by-bit control.  I am not a MikroBasic user, but I do know about PICs

Hope this helps
Logged
Shinta
Newbie
*
Offline Offline

Posts: 21

Thank You
-Given: 20
-Receive: 3


« Reply #2 on: February 06, 2008, 08:41:02 20:41 »

The TRISB value is 0 (all portb in output).

Maybe this pin is associated with some peripheric?
Logged
twonuts
Active Member
***
Offline Offline

Posts: 118

Thank You
-Given: 53
-Receive: 42


« Reply #3 on: February 07, 2008, 01:42:51 01:42 »

PortB.4 is also low voltage programming pin. Make sure you have disabled this function. See page 92 of datasheet.
Logged
gedonet
Newbie
*
Offline Offline

Posts: 7

Thank You
-Given: 19
-Receive: 3


« Reply #4 on: March 11, 2008, 03:25:54 03:25 »

Hi
For using RB4 like other I/O, erase the bit 7 (LVP) of the config register at 0x2007 whith your programmer.
Gilles
Logged
trace
Newbie
*
Offline Offline

Posts: 8

Thank You
-Given: 4
-Receive: 0


« Reply #5 on: April 25, 2008, 12:18:43 00:18 »

You can also add this asm line to your code:

Code:
__CONFIG _LVP_OFF
Logged
eleckits
Junior Member
**
Offline Offline

Posts: 54

Thank You
-Given: 36
-Receive: 18


« Reply #6 on: April 25, 2008, 09:51:28 21:51 »

RB4 is an open collector pin if you want to use it as output you have to pullup it by using resistor 10K to +5V

Hope this help
Logged
pickit2
Moderator
Hero Member
*****
Offline Offline

Posts: 3816

Thank You
-Given: 567
-Receive: 2049


There is no evidence that I muted SoNsIvRi


« Reply #7 on: April 26, 2008, 12:54:41 00:54 »

RB4 is an open collector pin if you want to use it as output you have to pullup it by using resistor 10K to +5V

Hope this help
RB4 Bidirectional I/O port. It has a schmitt trigger input, as well as being the low voltage programming input pin.  not open collector output.
If in low voltage programming mode then it a input.
Logged

Note: If you have no posts other than, I want or reporting a dead link Then you can't complain If I remove your post So Stop Leeching
Ahmad_k
SCG Moderator
Hero Member
*****
Offline Offline

Posts: 604

Thank You
-Given: 111
-Receive: 1059



« Reply #8 on: April 26, 2008, 11:33:23 23:33 »

RB4 is an open collector pin if you want to use it as output you have to pullup it by using resistor 10K to +5V

Hope this help
pickit2 is right, the only pin that is open collector is RA4 and only on some device like the 16F84A.
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