Axe133y problem

vansav8r

New Member
I wonder if anyone could help please, I am using a Axe133y oled display and have somehow corrupted the welcome message, once this has loaded and finished the display works fine. I would like to delete the welcome message altogether, can I do this from my controlling Picaxe or do I need to do this using the display Picaxe, will I need to reinstall the display firmware?
 

tmfkam

Senior Member
Reinstalling the display firmware should return the display to "factory-fresh" condition. Modifying the display firmware and then installing that modified version gives the option to edit or remove the welcome message.
 

Circuit

Senior Member
Welcome to the PICAXE forum - one of the most courteous and helpful forums on the Internet...so I trust we can help!

The AXE133Y firmware is available here; http://www.picaxe.com/downloads/axe133y.bas.txt

If you read through the firmware you will see the welcome message and how it is displayed. Connect a PICAXE download cable directly to the AXE133Y to upload the original or edited firmware directly to the 18M2 chip on the display unit. Customising the firmware to give your own start-up message is quite easy; just edit in the appropriate lines.

If you have any further difficulties, just come back to this forum.
 

vansav8r

New Member
Thanks for the quick replies, I was a bit windy about reinstalling the firmware but will now give it a go and probably modify the welcome message in the process.
 

vansav8r

New Member
This nearly sent me crackers! I downloaded the new firmware and still got corrupt welcome message, I eventually got rid of the welcome message but then the text in my program started playing up, HELLO JIM displayed correctly HELLO JIMMY displayed HELLO JIMST after a lot of fiddling about I finally decided the problem must be hardware and not software related, I got my magnifying glass out and scoured the solder joints, I found two on the header between the two boards looked a bit dry so I re soldered all the header connections and hey presto everything now works as it should. Should have gotn to Specsavers!!!!!!!!!
Thanks for everyones help.
 

techElder

Well-known member
Should have gotn to Specsavers!!!!!!!!!
That threw me for a second or two! :D In Texas that would be "TSO - Texas State Optical"!

Glad you got it fixed. Nice job troubleshooting even without your "specs!" :D
 

vansav8r

New Member
My problems continue I am using the following code

serout C.7,n2400,(254,128)
serout C.7,n2400,("No of Steps ")
serout C.7,n2400,(254,192)
serout C.7,n2400,("Press to enter")
serout C.7,n2400,(254,141)

after number of steps I am trying to display the value of variable b1 by using this code

