Register

Using SH7305 peripheral modules

Discuss anything related to calculators. For specific help on certain games/programs check the Released Projects subforum.
Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Using SH7305 peripheral modules

Postby SimonLothar » Thu Aug 27, 2015 9:08 pm

---
To unlock the serial on a CASIO SH7305 board use

Code: Select all
; set port U   
   mov.l   #h'A4050142, r5 ; PUCR
   mov.w   #h'FFFFFF3F, r4
   mov.w   @r5, r0
   and      r4, r0
   or      #h'40, r0
   mov.w   r0, @r5
   
   add      #h'20, r5 ; PUDR
   mov.b   @r5, r0
   or      #h'C, r0
   mov.b   r0, @r5


This is not a MPU-specific feature, but a board-specific one.

But I'd recommend to use the open- syscall.

---
The SCIF address is the same as with the SH7705: 0xA4410000.
But the register structure is that of the SH7724, which is - if I remember well - slightly different compared to good old SH7705.

Again I'd rather use the syscalls.
I'll be back!

Member
Posts: 27
Joined: Fri Aug 28, 2015 5:10 am
Calculators: Casio fx-9750G PLUS, Casio fx-9750GII (SH4)

Re: Using SH7305 peripheral modules

Postby brickviking » Sat Aug 29, 2015 1:52 am

Incidentally, a related problem I have is: I can't find any on-calc hexviewers, nor any syscalls to read bytes from specific memory addresses. Does such a thing exist? I'm getting a little sick of having to export the image to a computer just so I can view the image in hex (I use MidnightCommander's "View" in hex mode). Looking for Hacksedit got me nowhere as google thought I was mistyping.

I'm also really REALLY new to Casio programming, though I do at least have Casio's SDK, and an upgraded fx9750GII-2 (to 2.04.0201). That seems to work well enough for me, given the CPU's SH4a.

(Post 1)

Regards, BrickViking
Regards, BrickViking

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Using SH7305 peripheral modules

Postby SimonLothar » Sat Aug 29, 2015 7:18 am

brickviking wrote:Incidentally, a related problem I have is: I can't find any on-calc hexviewers

Perhaps this http://www.casiopeia.net/forum/downloads.php?view=detail&df_id=151 will do for a start.

brickviking wrote:..., nor any syscalls to read bytes from specific memory addresses.

You do not need a syscall for that. Pointer operations, t. i. read (RAM,ROM) or write (RAM) from/to memory locations, are basic features of C/C++ as well as assembler.
I'll be back!

Member
Posts: 27
Joined: Fri Aug 28, 2015 5:10 am
Calculators: Casio fx-9750G PLUS, Casio fx-9750GII (SH4)

Re: Using SH7305 peripheral modules

Postby brickviking » Sat Aug 29, 2015 10:54 am

Thanks for that. INSIGHT looks to be sort of what I wanted, though it looks a bit different than I thought it would. It's easy to use at least, so I shouldn't complain.

(Post 3)

Regards, BrickViking
Regards, BrickViking

Senior Member
Posts: 100
Joined: Sun Mar 24, 2013 12:01 pm
Calculators: None

Re: Using SH7305 peripheral modules

Postby TeamFX » Sat Aug 29, 2015 3:11 pm

You have to log in to download this file - is this normal?

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Using SH7305 peripheral modules

Postby SimonLothar » Sat Aug 29, 2015 3:45 pm

TeamFX wrote:You have to log in to download this file - is this normal?

Seems to be default, indeed. I changed it. You see, I am not an uploader pro.
Especially@teamfx: Du wirst in diesem INSIGHT nichts Neues finden.
I'll be back!

Senior Member
Posts: 100
Joined: Sun Mar 24, 2013 12:01 pm
Calculators: None

Re: Using SH7305 peripheral modules

Postby TeamFX » Sat Aug 29, 2015 10:06 pm

Nee, Insight 2.01 muss definitiv besser, schneller und toller sein als Version 2.00!
Nach der Dateigröße zu urteilen, hast du wohl nur die Aufrufe der Untermenüs entfernt. Kann man sicher wiederherstellen...

Senior Member
Posts: 369
Joined: Tue Jan 03, 2012 11:24 pm
Calculators: Casio Afx 1.0, Casio fx-9860GII SD, Casio Classpad 330, Casio fx-CG20, Casio Classpad fx-CP400

Re: Using SH7305 peripheral modules

Postby helder7 » Sun Aug 30, 2015 1:55 am

SimonLothar wrote:Seems to be default, indeed.

This was not supposed to happen (by default). Probably this definition was accidentally overwritten in an update or stopped working. I'll check as soon as possible.
SiO2 + CaCO3 ----------> CaSiO3 + CO2

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Using SH7305 peripheral modules

Postby SimonLothar » Sun Aug 30, 2015 6:18 am

TeamFX wrote:Nach der Dateigröße zu urteilen, hast du wohl nur die Aufrufe der Untermenüs entfernt. Kann man sicher wiederherstellen...

// #define VER201
I'll be back!

Senior Member
User avatar
Posts: 605
Joined: Sat Sep 15, 2012 6:59 am
Location: Krautland ****
Calculators: Casio fx-7400GII, Casio fx-7400GII (SH4), Casio fx-9750GII, Casio fx-9750GII (SH4), Casio fx-9860G, Casio fx-9860G SD, Casio fx-9860G Slim, Casio fx-9860GII SD, Casio fx-9860GII SD Power Graphic 2, Casio Classpad 330 plus, Casio fx-CG20, Casio fx-CG50, Casio Classpad fx-CP400

Re: Using SH7305 peripheral modules

Postby SimonLothar » Sun Aug 30, 2015 8:23 am

lephe wrote:This worked well, but I had to use syscall 0x24a to detect the pressed key since Simon Lothar's method, using CheckKeyRow() (found at the end of this page) did not work properly. And under SH7305-based systems, this syscall enables KEYSC interrupts, which were disabled at initialization because I can't handle them : KEYSC addresses in the SH7724 aren't valid.
CheckKeyRow() is very old. It has been designed for SH7337/SH7355-based systems. Today I would call it experimental, because syscalls are preferable and the ports used in CheckKeyRow() do not exist on a SH7305.

Though the SH7305 uses the same address 0xA44B0000 as the SH7724, the key scan interface is completely different.
The words at 0xA44B0000, 0xA44B0002...0xA44B000A seem to represent the actual hit key status.
The following code example checks for "Ac/On" and "0" pressed simultaneously
Code: Select all
const int keyboard_register = 0xA44B0000;
key = *(unsigned short*)(keyboard_register);
if ( key == 0x4001 ) ...;

Though - as always - I recommend to use the syscalls. Especially in this case because it works for the SH7305 only.
I'll be back!

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 51 guests