OLED and Freq

the old fart

Senior Member
Hi Guys,

expect this is easy, for those who know.


Chip 20X2
OLED AXE 134Y
Pin A.0


I've a program that switches between 4Mhz,8Mhz,16Mhz and 32Mhz.

I can output to oled:

@8Mhz serout a.0,N2400,(245,128,"sample 8Mhz")

@16Mhz serout a.0,N1200,(245,128,"sample 16Mhz")

I can't get 4 or 32 Mhz to work,

I've read about N2400_4 etc, but nothing works.

TOF
 
Last edited:

jims

Senior Member
Hi Guys,

expect this is easy, for those who know.


Chip 20X2
OLED AXE 134Y
Pin A.0


I've a program that switches between 4Mhz,8Mhz,16Mhz and 32Mhz.

I can output to oled:

@8Mhz serout a.0,N2400,(245,128,"sample 8Mhz")

@16Mhz serout a.0,N1200,(245,128,"sample 16Mhz")

I can't get 8 or 32 Mhz to work,

I've read about N2400_4 etc, but nothing works.

TOF
I've had the same situation with the AXE133Y serial OLED and found that it only works on M4. It skips over other frequencies as if the OLED didn't even exist. Jims
 

Technical

Technical Support
Staff member
8MHz is the default clock on a 20X2, so use either

serout a.0,N2400,(245,128,"sample 8Mhz")

or
serout a.0,N2400_8,(245,128,"sample 8Mhz")

16MHz is twice as fast, which is why default N1200 (expects 8MHz ie N1200_8) x2 = 2400 still works. However it would be better to write
serout a.0,N2400_16,(245,128,"sample 16Mhz")

etc.

 

the old fart

Senior Member
8MHz is the default clock on a 20X2, so use either

serout a.0,N2400,(245,128,"sample 8Mhz")

or
serout a.0,N2400_8,(245,128,"sample 8Mhz")

16MHz is twice as fast, which is why default N1200 (expects 8MHz ie N1200_8) x2 = 2400 still works. However it would be better to write
serout a.0,N2400_16,(245,128,"sample 16Mhz")

etc.

Hi Technical,

opps meant 4Mhz and 32 Mhz not working.


n2400_4 for 4Mhz doesn't work for me.

n2400_32 does not exist .
 

inglewoodpete

Senior Member
Refer to the command summary for SerOut here. (Refer to the bottom-most table.)

However, you will see that it is not possible to output serial using the SerOut command at 1200 baud with the processor running at 16MHz.

The 1200baud option should be available (@16MHz) to you if you use the hSerOut command on the (specific) hSerOut pin. Refer to the hSerSetup command.
 

the old fart

Senior Member
Refer to the command summary for SerOut here. (Refer to the bottom-most table.)

However, you will see that it is not possible to output serial using the SerOut command at 1200 baud with the processor running at 16MHz.

The 1200baud option should be available (@16MHz) to you if you use the hSerOut command on the (specific) hSerOut pin. Refer to the hSerSetup command.
Hi Inglewoodpete,

I found the table in manual2.

baud rate to OLED is N2400.
I can see now why 32Mhz will not work off A.0, needs to be C.0.

Why does the 4Mz n2400_4 not work?
 

hippy

Technical Support
Staff member
Why does the 4Mz n2400_4 not work?
Not sure; it works for me ...

Code:
#Picaxe 20X2
SetFreq M4
Pause 1000
SerOut A.0, N2400_4,( 254, 1 )
Pause 500  
SerOut A.0, N2400_4,( 254, $80 )
For b0 = "A" To "P"
  SerOut A.0, N2400_4, ( b0 )
  Pause 500  
Next
 

the old fart

Senior Member
Not sure; it works for me ...

Code:
#Picaxe 20X2
SetFreq M4
Pause 1000
SerOut A.0, N2400_4,( 254, 1 )
Pause 500  
SerOut A.0, N2400_4,( 254, $80 )
For b0 = "A" To "P"
  SerOut A.0, N2400_4, ( b0 )
  Pause 500  
Next
Thanks Hippy,
I'll investigate the M4 setup.

I can get readouts if I change back to M8 for the OLED, then revert back to 4 ,32 or even 64MHz.

Don't know if that's acceptable programming, but it works.

TOF
 
Top