serout C.7,n2400,(254,141)
serout C.7,n2400,(#b1)

this works fine on the editor simulator but is doing all sorts of funny things with the display I either get three random graphics or part of a standard message stored in the eeprom like "this is msg13"
in the past Ive used bintoascii on the non OLED display and that worked fine but wont work on this OLED display.
Ive tried to attach a couple of pictures of the display, any help would be appreciated
IMG_1547.JPG
 

oracacle

Senior Member
ensure you haven't accidently typed 253 in you code.
also try moving #b1 into the same command as the move cursor, if you keep it as two commands you may need a 'pause 10' or the likes between to the 2
 

bfgstew

Senior Member
In the 133 firmware, have you deleted all of the preset messages? If still in the firmware it will still show up.
Also add the 'clear' command 254,1 this will clear the display ready for the next command otherwise any character outside the new command will still show on the screen.

If you can post the entire code you are using, this will help greatly in identifying any errors.
 

vansav8r

New Member
Thanks for the replies, I have checked and there are no 253 in the code, the project is using a keyes rotary encoder to input a number of steps for a stepper motor, most of the code was off the forum and works well as confirmed by debug, the counter is a variable b1 and this is incremented or decremented by 5 steps per step of the encoder rotation.
I have added the display code which I have used before on a non OLED display without difficulty. The text, clear screen and position commands work fine but it will not correctly display the number held in b1,
bfgstew, as requested I have added the code in progress, I am using an 18-m2.
Thanks again

'===================================
'ROTARY ENCODER READER Picaxe 18M2
INSTRUCTIONS:
#Picaxe 18M2 ' specify the PICAXE the program code is for
#No_Data 'do not download data EEPROM values


'=====================================

STARTUP:
serout C.7,n2400,(254,128)
serout C.7,n2400,(" FOCUS STACKER")
serout C.7,n2400,(254,192)
serout C.7,n2400,(" Jim Small 2018")
Pause 2000
serout C.7,n2400,(254,1)
pause 1000
serout C.7,n2400,(254,128)
serout C.7,n2400,("No of Steps ")
serout C.7,n2400,(254,192)
serout C.7,n2400,("Press to enter")
serout C.7,n2400,(254,141)

let dirsC=%0000000

INIT:
setfreq M32 'set clock frequency
'b1 is output counter
'c.1=clk
'c.2=DT
'C.1=0 and c.2=0 = b0=0
'C.1=1 and c.2=0 = b0=2
'C.1=0 and c.2=1 = b0=4
'C.1=1 and c.2=1 = b0=6

main: gosub read_c 'read the encoder
if b0=0 then main 'test rotation?
if b0=4 then goto CW 'start of a clockwise rotation
if b0=2 then goto CCW 'start of a counter clockwise rotation
goto main

CW: gosub read_c 'is rotation CW
If b0=4 then 'wait for more
goto CW
else
if b0=0 then main 'return if rotation reversed
endif

six: gosub read_c 'read the encoder
if b0=6 then 'check if clockwise
goto six
else
if b0=4 then CW 'if reverse rotation then goto cw

deux: gosub read_c 'read the encoder
if b0=2 then 'check if clockwise
goto deux 'wait for more
else
gosub read_c 'read the encoder
if b0=6 then six 'if reverse rotation then goto six
goto CWT 'clockwise complet?
endif
endif

CWT: B1=b1+5 'increment b1 +5
gosub DISPLAY
debug
goto main

CCW: gosub read_c 'rotation is clockwise
If b0=2 then 'wait for more
goto CCW
else
if b0=0 then main 'goto main if rotation reversed
endif

six1: gosub read_c 'read the encoder
if b0=6 then 'check if counterclockwise
goto six1 'wait for more
else
if b0=2 then CCW 'if reverse rotation then goto ccw

deux1: gosub read_c 'read the encoder
if b0=4 then 'check if counteclockwise
goto deux1 'wait for more
else
gosub read_c 'read the encoder
if b0=6 then six1 'if reverse rotation then goto six1
goto CCWT 'counterclockwise complet?
endif
endif

CCWT: if b1=0 then fin 'if b1 = 0 then fin
B1=b1-5 'decrement b1-5
gosub DISPLAY
fin: debug
goto main

read_c: b0=pinsC 'reading pins c
b0=b0 & %00000110 'mask c1 & c2
return

DISPLAY:
serout C.7,n2400,(254,141)
serout C.7,n2400,(#b1)
pause 1000
return
 

AllyCat

Senior Member
Hi,

It appears that you have raised the clock frequency to 32 MHz (setfreq M32) but not dropped it again to 4 MHz (Note: n2400_32 isn't available) for printing the #b1 ?

Cheers, Alan.
 

vansav8r

New Member
Hi,
The 32M was in the program for the encoder that I copied off the forum, I didnt realise this would cause a problem with the display, it's many years since I played with Picaxe and then used the 18 & 18X series so have to admit to not being familier with these faster chips.
I dont need a lot of speed with this project so presumably could drop the speed or can I still use 32M but with different coding to the display? I did try the code using an 18X but that didnt work so I went for the 18M2 and the encoder part worked fine. Happy to try any suggestions.
Thanks again,
Jim
 

vansav8r

New Member
Well, I dropped the speed down to 4Mhz and the display works, sort of. The issue now seems to be that the program is running much slower and therefore the sampling of the encoder is hit and miss, instead of incrementing on each click of the encoder I have to wind it and allow the program to take a sample when it gets round to it.
Still this is encouraging, it wont work at 8Mhz so I probably need to operate the encoder at M32, can I drop the clock down to M4 just for the display bit?
Thanks
Jim
 

vansav8r

New Member
Strange that the display handles the text string fine at M32 but will not handle the variable, is there any way to convert the value of variable b1 into a text string then shove that to the display? just a thought
 

hippy

Technical Support
Staff member
serout C.7,n2400,("Press to enter")
serout C.7,n2400,(254,141)

let dirsC=%0000000
You are making your output C.7 an input which could potentially cause problems.

setfreq M32 'set clock frequency

DISPLAY:
serout C.7,n2400,(254,141)
You have changed operating speeds so that N2400 will not produce 2400 baud. You need to specify N2400_32.
 

AllyCat

Senior Member
Hi,

Strange that the display handles the text string fine at M32 but will not handle the variable,
Does it actually handle the text string at 32 MHz? All the strings shown above are sent before the clock rate is increased. Also what's wrong at/with 8 MHz (post #17) ?

A simple solution is to put a SETFREQ 4 before sending #b1 and then a SETFREQ 32 afterwards. You might need some PAUSEs inbetween, but probably not.

I didn't think that a N2400_32 could be defined because the interpreter only includes four divider ratios, the highest giving 2400 baud at 16 MHz? But it really shouldn't need 32 MHz to read a mechanical encoder, perhaps that code can be improved, or will at least work well enough at 16 MHz (together with an N2400_16 in the serial command(s) formatting).

Cheers, Alan.

PS: I've just noticed some DEBUGs in the code and a PAUSE 1000 in the display routine. They will really slow things down. :(

PPS: That's why it's nearly always worthwhile to post the full program code (preferably within
Code:
  [/code ][/B] tags).   ;)
 
Last edited:

vansav8r

New Member
Wow, you're all genius I set the clock to M4 before sending the #b1 and then set it back to M32 before the return and it works like a charm, I have also removed the pause.
Thanks so much I would have been fumbling with this for ages.
Incidentally are the manuals on the Picaxe site up to date with the M2 chips I printed the manuals out years ago and are probably out of date.
Jim
 

AllyCat

Senior Member
Hi Jim,

It depends if you're using PE5 or PE6 (and the age of your paper manuals). If you're still using PE5 then (moderately) old manuals probably won't matter.

There is a more recent paper manual 2 primarily for PE6, but the general recommendation now is to use the on-line Basic commands link (at the top of the forum page), and of course the forum itself.

Cheers, Alan.
 

hippy

Technical Support
Staff member
I didn't think that a N2400_32 could be defined because the interpreter only includes four divider ratios
You are right, and I also seemed to have been on the first page and missed subsequent posts when I repeated what others had already said.

For handling encoder counting and updating LCD the best solution would be to run at the highest speed, use HSEROUT sending a single byte at a time, handle counting by interrupt. That's been detailed in the past but whether needed or not depends on how fast the counting has to be.
 

vansav8r

New Member
Allycat, I did move the text strings to after the M32 and it seemed to handle that ok. At M4 b1 all started to work, at M8 the b1 variable was garbled again. From my point of view everything now works as I require, I dont need great speed and at least we have a workaround if not very elegant from a code point of view, practically it now does whats required.
Thanks for everyones help, no doubt I'll be back with another problem!!
 
Top