axe133y oled display kit

peter howarth

New Member
Once i get my external 18m2 to show my own message/s onto the oled screen, is there any reason why the one 18m2 cant be programmed to send messages to say half dozen oled displays, provided that the 18m2 has enough output serial talking port pins? Regards Peter
 

Jack Burns

New Member
Peter, your code in post #35 has a wrong number in the line after Main:
It should say serout Display,n2400,(254,1) but you put 245,1

next b0 is also missing from the line after pause 500

Edit:
Make sure you also follow the advice from lbenson in post #40 #39 (corrected 27.07.2021)

One 18m2 should be fine to drive several oled displays provided you have enough serial output pins. You might notice a slight lag with the display updating if you change several displays at the same time.

Regards
Jack
 
Last edited:

peter howarth

New Member
Peter, your code in post #35 has a wrong number in the line after Main:
It should say serout Display,n2400,(254,1) but you put 245,1

next b0 is also missing from the line after pause 500

Edit:
Make sure you also follow the advice from lbenson in post #40

One 18m2 should be fine to drive several oled displays provided you have enough serial output pins. You might notice a slight lag with the display updating if you change several displays at the same time.

Regards
Jack
thankyou Jack , a question that i have always asked: when is an output pin not a suitable serial pin, and when is an output pin a suitable serial pin, i have already asked for a chart of all possible usable picaxe devices and their definitive pins suitable for serial comms to an oled..I shall rewrtie your program into the external 18m2, and also try b5 pin instead of b7 pin, the b5 being hserout, also what does the h stand for in the labelled hserout ?
Regards Peter
 

peter howarth

New Member
This is the EXACT picaxe device the 18m2 that I am using for serial comms to the axe133y, I have tried output pin B7, NO GO, I have tried output pin B5, no go, does anyone have a schematic and programming code that works with a picaxe 18m2 for serial comms to an axe133y OLED display unit? Regards Peter
 

Technical

Technical Support
Staff member
Pin names have a period in the middle e.g. B.5 and B.7
B5 and B7 are variable names - make sure you understand the difference (the manual 1 tutorials will help).
 

peter howarth

New Member
Ok I shall keep with tradition and ask yet another dumb question, why does the up puncuation arrow appear between the 1 and the word TO ?? IN MY PHOTO?
 

bfgstew

Senior Member
Using serout you need to use the serout pin, which is B.3 I would assume. I am sure someone will say otherwise.
 

lbenson

Senior Member
Ok I shall keep with tradition and ask yet another dumb question, why does the up puncuation arrow appear between the 1 and the word TO ?? IN MY PHOTO?
COUNT is a valid command. As to exactly where the "^" is placed, it depends on where the syntax checker is when it determines that the syntax is not correct.
 

Jack Burns

New Member
Peter,

Your post #44 has a mistake and should look like the code below. Note the ; before the word Count as this makes the whole line into a comment

Code:
; Count from 1 to 10 and display number on bottom line.
for b0=1 to 10

Here is the complete code again.

Code:
SYMBOL Display = B.7 ; Pin on external PICAXE used to send data to axe133y

init:
pause 1000 ; wait for display to initialise, found 500 wasn't long enough

main:
serout Display,n2400,(254,1) ; clear display
pause 30 ; now wait 30mS for display to fully clear

serout Display,n2400,(254,128) ; Move to line 1, position 1
serout Display,N2400,("Start Counting") ; output text

; Count from 1 to 10 and display number on bottom line.
for b0=1 to 10
    serout Display,n2400,(254,192) ; Move to line 2, position 1
    serout Display,N2400,(#b0) ; output b0 as text
    pause 500 ; short wait before moving on to next number
next b0

; Overwrite top line with new message (long enough to overwrite original)
serout Display,n2400,(254,128) ; Move to line 1, position 1
serout Display,N2400,("Finished      ") ; output text
Regards
Jack
 

bfgstew

Senior Member
Reminder to myself to double check post before posting!
You are of course correct Mr Benson, serout pin is C.3 and not B.3 which I incorrectly posted for some odd reason........DOH.
 

peter howarth

New Member
I have got my 18m2 to comms to the axe133y, found intermittent brand new ic socket fault,after trying another 18m2,, anyway, I would imagine that different messages for different input events can be programmed into gosubs into an 18m2 , or 20x2 or 28x2, for serially sending text strings to an axe133y oled unit, for displaying events like : low oil, high temp, high rpm, solar disconnect , battery flat etc etc, in otherwords input 6 going active shows low rpm text, input 3 going active shows battery current etc etc etc, where could I find example coding ?Regards Peter
 

peter howarth

New Member
Thankyou for your coding example Jack, it all works 100%, now I am working on how to program the oled to show different text strings for different input events that go active on the inputs of the external 18m2.. are there any tutorials that might show how to use gosubs to achieve this..Regards Peter
 

lbenson

Senior Member
One way is to use a SELECT statement. You determine which of, say, 4 statements you want to display (or as many as you like), then:
Code:
  SYMBOL Display = B.7 ; Pin on external PICAXE used to send data to axe133y
  W2 = 48611 ' 5000th prime (better prime number sequence)  
  do
    RANDOM w2
    b6=w2 // 6 + 1 ' random number between 1 and 6
    SELECT b6
      CASE 1: serout Display,N2400,("Start Counting") ; output text 
      CASE 2: serout Display,N2400,("Display line 2") ; output text
      CASE 3: serout Display,N2400,("Display line 4") ; output text
      CASE 4: serout Display,N2400,("Display another line 2") ; output text
      CASE 5: serout Display,N2400,("Display yet another") ; output text
      CASE 6: serout Display,N2400,("Display line 6") ; output text
    ENDSELECT
    pause 2000
  loop
In PE6, first set up to simulate the axe133:
24750
Then run the simulation:
24751
Of course, for each display text line, you will have to include the command codes to specify which line if the display you want to place it on.
 

peter howarth

New Member
Thankyou Everyone on the forum, I have been able to program the oled with at least simple text strings, I am now trying my hand at making text strings blink on and off, to be a bit more attention getting with certain alarm inputs .. Also is it possible to interface an axe133y or axe134y oled display with an 18m2 or other picaxe device with a real time clock rtc such as the dallas 1307 or similar, such that on one line of the oled shows the current passing time, and on the next line, the display shows when an event occurs, ie it freezes the event time on the display.??. I have also played with gosubs with some success showing different text strings for different events, as soon as I can I will share my coding as to how I programmed the gosubs.. Regards Peter
 

inglewoodpete

Senior Member
Thankyou Everyone on the forum, I have been able to program the oled with at least simple text strings, I am now trying my hand at making text strings blink on and off, to be a bit more attention getting with certain alarm inputs .. Also is it possible to interface an axe133y or axe134y oled display with an 18m2 or other picaxe device with a real time clock rtc such as the dallas 1307 or similar, such that on one line of the oled shows the current passing time, and on the next line, the display shows when an event occurs, ie it freezes the event time on the display.??. I have also played with gosubs with some success showing different text strings for different events, as soon as I can I will share my coding as to how I programmed the gosubs.. Regards Peter
Yes, the AXE133Y/134Y is capable of receiving and displaying data from another PICAXE that is also interworking with an RTC (clock) chip. Success all depends on your skill level and determination to succeed.

I have done something similar with an LCD (not the AXE133/134), DS1307 RTC, 24LC256 external EEPROM and 3 x DS18B20 temperature sensors. I suggest you do your development one step at a time.
 

AllyCat

Senior Member
Hi,

Yes, all quite possible, but note that the DS1307 requires a 5 volt power supply (minimum 4.5 volts), as does the original LCD AXE133. However, the OLED AXE133Y can work at lower voltages, as will the far superior DS3231 RTC that is available on low-cost "breakout" modules, complete with a coin cell (backup) battery holder and optional, I2C EEPROM (24LC...) if required. But also yes, do the Program development "One (small) Step at a Time". ;)

