Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
March 29, 2024, 06:06:16 06:06


Login with username, password and session length


Pages: [1]
Print
Author Topic: 16f628A Simulation Problem  (Read 5076 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, 03:47:42 03: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, 01:50:52 01: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, 07:41:02 19: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: 55
-Receive: 42


« Reply #3 on: February 07, 2008, 12:42:51 00: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 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 24, 2008, 11:18:43 23: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, 08:51:28 20: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: 4639

Thank You
-Given: 823
-Receive: 4194


There is no evidence that I muted SoNsIvRi


« Reply #7 on: April 25, 2008, 11:54:41 23: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: I stoped Muteing bad members OK I now put thier account in sleep mode
Ahmad_k
SCG Moderator
Hero Member
*****
Offline Offline

Posts: 747

Thank You
-Given: 169
-Receive: 1288



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