From: "Byron A Jeff" Sent: Wednesday, August 04, 2004 12:31 AM > A lot of people don't. We've gone round and round on this issue on the list > over the years. Here's my case: Well then let's not re-open the debate, but I do have a couple of comments/question as someone making the transition from doing everything in software to using the peripheral hardware. > Now all of the onboard periperals take a bit of coding to get going. But > I tell you as you move from novice to late beginner/intermediate developer, > the ability to set and forget becomes invaluable. Need PWM at a certain > voltage? Set and forget. Need to capture a ADC voltage? Again set and forget. > Sending serial? I think you get the idea. How do you learn to use all these things? There are a lot of great books and tutorials on the F84, there is relatively very little on the newer chips. A few months ago I used the ADC for the first time, I followed through the app notes on the Microchip website while going over the datasheet at the same time to see what I was setting (the app notes are quite bad at telling you what bits you're setting and why, but the datasheets simply list all the bits with descriptions and don't have a comprehensive "to do that you set these bits like this"). After writing my code, it wouldn't work. After hours of frustration, I found out (from the datasheet) that there's a bit I have to set to turn on the ADC. Sure, it's my fault for missing it the first 20 times I read that section of the datasheet, but there doesn't seem to be any available material to teach you how to do something. A cleanly written, well documented source code listing would have helped a lot. > So you need a breakpoint very early on. Reason is that if you take the tutorial > path on the 16F84 road, you'll be led down all types of avenues that are not > really relavent to modern PIC development. Show me the tutorial road using the hardware peripherals then. I'd be quite happy to take it. > Yes there is. It adds a much higher level of complexity to the process of > coding once you get beyond the exemplars of the tutorial. While bitbanging > works in isolation, once you start combining it to multiple tasks it very > quickly gets very difficult to manage. As a beginner, you're not going to be combining it to multiple tasks. It's important to understand what the peripherals do to use them properly. > There's a vast difference between code > simulating hardware and code that manages it. Even managing a simple set of > tasks such as doing serial while doing PWM while reading from the ADC can get > real tough if you have to bitbang each. If you've been reading my other thread about the LED stroboscope, that's pretty much what I'm trying to do. I will be using the hardware peripherals as much as possible. I don't think it's possible to get the PWM to do what I want, so I will probably end up bit-baning the output (though I've seen a few innovative suggestions that involve generating the pulses in an analog circuit and using the pic as a frequency counter). Knowing how to do the PWM in software is good here. I've recently started playing with the 18F252, and I can not get the new memory paging system to work. I've read the data sheet and microchip's migration document, and I've tried the assembly code from there and it doesn't work. If I write the code using the access bank, it works perfectly, but I only have access to 128 file registers. If I make a tiny change to the code to put my data in bank 1, the chip just sits there and does nothing when powered. Obviously I'm doing something wrong, but I have no idea what, and since it's not a 16F84, I can't find any documentation to help. My solution has been to to just use JAL with the 18F252 (thank you, Wouter) Sorry if this is a bit rambling, but it's getting pretty late. Jason. -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads