Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
RA4 and Analog IN
21-07-2011, 03:55 AM,
#1
RA4 and Analog IN
Hello guy, nice to meet you all. I am new to Pinguino and recently i made myself one board based on Vasi's FreeJALduino MEGA version(https://sites.google.com/site/funlw65/el...duino-mega). I found out that I cant use the analog IN (keep read 1023) if i give pulse at RA4. I not sure what is the problem. I know the original Pinguino PIC18F4550 doesn't use RA4 as pin but is it possible to make it as Pin without affect the analog IN? The attachment is the lcd code i take from the Pinguino IDE example and the LCD shield schematic that i used.

Best regards,
TWK


Attached Files
.pdf   LCDKeypad Shield SCH.pdf (Size: 46.46 KB / Downloads: 4)
.txt   lcd.txt (Size: 1.92 KB / Downloads: 4)
Reply
26-07-2011, 04:59 AM,
#2
RE: RA4 and Analog IN
Hi TWK,

First of all, that board needs a special version of digitalw.c file (I did one only for FreeJALduino 18f2550 variant). The original digitalw.c file works only with Pinguino.

Unfortunately, I didn't built yet that board so I am unable to help you. Anyway, I think is a software problem...

Vasi
Reply
01-08-2011, 07:08 AM,
#3
RE: RA4 and Analog IN
Greeting all,

Thanks Vasi, I found out that the problem came from analogRead(0). It should be analogRead(14) for your board or analogRead(13) for original pinguino PIC18F4550 tiny board. There is another way if you want to use analogRead(0). How? Just simply go to C:\pinguino_beta9-05_windows\tools\include\pic16, open the <analog.c> and change the ADCON0=(channel-13)*4; to ADCON0=(channel)*4. Hope I am not wrong Big Grin

Best regards,
TWK
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)