axe213 direct oled connection

Can somebody tell me where my code is wrong. I have set up a little rf transmit and receive using the axe213 boards and my rx and tx boards, everything works great with the communication and they happily connect. However i am playing around with connecting the receiver side directly to the 16x2 serial oled and have hit a problem i cant seem to resolve (code attached). Everything displays on the oled except the reading for the air temp and this remains blank, i have tried swapping over the sensors and they both work ok. One last question is that sometimes after a period of time the display start randomly displaying some of the internal eeprom messages is this because i am to close with the tx and rx boards ?
Code:
[color=Green];picaxe 14M2 direct transmitter connection to axe033 oled display[/color]

[color=Black]main:[/color]
[color=Blue]pause [/color][color=Navy]1000[/color]
[color=Blue]symbol txpin [/color][color=DarkCyan]= [/color][color=Blue]b.0
serout txpin[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]( [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]128[/color][color=Black], [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]128[/color][color=Black], [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]128[/color][color=Black], [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]1 [/color][color=Blue]) [/color][color=Green];transmit clear screen to oled[/color]
[color=Blue]serout c.0[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]([/color][color=Navy]254[/color][color=Black], [/color][color=Navy]1 [/color][color=Blue]) [/color][color=Green];for simulation only[/color]
[color=Blue]pause [/color][color=Navy]250[/color]
[color=Blue]serout txpin[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]( [/color][color=Red]"Pool Tem" [/color][color=Blue]) [/color][color=Green];transmit first 8 characters[/color]
[color=Blue]serout c.0[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]( [/color][color=Red]"Pool Tem" [/color][color=Blue]) [/color][color=Green]; for simulation only[/color]
[color=Blue]pause [/color][color=Navy]30[/color]
[color=Blue]serout txpin[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]([/color][color=Red]"p =    C"[/color][color=Blue]) [/color][color=Green];transmit second 8 characters[/color]
[color=Blue]serout c.0[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]([/color][color=Red]"p =    C"[/color][color=Blue]) [/color][color=Green]; for simulation only[/color]
[color=Blue]pause [/color][color=Navy]30[/color]
[color=Blue]serout txpin[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]( [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]192[/color][color=Black], [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]192[/color][color=Black], [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]192[/color][color=Black], [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]192 [/color][color=Blue]) [/color][color=Green];transmit clear screen to oled[/color]
[color=Blue]serout c.0[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]([/color][color=Navy]254[/color][color=Black], [/color][color=Navy]192 [/color][color=Blue]) [/color][color=Green];for simulation only[/color]
[color=Blue]pause [/color][color=Navy]250[/color]
[color=Blue]serout txpin[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]( [/color][color=Red]"Air Temp" [/color][color=Blue]) [/color][color=Green];transmit first 8 characters[/color]
[color=Blue]serout c.0[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]( [/color][color=Red]"Air Temp" [/color][color=Blue]) [/color][color=Green]; for simulation only[/color]
[color=Blue]pause [/color][color=Navy]30[/color]
[color=Blue]serout txpin[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]([/color][color=Red]"  =    C"[/color][color=Blue]) [/color][color=Green];transmit second 8 characters[/color]
[color=Blue]serout c.0[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]([/color][color=Red]"  =    C"[/color][color=Blue]) [/color][color=Green]; for simulation only[/color]
[color=Blue]pause [/color][color=Navy]30[/color]
[color=Black]mainloop:[/color]
[color=Blue]readtemp b.1[/color][color=Black], [/color][color=Purple]b0 [/color][color=Green]; read temp sensor[/color]
[color=Blue]pause [/color][color=Navy]30[/color]
[color=Blue]readtemp b.2[/color][color=Black], [/color][color=Purple]b1 [/color][color=Green]; read temp sensor 2
;Insert some code to see if reading has changed from previous reading, if it has then send to oled[/color]
[color=Blue]serout txpin[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]( [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]139[/color][color=Black], [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]139[/color][color=Black], [/color][color=Red]" "[/color][color=Black], #[/color][color=Purple]b0 [/color][color=Blue]) [/color][color=Green]; transmit ascii character reading to oled[/color]
[color=Blue]pause [/color][color=Navy]30[/color]
[color=Blue]serout c.0[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]( [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]139[/color][color=Black], [/color][color=Red]" "[/color][color=Black], #[/color][color=Purple]b0 [/color][color=Blue]) [/color][color=Green]; for simulation only[/color]
[color=Blue]pause [/color][color=Navy]250[/color]
[color=Blue]serout txpin[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]( [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]203[/color][color=Black], [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]203[/color][color=Black], [/color][color=Red]" "[/color][color=Black], #[/color][color=Purple]b1 [/color][color=Blue]) [/color][color=Green]; transmit ascii character reading to oled[/color]
[color=Blue]pause [/color][color=Navy]30[/color]
[color=Blue]serout c.0[/color][color=Black], [/color][color=Blue]n2400[/color][color=Black], [/color][color=Blue]( [/color][color=Navy]254[/color][color=Black], [/color][color=Navy]203[/color][color=Black], [/color][color=Red]"  0" [/color][color=Blue]) [/color][color=Green]; for simulation only[/color]
[color=Blue]pause [/color][color=Navy]250[/color]
[color=Blue]goto [/color][color=Black]mainloop[/color]
 

hippy

Technical Support
Staff member
The NKM2401 expects data in sets of 8 bytes, and where a # is specified to format a byte variable in a SEROUT command this may output between 1 and 3 bytes. This could be leading to some data later being corrupted, lost or things getting out of sync.

The best solution to this problem is usually to use the BINTOASCII command to split a variable into its component digits and send those, thus ensuring 8 bytes are passed to the NKM2401 in every packet.
 

RonnS

Member
I have a similar problem, axe213 reciver over a axe118 to handle data, connect will work very well with the LCD
...the same connection AX 213 receiver via axe118 to the oled produces garbage, !! same connection with an LCD is OK !!

the curiose is: It is enough only pin IN and Ground to connect to powered it on (the oled)

my question :does anyone know this problem and what can I do ?
 
Last edited:

hippy

Technical Support
Staff member
my question :does anyone know this problem and what can I do ?
It does seem odd that it works with an LCD but not with an OLED. If using a serial to LCD/OLED module then there should be no difference in behaviour and connecting 0V/ground and IN is all that is required along with power.

Perhaps you could clarify what you are using to drive the LCD and OLED; an AXE133/AXE133Y module or something else.
 

RonnS

Member
thaks hippy for your fast answer

Yes i know thats no difference in connecting these parts.. i tested it with an LCD axe 133, a axe133y OLED and an axe033 OLED with Clock upgrade.. only the LCD works....

and : its enough to connect the power line OLED -AXE118-AXE213 to block the reciver !
 

hippy

Technical Support
Staff member
Thanks for the link. What size OLED display are you using; 16x2, 20x4 ?

I am not sure if there is much more to suggest beyond what was discussed in that thread. It would be worth double-checking the OLED display works when driven directly by your 20M2 ( not using data received from the AXE213 ) and trying the things which were suggested in that thread. Unfortunately that thread never got to the bottom of what the problem was.
 
thanks hippy changing my code to use bintoascii fixed that problem and now both readings are displayed. I have not tried my setup with a lcd as i dont have one to try, but i do get lots of random garbage displayed at different times that messes up my display that i had put down to my test rig for now but maybe if anything comes out of RonnS problem i will look into trying a lcd display
 

RonnS

Member
Thanks for the link. What size OLED display are you using; 16x2, 20x4 ?

I am not sure if there is much more to suggest beyond what was discussed in that thread. It would be worth double-checking the OLED display works when driven directly by your 20M2 ( not using data received from the AXE213 ) and trying the things which were suggested in that thread. Unfortunately that thread never got to the bottom of what the problem was.
thanks...

i use the axe118 with a 20x2 ............ the connection without the axe213 works correct!
i use a 16x2 Oled and a 16x2 LCD
 

RonnS

Member
still I have use a capacitor of 100nf and 100myf, as well as a coil of about 35myH to electric noise to suppress in the V + line but with no effect

PS: sorry for my english speaking i hope you understand..
 

RonnS

Member
i can`t beleve that nobody have tested these conection...i think i shoud tell more abot my little projekt
first a Pic to hippy : a line in powered OLEDP1010042.JPG

it is only conected with LineIn and V+
 

hippy

Technical Support
Staff member
first a Pic to hippy : a line in powered OLED

it is only conected with LineIn and V+
This is commonly called 'parasitic powering'. The internal electronics of components create a circuit which is other than it would at first glance appear to be. While things may appear to work they will not be working within specification.
 

RonnS

Member
i know, but the great problem is these conection with an Axe213 (reciver) and an oled
eventually may be somebody from Rev.Ed. test these
 

Technical

Technical Support
Staff member
There is nothing more to test! The units do work correctly when wired correctly, that is what we test.
There are dozens of others ways to wire incorrectly, all of which may give you very strange and/or damaging behaviour.
 

RonnS

Member
There is nothing more to test! The units do work correctly when wired correctly, that is what we test.
There are dozens of others ways to wire incorrectly, all of which may give you very strange and/or damaging behaviour.
thats not the reason i ask here, the reason is that It is not possible to connect a OLED with the axe213 Module, you know that
 
Of course it's possible connect an axe213 to an OLED e.g. Axe133Y
Both communicate seriel.
I think your problem is exclusively your programming.
Others can do it , too.
 

srnet

Senior Member
It is not possible to connect a OLED with the axe213 Module, you know that
I am not sure how you can say its not possible, even though you cannot apparently get it working.

The serial OLED and serial LCD use the same design of board to interface between the serial and the display, so if the LCD works and the OLED does not, it suggests a problem with the OLED board or how its connected.

If you take the RF link out of the picture, can you drive the OLED display direct with a PICAXE without error ?
 

Technical

Technical Support
Staff member
The main issues here are lack of information, you have posted a picture of a completely incorrectly wired circuit in post 11 (no 0V connection) and then state other things don't work?

Please wire the modules correctly (with 3 wires, 5V, 0V and serial data) and take a photo to show how it is wired, and also post the exact full program code you are trying to use.

An AXE133Y and an AXE133 are identical apart from the display itself. The PICAXE code should work exactly the same on each. If one works and the other doesn't it indicates an issue with the module or the power supply.
 

RonnS

Member
I am not sure how you can say its not possible, even though you cannot apparently get it working.

The serial OLED and serial LCD use the same design of board to interface between the serial and the display, so if the LCD works and the OLED does not, it suggests a problem with the OLED board or how its connected.

If you take the RF link out of the picture, can you drive the OLED display direct with a PICAXE without error ?
i have tested all opportunities it doesnt work, some pictures will follow
 
Last edited:

srnet

Senior Member
i have tested all opportunities it doesnt work,
Not sure what that means, so what is the answer to the specific question;

"If you take the RF link out of the picture, can you drive the OLED display direct with a PICAXE without error ?"
 

RonnS

Member
the same with an LCD

P1010016.JPGP1010017.JPG

it shows the correctly temperature an the battery voltage.. and the messages
 
Last edited:

hippy

Technical Support
Staff member
@ boomboommagic, RonnS

Just a polite reminder that we like to keep this forum friendly and a welcoming place for all members so, while constructive criticism is welcomed, antagonism and conflict is not.
 

srnet

Senior Member
The pictures appear to show two completely different and separate setups and wiring ?

So on the second LCD setup, the one mounted on the bits of perspex, what happens if you plug the OLED onto the cable thats connected to the LCD ?

We are easily confused........
 

RonnS

Member
hallo..,

i have modified the OLED Firmwarecode , i insert a sequence to put off the internal power-transverter to the OLED init subroutine

sequence:
Code:
#rem  insert sequence to put internal power off
the OLED works with reduced brighness at 5,2V, the NKM Module recived all groups of data , seen at led from the sending an reciving module are syncronous

#endrem 
let pinsB = %00010011   ; Cursor/Display Shift/Mode/ Pwr
pulsout enable,1
the different part of Code:
Code:
[color=Navy]#ifdef [/color][color=Black]use_OLED
      [/color][color=Green]; Winstar OLED Module Initialisation
      ; according to WS0010 datasheet (8 bit mode)

      [/color][color=Blue]pause [/color][color=Navy]500               [/color][color=Green]; Power stabilistation = 500ms

      ; Function set - select only one of these 4 character table modes
      ;let pinsB = %00111000  ; 8 bit, 2 line, 5x8 , English_Japanese table
      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00111001   [/color][color=Green]; 8 bit, 2 line, 5x8 , Western_European table1
      ;let pinsB = %00111010  ; 8 bit, 2 line, 5x8 , English_Russian  table
      ;let pinsB = %00111011  ; 8 bit, 2 line, 5x8 , Western_European table2
      
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1        [/color][color=Green]; 
            
      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00001100   [/color][color=Green]; Display on, no cursor, no blink
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1  

      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00000001   [/color][color=Green]; Display Clear
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1
      [/color][color=Blue]pause [/color][color=Navy]7                 [/color][color=Green]; Allow 6.2ms to clear display
      
      
      
     
      [/color][color=Blue]setfreq m16             [/color][color=Green]; now change to 16Mhz

      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00000010   [/color][color=Green]; Return Home
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1
      
      [/color][color=Green]#rem  insert sequence to put internal power off
      the OLED works with reduced brighness at 5,2V, the NKM Module recived all groups of data , seen at led from the sending an reciving module are syncronous
      #endrem 
      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00010011   [/color][color=Green]; Cursor/Display Shift/Mode/ Pwr
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1
      
      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00000110   [/color][color=Green]; Entry Mode, ID=1, SH=0
      [/color][color=Blue]pulsout enable[/color][color=Black], [/color][color=Navy]1
     

#else 
      [/color][color=Green]; Standard LCD Module Initialisation
      [/color][color=Blue]pause [/color][color=Navy]15                [/color][color=Green]; Wait 15ms for LCD to reset.

      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00110000   [/color][color=Green]; 8 bit, 2 line
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1        [/color][color=Green]; Send data by pulsing enable
      [/color][color=Blue]pause [/color][color=Navy]5                 [/color][color=Green]; Wait 5 ms
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1        [/color][color=Green]; Send data 48 again
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1        [/color][color=Green]; Send data 48 again
      
      [/color][color=Blue]setfreq m16             [/color][color=Green]; now change to 16Mhz

      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00111000   [/color][color=Green]; LCD  - 8 bit, 2 line, 5x8  
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1
                  
      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00000001   [/color][color=Green]; Clear Display
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1  
      [/color][color=Blue]pause [/color][color=Navy]8                 [/color][color=Green]; 8 = 2ms at 16MHz
      
      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00000010   [/color][color=Green]; return home
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1

      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00000110   [/color][color=Green]; Entry mode
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1  
      [/color][color=Blue]pause [/color][color=Navy]1                 

      [/color][color=Blue]let [/color][color=Purple]pinsB [/color][color=DarkCyan]= [/color][color=Navy]%00001100   [/color][color=Green]; Display on, no cursor, no blink
      [/color][color=Blue]pulsout enable[/color][color=Black],[/color][color=Navy]1  
#endif
      
      [/color][color=Blue]high rs                 [/color][color=Green]; Leave in character mode
      [/color][color=Blue]return[/color]
i think this problem is resolved

P1010020.JPG
 
Last edited:

RonnS

Member
ok this works with an axe 133y very well.!. but what can i do to connect a axe033y with rtc upgrade..? this driver chip is not programmable... some help is needed

Ron
 

RonnS

Member
its goin the way,--- just in time the axe033 board + OLED is alive with an 18m2 chip! next i will build in the cklock read and write routine , if it is finishd i will post the code and some pic´s :)
 
Last edited:

RonnS

Member
.. it looks simple but is was some difficult for me..
result : RTC and my "headline" on the OLED and axe033 PCB with an 18M2 chip

thanks to mark for his tutorial to drive an LCD, thanks nick12ab for his hack the PCB

View attachment AXE033Y_OLED_18M2.txt

its an working "serin" possible ?

RonS

postscriptum : the OLED used only about 5 ma at 5V in this mode !!
 
Last edited:
Top