|
|
View previous topic :: View next topic |
Author |
Message |
lmercor Guest
|
18f4550 and em4095 problem. |
Posted: Mon May 21, 2007 12:35 am |
|
|
hello, I'm doing a RFID reader with a 18f4550 and an EM4095 IC's.
I have done the reader with the pic16f877a an it works perfect, I add an LCD to see the tg number and it works. but the problem is that now I want to use the PIC18F4550 but it doesn't work and I dont know why, at first I thought that the problem were the fuses so I jus made a program to test the LCD but works fine, and then I put my program into the PIC4550 and I can't make it work, I dont know why, but I can'a saw anything in the lcd.
I really don't know what my problem is, as I said before, I thought it were the fuses but with a test program i realize it weren't. byt the way rigth now I'm not using the USB I tried with a 4MHz and 20Mhz cristal and I get the same response... nothing.
please a little help with this.
Thanks |
|
|
lmercor Guest
|
this is part of my code. |
Posted: Mon May 21, 2007 3:40 pm |
|
|
#include <18F4550.h>
#fuses HS, NOWDT, PUT, BROWNOUT, NOLVP
#use delay(clock=20000000)
#define use_portd_lcd TRUE
#define LCD_DATA_PORT portd
#define LCD_TYPE 2
#define LCD_TRIS_LOCATION trisd
#include <lcd.c>
#include <em4095.c>
#include <em4102.c>
void main(void) {
int8 code[5];
int32 tagNum;
int8 customerCode;
int8 i, j;
int8 dato_org;
rf_init();
rf_powerUp();
lcd_init();
while(TRUE) {
if(read_4102(code)) //read the code
{
for (i=0; i<5; i++) {
dato_org = code[i];
code[i] = 0;
for (j=0; j<8>>(j)) & 0x01);
if(j<=6) {
code[i] <<= 1;
}
}
}
tagNum = make32(code[1],code[2],code[3],code[4]);
customerCode = code[0];
printf(lcd_putc,"\fNo: %x%lx", customerCode, tagNum);
}
}
}
I think the problem could be with the interrups. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon May 21, 2007 3:45 pm |
|
|
Quote: | for (j=0; j<8>>(j)) & 0x01); |
This is not readable code.
When you post code, please disable HTML. There's a tickbox to do this
below the posting window.
Also, please register and login (set it for "auto" login). Then you can
edit your posts when a problem like this occurs. You can also set
your user profile to always disable HTML. |
|
|
Guest
|
Re: 18f4550 and em4095 problem. |
Posted: Sun Oct 04, 2009 3:53 am |
|
|
lmercor wrote: | hello, I'm doing a RFID reader with a 18f4550 and an EM4095 IC's.
I have done the reader with the pic16f877a an it works perfect, I add an LCD to see the tg number and it works. but the problem is that now I want to use the PIC18F4550 but it doesn't work and I dont know why, at first I thought that the problem were the fuses so I jus made a program to test the LCD but works fine, and then I put my program into the PIC4550 and I can't make it work, I dont know why, but I can'a saw anything in the lcd.
I really don't know what my problem is, as I said before, I thought it were the fuses but with a test program i realize it weren't. byt the way rigth now I'm not using the USB I tried with a 4MHz and 20Mhz cristal and I get the same response... nothing.
please a little help with this.
Thanks |
I'm very happy when i 'm readed these statement. I'm searching the rfid use 16f877a. Can you give me the principle (of the rfid reader kit) that you did? Thank a lot before. My address : ltson05bkdn@gmail.com .
We can talk together about the microcontroller . I hope I can learn more and help you as I can. |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|