For sale.Cold fusion reactor.Home made.Not working.$2000 ONO

John West

Senior Member
I tend to get in over my head around here while trying to help other posters, as I'm certainly not one of the forum gurus. That being said, I'll take a shot at answering your question.

As all digital devices control input/output lines in powers of 2, (i.e. 2,4,8,16) based on the number of control lines available, input/output control comes in "groups" of such sizes. This allows chip designers to quickly and easily control I/O in the form of 2 lines, or 4 lines or 8 or 16 lines at a time. These groupings of commonly controlled lines are called "ports." So it will be quicker and easier internally on the chip die (and in code) to (for example) turn on or off all pins of a given port, rather than some from one port and some from another port.

Thus you will find pins labeled C1, C2, and B1, B2, etc, that are each part of their respective port, the B or C port, and pins of a given port can be easily made to work in unison. While Rev. Ed. attempts to minimize the necessity of understanding chip architecture, still, there will be situations where it will make the code faster and easier to work with all of a given port's lines simultaneously. Thus the reason for designating the pins in their "port" format.

A high level programming language like BASIC can make knowledge of specific chip architecture (like ports) relatively transparent to the user, but it can't change that architecture and cause multiple pins of two different ports to be commanded simultaneously. Such control requires a sequence of commands that takes additional time.

Rev. Ed. has chosen to make the port nature of these pic chip's I/O lines apparent in the code in order to help knowledgeable programmers group common functions on common ports in order to simplify their code and speed up program execution if that is a requirement of their project.

I hope this long-winded response helps explain what those letter designators actually mean, and why they're available and how to use them, even if they aren't always fully explained in every section of the manuals or every sample of code. The knowledge is important to those who are trying to get the most from their code and chips, but is perhaps "too much information" for novice users.
 
Last edited:

erco

Senior Member
From manual 2, under "Input / Output Pin Naming Conventions":

... on later M2 and X2 PICAXE parts more flexibility was added by
allowing almost all of the pins to be configured as inputs or outputs as desired.
This creates more than 8 inputs or outputs and an amended naming scheme is
therefore required. Therefore the pins on these parts are referred to by the new
PORT.PIN notation. Up to 4 ports (A, B, C, D) are available, depending on chip
pin count.
e.g. Output commands Input Commands
high B.1 count A.2, 100, w1
sound C.2, (50,50) pulsin B.1, 1, w1
serout A.3, N2400, (b1) serin C.0, N2400, b3
 

120ThingsIn20Years

Senior Member
From manual 2, under "Input / Output Pin Naming Conventions":

... on later M2 and X2 PICAXE parts more flexibility was added by
allowing almost all of the pins to be configured as inputs or outputs as desired.
This creates more than 8 inputs or outputs and an amended naming scheme is
therefore required. Therefore the pins on these parts are referred to by the new
PORT.PIN notation. Up to 4 ports (A, B, C, D) are available, depending on chip
pin count.
e.g. Output commands Input Commands
high B.1 count A.2, 100, w1
sound C.2, (50,50) pulsin B.1, 1, w1
serout A.3, N2400, (b1) serin C.0, N2400, b3
Thanks erco, that's the stuff I was looking at, but I still cant get my head around why I can use c.1 and b.1 interchangeably. If "c.1" is a port.pin designation, why does "b.1" point to the same pin? (PICAXE-08M)

Code:
Main:
     high c.1
     pause 1000
     low b.1
     pause 1000
     goto main
end
 

120ThingsIn20Years

Senior Member
John,

At this stage i think the largest cap he has handy would be 10uF that i gave him a few of, and not much in the way of a resistor selection with 10K or 22K being the highest.

When dollars permit he will add to his component stock.
Just to give an idea of what he has to work with.

Pete.
The small blue capacitors you gave me don't have the normal XXX uF markings on them. Can you tell me what they are?
They have this info instead.

134 01
H5 (M)

35 volts

10 10
 

120ThingsIn20Years

Senior Member
SAborn,

When you were showing me the use of the thermistor, we saw some feedback from our chip in the programming editor. Was that via the serout command or did you just save the value to a variable?

I'm playing with the thermistor I bought on the day and it doesn't behave like the one you gave me on the little board with the header pins.
 

Dippy

