Thank You!!
Adding both
UCON var byte EXT
UCFG var byte EXT
to PIC18EXT.BAS
and adding
UCFG.3=1
UCON.3=0
to the code lets PortC.4 and PortC.5 on the 18F2455 operate as inputs.
Now i can sleep tonight!!!!!!!!!!!!!
RD
Thank You!!
Adding both
UCON var byte EXT
UCFG var byte EXT
to PIC18EXT.BAS
and adding
UCFG.3=1
UCON.3=0
to the code lets PortC.4 and PortC.5 on the 18F2455 operate as inputs.
Now i can sleep tonight!!!!!!!!!!!!!
RD
Actually UCON=0 at power up, so you shouldn't need that line... but who knows... it's never a bad idea to set all registers.
Good night![]()
Last edited by mister_e; - 7th April 2008 at 00:41.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Couldn't go to bed before i hooked up the pulse inputs.
When i hook up the pulse input to PortC.5 i get pulses on PortC.5 and not on PortC.4.
When i hook up the pulse input to PortC.4 i get counts on PortC.4 and PortC.5 as well.
The traces are paralell for awhile but if i was getting cross talk between traces i would think it would be in both directions. But its not. I can eliminate everything in the program that refers to PortC.4, put pulses into PortC.4 and still get pulses on PortC.5. There are no shorts between the traces or anything else on the board. It appears to be internal to the ports.
I did notice that these two ports do not have smitt triggers as most other inputs do. Can this have some thing to do with it.
Also there are internal pullups on these two inputs. I supposedly disabled them by setting UCFG.4 to 0 as well.
My pulse input is from a hall effect switch with a 1K pull up resistor.
Any thoughts????
RD
Weird... work perfectly here with 10K external pull-up (EasyPIC 4) but push-buttons... big deal... While i'm still awake, could you post your code so i can test it here?
Maybe not a bad idea to start a new thread as it's a out of topic from the original.
PS: for your tests.. did you left one or the other pin floating or you had a pull-up attach to?
Last edited by mister_e; - 7th April 2008 at 04:26.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
this is part of a pretty large program.
the code for the alias'
SCLK var PortC.0
ColPump var PortC.1
RadPump var PortC.2
RadFlowInput var PortC.4
ColFlowInput var PortC.5
SerRecieve var PortC.6
SerTransmit var PortC.7
this is the code to read pulse width:
gosub checksw
if colflocal > 0 then 'if have a calibration number, read the collector sensor
pulsin colflowinput,0,colflo
colfloacc = colfloacc + colflo
endif
gosub checksw
if radflocal > 0 then 'if have a calibration number, read the radiant heat sensor
pulsin radflowinput,0,radflo
radfloacc = radfloacc + radflo
endif
gosub checksw
i am averageing over 10 scans then writing the colflowacc and radfloacc to an lcd
don't stay up too late.
RD
in meantime try something,
1 reload the BootLoader firmware and disable the USB voltage generator config fuse,
2 load it in your PIC and dump your program in ...
3 see if it change anything...
Also try on another set of pin... i may think of few thing when using PULSIN on those specific pin....
Last edited by mister_e; - 7th April 2008 at 04:44.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
I'm unable to reproduce the issue here...
Seems to be a hardware problem... if you have any schematic and part#, that would be handy.Code:RadFlowInput var PortC.4 ColFlowInput var PortC.5 ColFlow var word RadFlow var word pause 500 hserout ["Testing...",13,10] start: pulsin colflowinput,0,colfloW pulsin radflowinput,0,radfloW hserout [" PORTC.4=",DEC rADFLOW,_ " PORTC.5=",DEC cOLFLOW,13,10] GOTO START
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks