The Godfather talking
You may crack software. How about me?
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
May 25, 2018, 11:02:53 23:02


Login with username, password and session length


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

Posts: 21

Thank You
-Given: 20
-Receive: 3


« on: February 01, 2008, 09:47:42 21: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 05, 2008, 07:50:52 19: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, 01:41:02 13: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: 119

Thank You
-Given: 54
-Receive: 42


« Reply #3 on: February 06, 2008, 06:42:51 18: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: 20
-Receive: 3


« Reply #4 on: March 10, 2008, 09:25:54 21: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 24, 2008, 05:18:43 17: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, 02:51:28 14: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: 4084

Thank You
-Given: 646
-Receive: 2332


There is no evidence that I muted SoNsIvRi


« Reply #7 on: April 25, 2008, 05:54:41 17: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: A forum without posters is not a forum.
Ahmad_k
SCG Moderator
Hero Member
*****
Offline Offline

Posts: 637

Thank You
-Given: 128
-Receive: 1118



« Reply #8 on: April 26, 2008, 04:33:23 16: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