Moderator
Post 205.
He was giving you a snippet from the Manual.
You don't have c.1 and b.1 on an 08M.
On an 08M2 you have c.1
Look in Manual 1 Pinout and Circuit.
Maybe the example code has a typo?

Post 206.
I can't help directly but would strongly suggest that you get a decent DMM which has capacitance measurement capability via the test leads.
For the future this will prove invaluable when you drop your box of unmarked surface-mount ceramics :)

Post 207.
Thermistor behaviour. There are a thousand differnt specs for thermistors. You must get the data-sheets on the one SABorn provided and the one you bought.


You seem to be trying to do 120 things in parallel as opposed to over a 20 year period. Maybe you should concentrate on getting some simple 'elements' up and running and then get it all together.
 

SAborn

Senior Member
The smaller blue cap i gave you are 10uf caps and it is marked on the casing.

The thermistor you bought (or more so given i think) is a 100K thermistor, so you will need to use it in conjunction with about a 100K resistor (config like in the manual)

What i had showed you with the values on screen was with the use of "DEBUG" in the program as this will display all the variable values to screen.

First you need to do a ...... Readadc pin, variable (ie- readadc C.1, b0) then the value will be displayed in b0 for what is attached to pin C.1.

You will need to enter the correct pin number into the code that the thermistor is connected to and also check the data sheet that the pin in use actually has ADC abilities as not all pins do.

It is best to print out the page with all the pinout diagrams on it for the chip you are using as it is very handy to have a hard copy to refere to, i would be lost without them at times, for a quick check of I/O's.

Pete.
 

120ThingsIn20Years

Senior Member
Post 205.
He was giving you a snippet from the Manual.
You don't have c.1 and b.1 on an 08M.
On an 08M2 you have c.1
Look in Manual 1 Pinout and Circuit.
Maybe the example code has a typo?
No that code works. Thus my confusion. From reading the pins on the diagrams I see I have c.1, but an error I dropped in from cutting and pasting some code when I was trying to pulse my LED still worked with the b.1 port.pin designation. This led me to believe that the stuff I thought I understood, was wrong.

This, in turn, led me to doubt that which I believed to be unconditionally true.

Not such a bad thing to do from time to time.

"b.1" and "c.1" can be used interchangeably for some reason.

Post 206.
I can't help directly but would strongly suggest that you get a decent DMM which has capacitance measurement capability via the test leads.
For the future this will prove invaluable when you drop your box of unmarked surface-mount ceramics :)
You seem to be trying to do 120 things in parallel as opposed to over a 20 year period. Maybe you should concentrate on getting some simple 'elements' up and running and then get it all together.
point taken, but I'm just trying to get a grasp on the basics with regards things like the names of the pins, and make sure I understand them before moving on. Actually I did move on, but the comment from SABorn prompted me to ask) When I think I understand something, then something comes along that makes me think that perhaps there is is something else going on, it throws me a bit.

I tend to grasp the next level faster and more thoroughly, if I make sure the first level makes sense to me before moving on.

Just remember, I'm a total novice, so even reading the manuals is difficult. The passege quoted is relitively easy to understand compared to some, but if you look at it with the bits I dont understand removed, you get a bit of a feeling for what it's like for me.

This is from page 71 section 1 of the first PICAXE manual. I'm reading them in order as suggested.


And keep in mind this is the bit that is designed to help me understand the pin naming convention. And also keep in mind that I can use b.1 and c.1 interchangeably.

"

Therefore the pins on these parts are referred to by the new
XXXX.PIN notation. Up to 4 XXXXX (A, B, C, D) are available, depending on chip
pin count.
e.g. Output commands Input Commands
high B.1 XXXXX A.2, XXX, XX
XXXXX C.2, XXXXXXX XXXXXX B.1X XX XX
XXXXXX A.3, XXXXX, (b1) XXXXX C.0, XXXXX, b3

"

The X'ed out sections are the bit's that haven't been described to me yet in the manual, although they have been referenced as examples to illustrate themselves as they have been used in this text. Just look at how many X's there are after the bit that says "eg." Just do a search for any of the X'ed bits within manual 1 to confirm this.

But... I'm not stupid, I have a very firm grasp on study, am highly familiar with forum use, and everyone on this forum has been amazingly patient and helpful, so I'm confident I'll get there in the end :)

