Saw this one earlier today
http://www.picbasic.co.uk/forum/showthread.php?t=10214
Saw this one earlier today
http://www.picbasic.co.uk/forum/showthread.php?t=10214
Welcome to the forum.
Here is how it works with people trying to sell books and simulators.
I made an LED blink on a 16F84...Now I am expert with MiroChips!
I will write a book.
I downloaded a compiler to use... made LED blink..Expert again!
I will make a Simulator.
It is obvious the person that made the simulator does not know PIC chips or they would have had an error show when you are trying to use an ADC pin as an output before it has been set up for that function.
Stop wasting your time with that crap and spend the same time reading the data sheet and the manual of the parts/ compiler you are using.
This thread should get you going.
http://www.picbasic.co.uk/forum/showthread.php?t=561
It talks about setting the ADC to digital.
Dave
Always wear safety glasses while programming.
Thank you for the links, but they do not help me. Maybe I didn't explain myself clearly. I only use the simulator to write the code which I burn into the chip which works 100% in my real life circuit. I use the melabs U2 programmer. Regarding reading the datasheet, I have it and I always refer to it when working on my chip.
I am trying to NOT use the simulator program anymore so I can only use PBP. But it is not working.
Javier.
There's no maybe about it.
And if you actually did have and/or use the datasheet, you would know that PortA.0 (and many other pin) function as analog inputs upon reset and will not function as digital outputs without further configuration.Regarding reading the datasheet, I have it and I always refer to it when working on my chip.
Huh?I am trying to NOT use the simulator program anymore so I can only use PBP. But it is not working.
I really appreciate you guys trying to help. The code that you see on my previous post makes the leds blinks, both porta.0 and portd.0. I do not know about other pics, but on the 18F4620 the port is digital as per the datasheet. If you want to use for ADC, then you must specify it on code. It is on chapter 19 of the datasheet. Again, the code works 100% when I use the Basic editor on the simulator or if I use assembler. I only use the basic editor of the simulator to write the code and create the hex file to then burn it on the chip.
My point is, when I use MicroCode Studio to write code and I want to pass it to my chip, the code does not work. In other words, the leds do not blink. I think there might be something wrong or I am doing something wrong on my code.
That is the part you have backwards. You have to make the pins digital.but on the 18F4620 the port is digital as per the datasheet. If you want to use for ADC, then you must specify it on code.
So... refer to the link I gave you and try
Keep reading chapter 19 and look atCode:ADCON1=15
REGISTER 19-2: ADCON1: A/D CONTROL REGISTER 1
Dave
Always wear safety glasses while programming.
I could think that it is why led on port a is not turning on, but what about led on port d.
I have to leave to work now but I will defenetaly try your suggestion when I get back tonight.
Bookmarks