Welcome, Guest
Username: Password: Secret Key Remember me

TOPIC: How to specify specific pin(s) for analog and digital, mixed

Re: How to specify specific pin(s) for analog and digital, m 8 years 2 months ago #8726

  • RogerTango
  • RogerTango's Avatar
  • Offline
  • Fresh Boarder
  • Thanks received: 2
Follow up: Many thanks to jmessina for hinting me in the right direction on the registers. A greater understanding has been reached with that post and the datasheet makes a LOT more sense to me in that aspect.

Upon removing all_digital = true and setting specific ports & pins (actually all pins) for port B and C, the program executes on the PIC without fail or reboot at this time. Further testing is needed to insure this to be fact but the previous problems with self rebooting appears to be solved.

How true it is that one document about PICs in general does NOT cover all chips,the idea of approaching each chip as different is worthwhile.

In the beginning the datasheeets were very cryptic to me, with more experience and help from the members here they are making more and more sense.

The Picaxe chips have been a great help, and hinder at the same time. Having some experience with ICSP was good, how to wire up a few simple projects, etc.. however because the Picaxe is "dummy proof" the user is isolated from many critical aspects of the actual PIC chip, which is the direction I was coming from in the beginning.

Kind regards,
Andrew

Re: How to specify specific pin(s) for analog and digital, m 8 years 1 month ago #8731

Hi Andrew, I’m a bit late to the conversation and just wanted to add something.

Chances are as you get more familiar with the PIC microcontroller and high level programming, it will become apparent that using high level functions such as “All_Digital=True” may behave unexpectedly.

I often find it's best to play the safety and control onboard peripherals from a lower level.. Or at least understand how they work before fully relying on a prewritten/system functions (also helps with debugging!).

A port is just like any other onboard peripheral.. There will be a nice write-up somewhere in the device datasheet that explains in detail the registers/method of use. Sometimes the read can be quite cryptic and may take several passes to grasp.

Another not-so-hard predicament to land in; some timer peripherals are used by other peripherals. Quite easy to overlook if working in the high level realms of Proton/SF. I never fully rely on the HLL help file; I tend to find myself reading through the datasheet far more often these days!
The following user(s) said Thank You: RogerTango
Time to create page: 0.213 seconds