Fx-9860 Timers And Hardware
#1
Posted 10 March 2007 - 07:22 AM
#2
Posted 10 March 2007 - 11:31 AM
#3
Posted 10 March 2007 - 12:17 PM
#4
Posted 10 March 2007 - 12:28 PM
only day i do not understand, ok it is the sixth day but it does not ask for the daynumber (the tenth for today)
I've got this probem to.
#5
Posted 10 March 2007 - 12:39 PM
#6
Posted 10 March 2007 - 12:41 PM
#7
Posted 10 March 2007 - 12:42 PM
i know saturday is the sixth day, but you cannot set the day of the month, wich for today is the tenth day....get what i mean
saturday 10 march
it now says it is month three, day 6, while it is month 3 day 10 daytype 6
#8
Posted 10 March 2007 - 03:09 PM
If you tried out my CLOCK program: http://www.casiocalc...clock-utility-f You would see that it's possible to access the fx-9860 hardware. My CLOCK program accesses the fx-9860's built-in RTC. I figured out the addresses of the serial port, RTC and the SH3 timers. I think I can now create grayscales using the SH3 timers by flickering the screen at a fast frequency (about 32KHz). Very fast that the human eye won't notice it. I'll release a demo of the accessing serial port very soon. Maybe then I could use my fx-9860 to transfer programs into my Algebra FX without having to buy a serial cable. What do you guys think?
Can you still use the built-in debugger?
#9
Posted 10 March 2007 - 04:58 PM
only day i do not understand, ok it is the sixth day but it does not ask for the daynumber (the tenth for today)
The fx-9860 does not keep track of which day it is in a month. Insteads it uses 0-6 to correspond with the day of the week.
This problem is not mentiont in de read me file. This is a bug.
It is not a bug. Again, the fx-9860 does not keep track of days in a month. It keeps track of which day in a week. 0-6 for Sunday-Saturday. It says that in the README file.
Can you still use the built-in debugger?
Maybe, I'll have to check.
#10
Posted 10 March 2007 - 06:42 PM
#11
Posted 10 March 2007 - 08:05 PM
No, but there is another problem, if you want to set the time, you don't see some options.
Ok, I released a new version. It now supports years and fixes some bugs.
#12
Posted 10 March 2007 - 11:06 PM
What are the port numbers you read? Maybe it works like the AFX...
#13
Posted 11 March 2007 - 02:20 AM
if it's like in the AFX2 there is another serial port where you can read the number of days elapsed since the RTC was first turned on, with this you can compute months and days... That's what I did in TOUCHE for the AFX.
What are the port numbers you read? Maybe it works like the AFX...
Well, the fx-9860 uses a SuperH processor, while a Algebra FX uses a 80186 compatible. The RTC is built into the CPU, and I don't think it keeps track of what you said. But it doesn't matter, I figured out how to implement the day of the month (I found the address). I release a new version of my CLOCK utility soon.
For fx-9860 developers, don't worry, I'm linking together all of my functions (accessing USB, serial port, timers, etc.) together into a library so other people can access the hardware level. Basically, I'm rewriting the SDK.
EDIT: Ok, I released a new version of CLOCK, v1.02. Now it supports dates (day of the month) and years (detects leap years). Also the display is cleaned up so it looks a bit nice. I was looking at how many clicks, wow, over 30 clicks in a day.
#14
Posted 11 March 2007 - 05:54 AM
it would be great if it could be used by others too, an agenda would be so nice...
also it is nice in games to show played time and so on... For my work this feature is also very usefull, we use time as one of our parameters, we have radio controlled watches but we tend to forget them sometimes, now we have a watch with us on our calculator.... this is quite handy
Edited by 2072, 11 March 2007 - 07:30 AM.
useless quote removed
#15
Posted 11 March 2007 - 06:09 AM
great work man
it would be great if it could be used by others too, an agenda would be so nice...
Glad to hear that. I'll try to finish the SDK soon.
#16
Posted 11 March 2007 - 07:45 AM
For more infos about SH assembly, look at here http://www.renesas.c...e...ation&lid=6
#17
Posted 11 March 2007 - 08:50 AM
haha, i've used the timer to procedure grayscale but in the PC it doesnt works
Well, if it doesn't work on the PC, then how do you know it's actually creating greyscales? Timers alone won't get you greyscales. You have to make use of interrupts and program them which you didn't mention.
Now what I need is direct control of the DD (Display Driver), not VRAM. Each time a interrupt is called (which is called at a specific frequency), I copy the next buffer (multiple buffers which determine the grayscaled image result) directly to the screen. I'm still looking though how to write directly to the DD.
#18
Posted 11 March 2007 - 09:30 AM
#19
Posted 11 March 2007 - 04:50 PM
if you need the weekday of a date, this function can be usefull:
function weekday(y,m:word):word; var j,c,w:word; begin if m<3 then begin inc(m,12); dec(y); end; j:=y mod 100; c:=y div 100; w:=(6+((m+1)*13 div 5)+j+j div 4+c div 4+5*c) mod 7; weekday:=w; end;
#20
Posted 11 March 2007 - 05:15 PM
" Timers alone won't get you greyscales." Yes, but it prevent flicked.
Lol , again, how would you know that if it doesn't work in the emulator? I guess it's possible, but only very, very, very few pixels can be used for grayscales just using timers alone. Current drawing functions are too slow since they are memory mapped which is the main cause of flickering. Having direct access of the LCD will provide the fast speeds neccessary to have grayscales.
Hi kucalc,
if you need the weekday of a date, this function can be usefull
Thanks Xerxes, but I already figured out how to get the date (day of the month) and years. Download CLOCK again from the File Sharing. Also the display is a bit cleaned up.
#21
Posted 12 March 2007 - 01:51 PM
If you are not setting the time, you can't exit by pressing MENU' /> . Only by pressing . The opposite would be more consistant with the rest of the calc.
What is a real bug, is that (maybe because of the first bug ?), if you exit Clock, you can't go back by directly pressing EXE' /> . you have to enter another part, exit it and then you get back your access to Clock...
Anyways, good work. 2 thumbs up.
#22
Posted 12 March 2007 - 03:27 PM
#23
Posted 12 March 2007 - 03:51 PM
SetQuitHandler( );
but i cannot get it to work
should read some more about quiting applications in C
it seems the Return 1 is still in 1 mode after exit
kucalc, vanhoa anyone?????
#24
Posted 12 March 2007 - 03:57 PM
1./. exit AddIn_main by return; //Note:AddIn_main isnt the first function or the last function that is called when your addin is called.
2./. Use GetKey();
The first way may cause some crash.
The second way is not good for game. //I used a methol to solve this problem but it only work on the emu, not on the calc (Lites and RushHour)
i think that has something to do with
SetQuitHandler( );
but i cannot get it to work
void save(){
//Save your infos (for example: hi-score,current application status,...)
}
int AddIn_main(int isAppli, unsigned short OptionNum)
{
...
SetQuitHandler(save);
...
}
#25
Posted 12 March 2007 - 04:17 PM
There is 2 way to exit (as i know so far)
1./. exit AddIn_main by return; //Note:AddIn_main isnt the first function or the last function that is called when your addin is called.
2./. Use GetKey();
The first way may cause some crash.
The second way is not good for game. //I used a methol to solve this problem but it only work on the emu, not on the calc (Lites and RushHour)
void save(){
//Save your infos (for example: hi-score,current application status,...)
}
int AddIn_main(int isAppli, unsigned short OptionNum)
{
...
SetQuitHandler(save);
...
}
so it is more for functions to be carried out when quiting
does it work on every type of quit?
i still find the bug very annoying, you have to run another app to re-run a first application
should there be a solution to start a dummy application when exit an application?
like: while 1==1, do something, return 1,
#26
Posted 12 March 2007 - 07:09 PM
- If you adjust the hours by decrementing, the displayed time is not correct.
- It is possible to set month and date to zero and minutes and secounds to 60.
#27
Posted 12 March 2007 - 11:40 PM
The last "bug" is white every add-in, I think it is a but in the SDK.
Yes, that bug is not because of the programmers fault, but because of the SDK. But I have a solution, it will be in the future release of EPSILON, to reset the portion of memory used by the add-in.
I have downloaded the program again but the program still doesn't know the right weekday automatically
You have to set the correct settings yourself first. The fx-9860 doesn't "automatically" detect the correct weekday.
#28
Posted 13 March 2007 - 01:48 AM
When in clock, you can't swich the calc off
#29
Posted 13 March 2007 - 02:01 AM
GetKey and IsKeyDown(Up)
GetKey will allow you to turn off you calculator while running a add-in, but at a cost. GetKey PAUSES the calculator until you press a key.
IsKeyDown (and IsKeyUp), this is what I'm using, does not allow you to turn off your calculator. But, it does not pause the calculator. It checks at that instant when the function is called if the key is pressed down.
You see, if I use GetKey you can then turn off your calculator, but you then have to press a key every second to keep the CLOCK running because GetKey pauses the program until you press a key.
#30
Posted 13 March 2007 - 04:55 AM
#31
Posted 13 March 2007 - 05:02 AM
#32
Posted 14 March 2007 - 08:16 AM
#33
Posted 14 March 2007 - 10:11 AM
exit(0); is not working to quit a program?
#34
Posted 14 March 2007 - 10:50 AM
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users