If you're referring to the new posts on my blog where in the last week I've been working on a new invention ie the swirl filter, and then a new method of growing carrots, these posts are "banked" to a certain extent, and are to a large degree, pre-written leading up to my taking on a new topic. This allows me to concentrate on the new topic without letting down my readers, If I miss a few posts, it can cost me thousands of hits, so there is quite a bit of preparation before taking on a new topic. I need to start posting on this topic within a week or so if I'm to avoid calling on my reserve topics posts. Regardless the seeming parallel nature of the topics is in large part illusion. In spite of the efforts I put in, the quality of posts does suffer when I take on a new topic as the time involved in the first steps can be overwhelming. New topic posts can be a rushed affair, and its normally not until I'm well into a topic that I can actually offer any new inventions or ideas to the reader. With this in mind, some overlap of topics needs to exist in order to maintain my desired contribution of a new invention or idea every month. It will be quite some time (if ever) before I have anything to offer my readers within the topic of electronics [other than sharing my learning journey] so topic overlap is essential.
 
Last edited:

SAborn

Senior Member
It would appear you are making a bit of a dogs breakfast out of the pin numbers and mixing variable in with pin numbers.

For starters, why are you worring about A,B.C,D banks with pin numbers, as at present all you have is 08M chips and they dont use the A,B,C,D bank labels just the number on its own.
Dont try to jump too far ahead and learn everything, just start doing a little programming trials and look up or ask when you get stuck, it will all fall into place piece by piece as you go.
Then to change to a different chip will be easy as you will have an understanding of how the basics work.

Any call of a "b#" like b1 or b0 etc, etc, without a "." between the "b" and the number is refference to a variable and not to a pin number.

All pin numbers will be written with a "." like b.1 or B.0, i like to use lower case for the variables (b1) and upper case (B.1) for the pin numbers, but it will make no difference to the program either way, it just makes it easier for me to read in code.
 

hippy

Ex-Staff (retired)
"b.1" and "c.1" can be used interchangeably for some reason.
To understand the decision behind the port.pin convention one has to look back to older PICAXE, for example the 20M; this had inputs 0-7 on the left, outputs 0-7 on the right. As only having 0-7 won't work when there are 16 I/O pins each individually accessible the decision was taken to give the pins labels; C.0-C.7 on the left, B.0-B.7 on the right. B and C were used because A had been used on other PICAXE already.

If one compares a 20M with a 20M2 and its port.pin designation, B represents the output port of what was a 20M and C represents input port of what was a 20M. After upgrading from 20M to 20M2 Students may take this as meaning C is input, B is output, because they are familiar with the older 20M, project boards and circuits designed for 20M use. For their use that's entirely logical, inputs on the left, port C, outputs on the right, port B, even though most pins can now be used as either input or output.

For students moving from 20M to 20M2 it can then be taken that input 1 becomes C.1 and output 2 becomes B.2. But what of the 8-pin PICAXE which only ever had one set of pins which could be input or output; does pin 1 used as output become B.1, if used as input does it become C.1, and if used for both input and output is it B.1 or C.1 ?

The easy answer is to let the student decide which they want to use, whether that be 1, B.1 or C.1; they all refer to the same pin. We refer to the pins of the 08M2 as C.0-C.5 and that's the 'official designation' but 0-5 and B.0-B.5 are also accepted by the compiler to make life easier for students if they want to do things their own way. It also means that it's easy to take most programs written for the 08M and use them with an 08M2 without requiring any change.

The compilers also try to make it easy for students who may find an 08M2 program and try to run it on an older 08M; pins C.0-C.4 and B.0-B.4 will be converted to 0-4. This means that the older 08M also has C.0-C.4 and B.0-B.4 pins even though the official designations are 0-4.

So one could say multi-use pin naming ( 1, B.1 and C.1 ) for the 08M2 is to make classroom life easier where student focus is often on making their projects work rather than about the niceties of programming and official designations.
 

120ThingsIn20Years

Senior Member
It would appear you are making a bit of a dogs breakfast out of the pin numbers and mixing variable in with pin numbers.

