Jump to content

dvaccaro

EstablishedMember
  • Content Count

    28
  • Joined

  • Last visited

Community Reputation

0 Neutral

About dvaccaro

  • Rank
    Regular

Profile Information

  • Location
    Argentina - Neuquen - Piedra del Aguila
  • Interests
    Learn about PICs
  1. I forget it I have some example, I find it and send. But I remember my head hurst when was working with, finally works fine. Bye Daniel
  2. Joseph If we talk about this: // Ports naming #define LCD porta #define CONTROL portb // PINs naming #define LCD_E 1 #define LCD_RS 0 // Some usefull macroses #define LCD_E_U set_bit(CONTROL,LCD_E) #define LCD_E_D clear_bit(CONTROL,LCD_E) #define LCD_RS_U set_bit(CONTROL,LCD_RS) #define LCD_RS_D clear_bit(CONTROL,LCD_RS) #define SetPos(line,pos) LCD_cmd(0x80 + line*0x40 + pos) #define byte unsigned char // Use nested macroses #define write_data LCD_RS_U; LCD_E_U; LCD_E_D; #define write_cmd LCD_RS_D; LCD_E_U; LCD_E_D; when you will call i.e. /********************************************* * LCD_cmd - Write ASCII character to LCD peripheral * * configured as a 4 bit interface * *********************************************/ void LCD_char(byte data) { LCD = (data & 0xF0) | (LCD & 0x0F); /* Write HI nibble word to LCD */ write_data; LCD = ((data << 4) & 0xF0) | (LCD & 0x0F); /* Write LO nibble word to LCD */ write_data; delay_us(160); } if fact LCD = PORTA ( dataport ) then (LCD & 0x0F) mask 4 high bit of PORTA then use PORTA.0, PORTA.1, PORTA.2 and PORTA.3 for data lines when use write_data; call LCD_RS_U set_bit(CONTROL,LCD_RS) set_bit(PORTB, 0) use PORTB.0 as RS LCD_E_U set_bit(CONTROL,LCD_E) set_bit(PORTB,1) use PORTB.1 as E LCD_E_D clear_bit(CONTROL,LCD_E) clear_bit(PORTB,1) use PORTB.1 as E I haven´t used this code, and thiese lines aren´t easy for my LCD = (data & 0xF0) | (LCD & 0x0F); /* Write HI LCD = ((data << 4) & 0xF0) | (LCD & 0x0F); /* Write LO Would you try with LCD = ((data >> 4) | (LCD & 0xF0); /* Write HI LCD = (data & 0x0F) | (LCD & 0xF0); /* Write LO or more easy use #define LCD portb and use PORTB.4, PORTB.5, PORTB.6 and PORTB.7 for data lines Finally I supose that the best solutios is the last maybe is a mistake in source code. I Hope help Daniel
  3. Pavel Maybe I don´t know how works RESERVE_ADDRESS, I believe that i.e. #pragma RESERVE_ADDRESS 0x0 deny to use address 0x0, this is useful to reserve some address In fact my problems is that need write from C2C: 0000 bsf PCLATH, 3 0001 bsf PCLATH, 4 0002 call BootLoader; at 0x1800 ..... ( here is #pragma BOOTLOADER 0x1800 ) 1800 BootLoader ..... Excuse my English !! Regards Daniel
  4. Hi !! First, I suggest look in: http://home.iae.nl/users/pouweha/lcd/lcd.shtml is a good site with a PIC example. Then for 4 bit data interfase you need wiring PIC16F84 HD44780 PORTB.0 RS - Pin 4 PORTB.1 E - Pin 6 PORTA.0 D0 - Pin 7 PORTA.1 D1 - Pin 8 PORTA.2 D3 - Pin 9 PORTA.3 D4 - Pin 10 Look in http://home.iae.nl/users/pouweha/lcd/lcd.shtml how connect control resistor contraste And then be patient, because these codes need some tunning. I hope that help Bye Daniel
  5. Thank you, Pavel !!! But don´t understand the fisrt part, because a need "put" code at address 0000, 0001, and 0002, I use #pragma RESERVE_ADDRESS in "user code" no in "bootloader code", bootloader use these address for absolute jump to bootloader code body. Regars Daniel
  6. Hi Normaly you can set_bit( porta, 0 ) to hight ( pin 0 PORTA ) clear_bit( portc, 5 ) to low ( pin 5 PORTC ) Bye Daniel
  7. Hi I am working with migration bootloader form CC5X to C2C. I use de #PRAGMA BOOTLOADER xxxx, this pragma shift all code in xxxx offset. I look two problems: 1 - I can´t put any code at address 0000,0001 and 0002 but I need this. 2 - I supose that page change doesn´t work propertly because all code is in page 4 and I look functions call with: bcf PCLATH, 3 bcf PCLATH, 4 This supose page #0 but it isn´t in fact. Can anybody help me ? Regars Daniel
  8. I hope too, a update version of C2C compiler help, because these document show compiler version 4.0x ( no changes ? to 5.04 ) Regards Daniel
  9. Hi, in my first reply loss something #define PIC16F84 #include "system.h" in fact #include "system.h" You can browse it, at /PicantIDE/include Bye Daniel
  10. Hi system.h is an include file that redirec the proper include hardware definition file i.e #define PIC16F84 #include in fact #include You can browse it, at /PicantIDE/include Bye Daniel
  11. Excuse me !!! Is my mistake, my code won´t fit into memory !!! Regars Daniel
  12. I forget... The last example don´t respect RS232 standart because for this, is necessary use some circuit to adapt level voltages. Bye Daniel
  13. Hi I don't know, what you want, but is posibily serial comunication using hardware or software implementation PIC to PIC, I was working with a PIC16F877 link a PIC16F84 directly without any external hardware components. Bye Daniel
  14. I am working in migration bootloader from CC5X to C2C and I need use: #pragma BOOTLOADER 7167 ( in PIC 16F877 ) but the compiler say next error message: "asm error: wrong code page" why ? Regards Daniel
×
×
  • Create New...