jhsa wrote:I don't know where Flybabo is but if he is in Europe I could send him an RTC module. This one is working really well on my Ar9x board.. the other point is, if later people would like to upgrade their radio to the Ar9x board, they wouldn't have to buy another RTC.
João
[LOOOONG]
I'm far from Europe and living in the heart of Silicon Valley as shown in the right hand side of my posting under country and location.
As a matter of fact, my work place is not far from Maxim Semiconductor where those RTC chips had developed.
Thanks for the offer but I already have two DS3231 modules for my AR9Xs.
Of course I considered to use it for this project along with an SPI compatible RTC module but quickly ruled out both because I2C bus pins (PC4,PC5) are already taken for volume control in MegaSound card and the price of the SPI RTC module.
I may use other pins by implementing a bit-banging I2C protocol but it takes more flash space.
Even after harvesting more than 1KB flash out of original amod328 code by optimizing/restructuring the code, not much flash bytes left now.
Actually, some features I'd implemented no longer fit on it. (There's another hacky way to reduce the flash bytes but I'll reserve it for the future.)
I also find out that DS1302 is pretty accurate as well. It's as good as a digital alarm clock in my bedroom and I think it's good enough for a hobby radio. I even considered setting RTC if GPS time is available on the telemetry and I don't think it's necessary.
Let's stop talking about DS3231 at least for now as I have more important things to worry about.
As for the pin names, I think EXT1/EXT2 notation even more confusing.
You only see the pin names under Hardware menu and, IMHO, all the resource names under this menu must reflect the pin names defined in the datasheet.
Current pin names of interests are:
M64/128/2561 pins:
- PB7: Backlight control pin for onboard backlight like 9XR board or used for parallel MegaSound. Can be used as a switch source if it's not used.
PC0: Used for rerouting LV trim UP or as a switch source
PC1:(LCD_CS1): Used for rerouting LV trim DOWN or used as a switch source. Need to remove 5K level-shifter resistor to use this pin.
PC4:(LCD_WR): Used for serial LCD interface for custom radio or used as a switch source. Need to remove 5K level-shifter resistor to use this pin.
PC6: Rerouted TCut for FrSky telemetry mod. Can be used as a switch source if no FrSky mod.
PC7: Rerouted AILDR for FrSky telemetry mod. Can be used as a switch source if no FrSky mod.
PG2: Used for haptic mod. Can be used as a switch source if no haptic mod.
PG5: Only available for m2561. Can be used as a switch source.
m328 pins: prefix 'X' for external
- XPB0:(EXT2): Used for parallel MegaSound D3 or can be used as a switch source for serial Megasound (cop328).
XPB1: Used as a backlight control for Serial/Parallel MegaSound. If you have an onboard PB7 backlight control like 9XR, it can be used as a switch source after removing a 10K resistor driving backlight control transistor for serial Megasound.
XPB2: SD card chip select pin (/CS1). This pin is shared with DS1302 RTC's CE/RST pin.
XPC0: Used as Busy signal generator for parallel Megasound or an analog channel AX (for a slider) after removing 10K resistor connected to XPC0.
XPC1:(X1): Can be used as an analog channel AY (for another slider)
XPC2:(X2): DS1302 RTC's I/O pin
XPC3:(X3): DS1302 RTC's SCLK pin
XPD2: Used as a CLK signal generator for parallel Megasound or can be used as a switch source after disconnecting a resistor and a transistor on the clock generator circuit.
XPD3: Used for parallel-Mega D0 or rerouting TRIM_LV_UP for serial Mega or can be used as a switch source if you rerouted TRIM_LV_UP using onboard PC0 pin.
XPD4: Used for parallel-Mega D1 or rerouting TRIM_LV_DWN for serial Mega or can be used as a switch source if you rerouted TRIM_LV_DWN using onboard PC1 pin.
XPD7:(EXT1): Used for parallel-Mega D2 or can be used as a switch source.
XADC6/XADC7: Only available for TQFP type m328p found on most Arduino boards. Can be used as sources of analog channel AX/AY. Selectable from hardware menu.
Following 5 switches can be used as 3-pos switches in addition to ID0/1/2 by assigning aforementioned switch sources:
THR->(TH^,TH-,THv), RUD->(RU^,RU-,RUv), ELE->(EL^,EL-,ELv), AIL->(AI^,AI-,AI-), GEA->(GE^,GE-,GEv)
Two push buttons, PB1 and PB2 can be assigned from the same list of the switch sources.
The switch source list only shows available ones based on the current state of hardware mod and the firmware doesn't check the duplicated assignments to conserve the flash bytes.
Two external ADC channels, AX and AY are internally assigned to pots PX and PY.
AX and AY are shown up in ANADIAG page and PX and PY are listed on the mixer source list.
I connected left slider and right slider to PX and PY, respectively.
PX and PY can be calibrated through current calibration menu and their movement is displayed on the updated main graphics.
You can turn-on/off external ADC channels through updated hardware menu.
About Arduino board, best choice is 5V-20MHz board but I couldn't find it on eBay.
My current setup runs in 5V-20MHz on Matin's MegaSound board and I wouldn't see any problem in 5V-16MHz Arduino - I'm going to try sooner or later.
Current serial MegaSound (3.3V-12MHz) should work as well.
I have a group of "oldies" computerizing the vintage transmitters - there're more than you and me
Since it's inevitable to do "fine" soldering if one wants to use m64/128/2561 pins for the switch sources, my preferred mod is rerouting LV trim locally using PC0/PC1 and putting back onboard backlight using PB7 and consolidate all the switch sources to the voice card. I'm using onboard backlight control for flashing when SD bootloader downloads 9x firmware from cop328's SD card.
Note that if you're using Optiboot/PC for firmware update, you need to reroute LV_TRIM on the serial voice card because you need to get into bootloader mode and LV trim switch does this.
Since I'm using the new SD bootloader to update cop328 firmware, I don't need to control the voice card to get into bootloader mode. Actually, SD bootloader turned out to be very handy during development. All I have to do is copy the new firmware file to SD card and insert it and power-up. It took about 3 second to update the cop328 firmware. But choice is yours.
[CHANGING THE SUBJECT]
Actually, there's one thing you can help me:
I'm using voice file number 59 and 60 as the cop328 commands to talk time of date if there's an RTC hardware: (59->date+time, 60->time only).
I propose following additional voice files for this purpose:
501-531: first, second, ..., thirty first.
533-544: January, February, ..., December.
545: (pre)AM
546: (pre)PM
547: hour-min separation
548: (post)AM
549:(post)PM
550-561: twelve, one, two, ..., eleven
600-659: zero or o'clock, one, ..., fifty-nine
Voice command 59 plays the following sequence:
{533-544}{501-531}{545/546}{550-561}{547}{600-659}{548/549}
I believe that this sequence covers most languages.
Not all the files are necessary. It depends on the language it speaks.
In English, it will talk like: December-Fourth-Two-Thirtyfive-PM.
No need for {545/546} and {547}.
If there're no such files exist (current setup), it just plays the current time using file number between 400-459.
I programmed PB2 as a voice switch 60 and whenever I press the PB2, it talks time like "twelve-forty-nine" without much intonation change.
That's the one additional way to use the RTC other than time stamping and I wonder whether you can help to create those files.
Have a nice weekend,
HT