For starters, why are you worring about A,B.C,D banks with pin numbers, as at present all you have is 08M chips and they dont use the A,B,C,D bank labels just the number on its own.
Dont try to jump too far ahead and learn everything, just start doing a little programming trials and look up or ask when you get stuck, it will all fall into place piece by piece as you go.
Then to change to a different chip will be easy as you will have an understanding of how the basics work.

Any call of a "b#" like b1 or b0 etc, etc, without a "." between the "b" and the number is refference to a variable and not to a pin number.

All pin numbers will be written with a "." like b.1 or B.0, i like to use lower case for the variables (b1) and upper case (B.1) for the pin numbers, but it will make no difference to the program either way, it just makes it easier for me to read in code.
Nah I've got the distinction between variables and pins although I can see that it might be a trap. V1 might have been better as a variable designation given the port.pin convention, but I presume the b is about bits or bytes.

I'm building circuits from all the components you gave me and learning basic electronics.

I tend to be quite good at learning stuff, and can tell when I don't understand something.

Just using a number on its own is new to me as of this hour, but the b.1, c.1 indicated to me that there must be more to what I was looking at than I understood.

I seems there was (thanks again hippy), but it wasn't important. Just confusing.

I wasn't actually stuck on this stuff, I just kept going using c.# for pins. My code is working fine. It's just that I didn't understand why.
 
Last edited:

120ThingsIn20Years

Senior Member
A proud milestone in my education!

I just successfully identified and selected my first resistor from my recycled components bin without having to look up the colour codes :)

Yay me!!!
 

SAborn

Senior Member
Did you remember the little resistor rhyme i told you....Bad, Boys,.......................................grey, white?
 
Last edited:

SAborn

Senior Member
Hippy,

Well i just learnt something too, i did not know the 08m could be used with "B.# or C.#" i must stop growling at folks who have been doing this with the 08m code. :eek:

I had figured the "A,B,C..." bank numbers was from the raw pic labels given by microchip as in most cases they match up, which is good for those who use both chips.
 

lbenson

Senior Member
I hope I'm not far wrong in saying that, basically, the pin and variable naming conventions (B.1, C.1, B1, W1) that you are asking about are arbitrary names chosen by Rev.Ed. to designate the various pins and register locations on the chips.

They are arbitrary in that Rev.Ed. could have called them something else, and that would have worked well if consistant and reasonable. They are not arbitrary in that they are based on the naming conventions and organization which Microchip uses for the underlying chip.

Unless you wish to read the Microchip data sheets to see how Microchip has organized the microprocessors which underlie the PICAXE chips, then you will do well just to accept that you have to memorize these naming conventions, just as you would have to memorize many terms if you were to take up sailing and have to learn port and starboard and fore and aft.

So regarding the pin designations, C.1, B.1, and so forth, you need to see that the inputs and outputs can be processed in two different ways--as individual pins, and as "ports" which may have up to 8 pins. The 20X2/M2 may illustrate this best since it has one entire 8-bit port on its left side (port C) and another on its right (port B).



You can read the entire 8 bits of port C with "B0 = pinsC". You can write the entire 8 bits of port B with "outpinsB = B0". The following program illustrates this--you can run it in the simulator. First the direction of the pins in port B is set to all outputs ("dirsB = "11111111"). Then all the portB pins are turned on for two seconds, and then off for two seconds. Then the program enters an endless loop, and the portB pins reflect the status of the portC pins. Click portC pins on and off to turn on and off the portB pins.

Code:
#picaxe 20x2

  dirsB = %11111111    ' port B all outputs
  outpinsB = %11111111 ' set port B all high
  pause 2000
  outpinsB = 0
  pause 2000

main:
  outpinsB = pinsC   ' reflect port C on port B
  pause 2000
  goto main
Each pin can also be turned on independently. In the program above if you replace "outpinsB = pinsC" with "pinB.4 = pinC.4" you can turn pinB.4 on and off by clicking pinC.4. Note that this works with any port B pin and any port C pin, and if the pin direction is set properly, either port B or port C can be input or output (with X2 and M2 parts--with some idiosynchracies).

MEMORY VARIABLES

The variables, B0-B13, W0-W6 (higher in X1, X2, and M2 parts) do not reflect underlying Microchip architecture in the same way. They are names which Rev.Ed. has provided for memory locations which may differ from Microchip part to part. This provides consistency across the PICAXE line--another way in which Rev.Ed simplifies things for us programmers.

The "B" series of variables are byte-sized (8-bit values from 0-255), and the "W" series are word-sized (16-bit values from 0-65,535). The "W" and "B" variables overlap--each "W" variable is made up of two "B" variables, for example, W0 is made up of B0 and B1. If you have set W0 to a certain value, and change B0, don't expect W0 to retain the original value.

So these pin and variable names are (relatively) arbitrary labels provided by Rev.Ed. to make programming (relatively) consistant across Microchip parts which have a wide range of pins and capabilities.

Hope this helps.
 

John West

Senior Member
I had to help the 12 year-old I tutor in electronics learn the color code. I wasn't sure what to tell him about the phrase I learned so I had him invent his own little reminder phrase. He did, although it's a bit different from the "industry standard" one. Whatever works.
 

premelec

Senior Member
color code has physical basis in part...

Note that the rainbow spectrum defines red through violet in order - your only problem is if you see indigo as a color and remembering black and brown and gray and white... :)
 

