View Single Post
  #1   Spotlight this post!  
Unread 06-10-2007, 22:06
sciguy125 sciguy125 is offline
Electrical Engineer
AKA: Phil Baltar
FRC #1351
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Sunnyvale, CA
Posts: 519
sciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond reputesciguy125 has a reputation beyond repute
Send a message via AIM to sciguy125 Send a message via MSN to sciguy125 Send a message via Yahoo to sciguy125
PIC bsf instruction

After spending the last 3 hours trying to figure out what's going on, I think I need to verify my conclusion because it seems strange to me.

If I set the output of more than one pin, they like to turn on and off. I've narrowed down the problem to the way I'm setting my outputs. I'm using a single port and setting individual pins using bsf and bcf. However, it seems that bsf will set ONLY that one bit; all others will be cleared. This doesn't sound right to me.

I scoped the outputs and it seems like that is exactly what it's doing. The first pin I set only stays high for one instruction cycle. When the next pin turn on, the first one turns off. Then, they swap when the first pin gets set high again.

I've attached my code and the scope capture. Ch1 is pin C0 and Ch2 is pin C2.
Attached Thumbnails
Click image for larger version

Name:	tek0001.jpg
Views:	85
Size:	85.6 KB
ID:	5738  
Attached Files
File Type: txt range.asm.txt (1.2 KB, 83 views)
__________________

-----BEGIN GEEK CODE BLOCK-----
Version: 3.12
GE/S/P a-- e y-- r-- s:++ d+ h! X+++
t++ C+ P+ L++ E W++ w M-- V? PS+ PE+
5- R-- tv+ b+ DI+++ D- G
------END GEEK CODE BLOCK------