8M2 Problems with programs using old code.

hbl2013

Senior Member
I am trying to use the 8M2 to drive an LCD board, and run into problems, even though I am using code that apparently was OK in 2013.I have looked for samples in the Forum using the 8M2, and found several ones. However, it seems that something has changed, for while the old code apparently ran at the time of the publication, the same code gets now rejected because of syntax errors.
Is there something changed with the syntax for the 8M2 between now and 2013? dirsB = %11111111 was a correct statement then, while it gets rejected now. Same with pinsB = b1.
(They both are now syntax errors)
Can anybody tell me how the output pins of the 8M2 are used now?
My goal is for a 8 bit Port to output one hex character at the same time, not one Port output line at the time.
Any comments are appreciated.
 
Last edited:

westaust55

Moderator
I am trying to use the 8M2 to drive an LCD board, and run into problems, even though I am using code that apparently was OK in 2013.I.
I am a bit confused. From your 2013 thread I found,
. . . . . . I too, am using the 28X2 and the B and C ports as the output leads. Only I do not quite understand why the B1 lead is used as the LCD D4 driver. I used the B.4 for that, it makes outputting the data so much easier. Thus that is my change to the program; otherwise it fits my hardware perfectly. I will see if it works in a few days.
Now you mention an 08M2. Are you still work with 4-bit parallel mode (which needs typically 6 output pins)?
The 08M2 only has 4 pins capable of being outputs. See: http://www.picaxe.com/Site_Resources/Media/Site_1/pinout/pinout08m2.jpg

Maybe post your schematic, code and confirm which PICAXE chip you are using.
 

Goeytex

Senior Member
I am trying to use the 8M2 to drive an LCD board, and run into problems....
My goal is for a 8 bit Port to output one hex character at the same time, not one Port output line at the time.
A 08M2 cannot be used as an 8 bit port since it only has 4 available outputs. Perhaps you might clarify what you mean by "output one hex character at the same time"
 

hbl2013

Senior Member
Sorry for the confusion, westaust55. This thread was a random remark, nothing to do with my older postings.
Turns out I wanted to use an 18M2, but ran the program with an 8M2, which generated syntax problems. (Dah!) I discovered it too late to retract the thread, which I am doing now.
Sorry!
 

hbl2013

Senior Member
No apology needed - clarification is sufficient.

So is it all working now? Or do you still need assistance?
No, it is not working and Yes, I do need some more assitance. I was trying to get a PS2 type keyboard to work with a 18M2 and noticed that there is not much information available in this regard. The manual states that there are three BASIC statements available, KBIN,KEYIN and KBLED, of which KBLED only controls the LEDs, and KEYIN is obsolete.
Thus only KBIN is left, and there is no information available on that page as how to physically hook up the keyboard. Also, no example is given as how to use this statement.
If I want to use the 18M2, and using the diagram on page 133 of the manual, do I use C.6 and C.7 (kb clk and kb data) as input ports?
If I make the statement KBIN #b0 , is it automatically assumed by the compiler that I have connected the keyboard to those two pins?
Using the single statement above should be then enough to receive the data from the keyboard and process the information?
Any information as to the use of a PS2 type keyboard is appreciated.
 
Last edited:

westaust55

Moderator
PICAXE manual 2 at the bottom of page 134 has a diagram showing the keyboard connections. see
http://www.picaxe.com/docs/picaxe_manual2.pdf#page130

PICAXE manual 1 page 10 shows the specific two pins for use on an 18M2. See
http://www.picaxe.com/docs/picaxe_manual1.pdf

In terms of the programming Side manual 2 on pages 130 and 130 provide the information, including a programming exams and the lookup for values received for the byte variable depending upon the key pressed.

If there. An be a prospect that no keyboard is connected then you can use the timeout parameter as Kbin command will otherwise wait forever.
 
Last edited:
Top