120ThingsIn20Years

Senior Member
The blue background resistors was a poor colour choice.

I think it's because people don't have a lot of blue receptors in their eyes, that our brains make up for some lost input by firing nearby receptors and this creates colour bleed.

You notice it a lot with near ultraviolet light.

Should I start a movement for matt beige resistor backgrounds, or is it just me :)
 

sedeap

Senior Member
IC for everything...

Hi Pal's:

In my Life-route I make several gadgets and Logic-Bots by need of simple solutions, but in Outdoor-Camping-Fishing I make the most rewarding effort things (at least for me, anyway)

Some:
Fresh water meter for camping or survival training
Solar compass and clock
Clepsydras (Gravity and float forces)
Tramps / Catch / Feeders
Water-Ram pumps
Wind pumps
Portable detectors (wind, rain, temp, turns, light, fire, sound) in modules to activate some device or alarm.

So almost the sky is the limit to reach wit this IC and a bunch of discrete parts.
Enjoy it... not fear allowed !!!

:eek:)
(for those who don't know me or remember me, bear with me, English is not my mother language)
 

hippy

Ex-Staff (retired)
Should I start a movement for matt beige resistor backgrounds, or is it just me :)
I wouldn't object. I sometimes have difficulty in telling red, orange, brown apart when I have a resistor in isolation and the blue-bodied resistors seem to make it harder. I usually resort to using a meter but then have to work out what "47" actually means depending on meter setting.

What I've always felt would be handy is a meter which indicates resistance rounded to the nearest E-series value, so displays "47K" even if it is 49115R. It could even display the colour code names as well.

There's a challenge in reading resistances across the entire range but, solve that, and it could be an interesting and useful PICAXE project. It might even be possible to hack the 18M2 in the Budget LCD / OLED module to do that.
 

SAborn

Senior Member
I will second the poor colour selection for metal film resistors, I hate them with a passion but have learnt to live with using them.

Why would someone pick blue as a industry standard for the backgroung colour beats me, at least our fore fathers in electronics got the old carbon resistor right as far as the fawn colour.

Using a meter with metal film is a must i think, as there is different combinations of colour markings depending on the manufactor and this makes it even harder to read the colour values.

I like Hippys idea of a rounding meter it would be a handy device to have, better still would be one that read the colour bands like a barcode scanner, as it would save a lot of probing and chasing those little suckers around the bench trying to get your probes on both legs.
 

120ThingsIn20Years

Senior Member
This is getting complex :)

It may as well have an enlarged web cam close up as well, showing those of us with poor eyesight a 10 by 10 picture of the beast whilst yelling its value into your ear horn accompanied by two picaxe robot arms finger spelling the output in international sign language :)

Actually that would be kind of cool :)



I was checking my solder joints with my camera way back all those minutes ago (this is day 13) when I first started soldering, because I couldn't see well enough until I got a $5 magnifying hat thing.
 

John West

Senior Member
I typically wear a magnifying lens hat when I'm build up PCB's, and I always measure every resistor's value before I install it. I catch any defective or out of tolerance resistors or incorrectly marked resistors (yes, they exist) by doing so. I've found my bds get built and working quicker than they would have if I simply tried reading the resistor values visually then sticking them in, then having to troubleshoot the bds when there was a problem.

