Jump to content

Smache

EstablishedMember
  • Content Count

    25
  • Joined

  • Last visited

Community Reputation

0 Neutral

About Smache

  • Rank
    Regular
  1. From your code I see that you choosed low nibble 4 bit interface: #define LCD_ARGS 1, /* Interface type: mode 0 = 8bit, 1 = 4bit(low nibble), 2 = 4bit(upper nibble) */ \ 1, /* Use busy signal: 1 = use busy, 0 = use time delays */\ PORTC, TRISC, /* Data port and data port tris register */ \ PORTA, TRISA, /* Control port and control port tris register */ \ 3, /* Bit number of control port is connected to RS */ \ 2, /* Bit number of control port is connected to RW */ \ 1 /* Bi
  2. You haven't rebuilt the project or haven't reloaded the new .hex file into your programming software I would guess, so you are programming with the old code. Regards Dave <{POST_SNAPBACK}> If you use the h/w UART you have to change parameters in uart_init function, the bit_time is irrelevant in this case.
  3. I don't know about MSVC but Keil gives the result I expected, that is 0xF0=(~0x0F). In my example var3=0xAA;
  4. Bug description: Wrong result whith ~ operator when included in a logical expression. Steps to reproduce: #include <system.h> void main(void) { unsigned char val1,val2,val3; val1=0xF0; val2=0x0F; if(val1==(~val2)) val3=0xAA; else val3=0xBB; } Asm output: 0003 main 0003 ; { main; function begin 0003 30F0 MOVLW 0xF0 0004 1283 BCF STATUS, RP0 0005 1303 BCF STATUS, RP1 0006 00A1 MOVWF main_1_val1 0007 300F MOVLW 0x0F 0008 00A2 MOVWF main_1_val2 0009 01A5 CLRF CompTempVar303 000A 0922 COMF main_1_val2, W 000B 00A4
  5. rfhaley, I think your function CheckBright() is not correct: void CheckBright(void) { // if (maxht > 150) clk = clk - 40; // WAAY Too Bright if (maxht > 60) clk = clk - 20; // Far Too Bright if (maxht > 45) clk = clk - 10; // Too Bright if (maxht > 30) clk = clk - 4; // a bit Too Bright if (maxht < 24) clk = clk + 4; // a bit Too Dim if (maxht < 15) clk = clk + 7; // Too Dim if (maxht < 10) clk = clk + 10; // Much Too Dim if (clk < 5) { ouch = true; }
  6. If you are using pic16f688 you have to put in HWInit() cmcon0 = 0x07 and ansel = 0 to configure PORTC pins as digital I/O.
  7. You have to add libc.pic16.lib from the Lib folder of SourceBoost directory in Library Files of Mplab project.
  8. You don't say what microcontroller is used but if RA4 is an open-drain output you have to put a pull-up resistor to pin RA4 in order to get the push button working.
  9. SourceBoost 6.31, BoostC, Windows XP #include <system.h> void main(void) { char* string; string="0123456789"; string="abcdefghij"; string="klmnopqrst"; while(1); } Asm output: Why different temporary strings (CompTempVar52, CompTempVar53, CompTempVar54) for the same string variable?
  10. Instead of adcon0=0 put adcon1=6 (make all five analog imputs of PORT A digital I/O);
  11. It's a simulator bug or something? <{POST_SNAPBACK}> In eeprom_read function use eedata instead EEDATA.
×
×
  • Create New...