Cheers, Alan.
 

peter howarth

New Member
Can a picaxe be used to provide a stepped dc voltage output,say in either 10millivolt steps, or 100millivolt steps, ie from a DAC output pin,between 0 volts to 3.7 volts dc, then fed to an ADC input of another picaxe , to simply have a self running program to test a picaxe setup for reading adc values from 0 volts to 3.7 volts dc, then from 3.7 volts back down to 0 volts, rather than manually adjusting a pot to do the same..I was thinking about connecting the adjust pin of an lm317 voltage regulator, via some different resistors switched via npn transistors, but thats quite involved..
 

AllyCat

Senior Member
Hi,

Yes, the PICaxes do have a DAC, but its limitations are so great that it's hardly ever worthwhile to attempt to use it as an external signal, particularly with M2 chips: It's usually (only) on the Serial/Programming Output pin, it has only 32 levels and its output resistance is very high, so it's usually recommended to add a hardware Buffer (Op-) Amplifier.

However, any of the "PWM" outputs can generate a "d.c." level by adding a simple Low-Pass (frequency) filter, which can be just a resistor (typically 10k) from the pin, connecting to a capacitor (typically 1 uF) that has its other terminal to Ground. The PICaxe pin(s) which can be used depend on the PICaxe chip (for the 08M2 it's only c.2, or Leg5) and you can use a command of the form PWMOUT {pmwpin} , 255 , {pwmduty} (the PWMDUTY command is also available, but is not normally necessary for a "DAC" application). {pwmpin} will be typically pin C.2 and {pwmduty} can take any (word) value from 0 (zero) up to 1023. The filtered voltage is equal to approximately the Supply voltage (Vdd) * {pwmduty} divided by 1024 , therefore about 4 mV/step. So you could generate a staircase on pin C.2 with:
Code:
#picaxe 08m2
do
   for w1 = 0 to 1023     ; Add e.g. STEP 25 for larger steps (~100mV)
      PWMOUT c.2 , 255 , w1
      Pause 100      ; For 10 steps / second
   next
loop

#rem
              _______
             |o  U   |
    +Supply==|+Vdd 0v|------------@---------GND
             |       |            |
          SI>|C.5 C.0|--->       _|_
             |       |           ___ 1 uF
         --->|C.4 C.1|--->        | +
             |       |     10k    |
         --->|C.3 C.2|----/\/\----@-------->  DAC Signal
             |_______|
               08M2
Cheers, Alan.
 

peter howarth

New Member
I have been able to program a 40x2 picaxe to show different oled messages, 16 messages at the moment, from the bcd switches(as if from numerous event inputs) connected to the b0 to b7 input pins of the 40x2 chip, I could select from 99 different messages , only limited by the memory space of the 40x2, 16 oled screen messages has used 1369 of 4096 units of memory space so far.. The uln2803 is for controlling an 8 way/channel transmitter input ..I will now try and use the adc function to show differing/changing voltage levels on the oled screen.. I have other functions intended for the other inputs/output pins of the 40x2. The oled unit is the axe133y ..I have used the flowchart method in the pe6, works really well..Regards Peter
 

peter howarth

New Member
this is the flowchart program code that i used from pe6, for my trial oled 16 message test board, from a picaxe 40x2 serial comms to the oled via the d3 pin..this code list has used 1368 units of 4096 memory space..although it shows lcd, still works for the oled unit ok.. regards peter
 
Top