I too find the selection of blue as a resistor body color to be quite stupid. The idea should be to select a color that both identifies the type and the value clearly. What's wrong with white as a metal film resistor body color?

So many problems with new circuit bd assemblies are due to visually small "mechanical" problems, solder bridges, folded over leads, damaged or improperly mounted components, etc, that care in assembly and close visual observation are a must, especially when working with closely packaged DIP or SMT assemblies.

Over the years, the time I've spent double checking my components and my work during assembly has more than paid for itself in time saved and reduced frustration. It's the lesson I try the hardest to teach to anyone I'm introducing to the hobby of electronics.
 
Last edited:

sedeap

Senior Member
Cheap & rubbish components sold as goods

Yeah... I've found in the middle of a resistors reel, all the second half of that reel, 2 of the color rings melted together and one vanishes out (maybe lack of paint?)
and I start a wondering ..., how in the hell one technician can "guess" what value is that if need to replace those resistors...
:mad:

(We still have suppliers with beige base color resistors) Lucky me !!... hahaha...
 
Last edited:

SAborn

Senior Member
I thought in today's electronics, it was too costly to replace a resistor and we just throw the item away and buy a new one from China....well that seems to be how things are made now ...disposable.

Speaking of lack of paint, i would like to see Rev-ed use more paint on their markings of the new picaxe chips, so it was much clearer to read for those of use with non student level eyesight anymore.
 

sedeap

Senior Member
Lack of Paint?

Speaking of lack of paint, i would like to see Rev-ed use more paint on their markings of the new picaxe chips, so it was much clearer to read for those of use with non student level eyesight anymore.


Well... those look nice to me... LOL
 

nick12ab

Senior Member
The markings fade easily when rubbed by human fingers. Don't Microchip make the markings anyway, so it's nothing to do with Rev-Ed?
 

Dippy

Moderator
I go along with John West.
When I'm doing a small prototype I measure/test every passive/discrete before assembly, including SMD. Cuts down on variables/worries/build-failure. Measuring in-circuit can be a pain.

I must confess that I buy passives from Farnell and RS. Never had a duffer... yet, but I still squint at some markings mainly due to eyesight.
 

120ThingsIn20Years

Senior Member
I go along with John West.
When I'm doing a small prototype I measure/test every passive/discrete before assembly, including SMD. Cuts down on variables/worries/build-failure. Measuring in-circuit can be a pain.

I must confess that I buy passives from Farnell and RS. Never had a duffer... yet, but I still squint at some markings mainly due to eyesight.
What does "I buy passives from Farnell and RS" mean?

I know this sounds like a funny tongue in dom cheek question, but what does this actually mean?

I'm new here.
 

nick12ab

Senior Member
Passives = passive components such as resistors and capacitors
RS = Electronics supplier
Farnell = Electronics supplier

By the way, your blog link doesn't seem to work properly.
 

120ThingsIn20Years

Senior Member
Passives = passive components such as resistors and capacitors
RS = Electronics supplier
Farnell = Electronics supplier

By the way, your blog link doesn't seem to work properly.
Thanks nick.

That would be because I type from habit, rather than from attempting any commonly understood form of inter-human communication.

I'm of the opinion that my browser should understand my intentions rather than the text I actually type :)

try...

http://120thingsin20years.blogspot.com
 

Dippy

Moderator
Ooops, yes that's right.

Places like Farnell (or RS Components, Digi-Key, Mouser) have large inventories of bits.
They also have parametric searches, which means you can select a 'MOSFET' that can handle '50 Amps' and '100 volts'.
Far easier than Google.
... and then you can (99.99% of times) download the device Data Sheet and read.
 

120ThingsIn20Years

Senior Member
Thanks nick.

That would be because I type from habit, rather than from attempting any commonly understood form of inter-human communication.

I'm of the opinion that my browser should understand my intentions rather than the text I actually type :)

try...

http://120thingsin20years.blogspot.com
I cant see any difference between the two links...

but when I click on the link in my signature, I get my own control panel home page, and the other gives my public page. Both links appear identical to me.

I love it when I'm totally baffled by everything.

I think it's healthy to have your self perceived IQ trimmed on a daily basis. :)

just do a search for 120thingsin20years on your favourite search engine. It shows up everywhere.
 
Top