Jump to content


  • Content Count

  • Joined

  • Last visited

Community Reputation

0 Neutral

About Fejimush

  • Rank

Contact Methods

  • Website URL
  • ICQ

Profile Information

  • Gender
  1. Here is the assembly with my comments after: 21: set_bit(portc, 0); 008 1283 BCF 0x3, 0x5 // Clear bit 5 on 0x3 (STATUS?) 009 1407 BSF 0x7, 0 // Set bit 0 0x7 (portc) 22: set_bit(portc, 1); 00A 1487 BSF 0x7, 0x1 // Set bit 1 0x7 (portc) 23: set_bit(portc, 2); 00B 1507 BSF 0x7, 0x2 // Set bit 2 0x7 (portc) 24: set_bit(portc, 3); 00C 1587 BSF 0x7, 0x3 // Set bit 3 0x7 (portc) The BCF and BSF are all one instruction operands. Is this really the read-modify-write problem? Or something else that I don't understand yet? Kindly, graham
  2. Thanks for the responses. I am still on the steep slope of the learning curve for these devices. I appreciate the help. My background is C/C++ with embedded CPUs with an OS like VxWorks or Linux versus MCUs and no OS. The C++ compiler is what attracted me back to PICs. I have limited EE experience. I tried up to 50 nop()'s inbetween the set_bit() calls and I could see the first three flash quickly. The end result was still the same. Only the last LED on bit 3 of portc remains lit. I will use a shadow register and then lug the changes over at once, which appears to be corr
  3. Hello, I am using the PIC 16F690 with the Low Pin Count Demo Board from Micro. In an attempt to get the 4 LEDs located on PORTC's bits 0 through 3 to activate I did the following: set_bit(portc, 0); set_bit(portc, 1); set_bit(portc, 2); set_bit(portc, 3); This results in only the LED on bit 3 of PORTC illuminating. With a 'small' delay they all light up. set_bit(portc, 0); delay_ms(250); set_bit(portc, 1); delay_ms(250); set_bit(portc, 2); delay_ms(250); set_bit(portc, 3); Is this related to the read-modify-write problem? Although, it's not clear what's getting read in
  4. How do you turn on more than one output per port? For example: #include "system.h" #pragma CLOCK_FREQ 4000000 #pragma DATA 0x2007, _HS_OSC & _WDT_OFF void main() { trisc = 0; portc = 0; set_bit(portc,0); set_bit(portc,1); return; } This code only turns on RC1 (on the PIC16F690) but not RC0. I am probably missing something really simple. Thanks, Fej
  • Create New...