|
bladox.com Turbo SIM Toolkit Adapter Forums
|
View previous topic :: View next topic |
Author |
Message |
rhamel Guest
|
Posted: Thu Oct 05, 2006 1:11 am Post subject: Need to output a LOUD tone |
|
|
Pavel,
thanks so much for your help so far. The client is very comfortable with the application. Only thing is that I need to output a LOUD tone on confirmation that the SMS has been successfully sent.
I'm using
play_tone ("SCAN OK", TONE_POSITIVE, DURATION_SEC, DEF_PLAY_DURATION);
but it's not loud enough. How do I get a LOUD confirmation beep?
Thanks for any help you can give.
Richard |
|
Back to top |
|
|
pz Guest
|
Posted: Fri Oct 06, 2006 10:18 am Post subject: |
|
|
What phone is it? It really depends on vendor. On some nokias we used TONE_RADIO_NO or TONE_BEEP and it was quite loud. Some phones ignore duration and it's good just to repeat play_tone() several times. |
|
Back to top |
|
|
pz Guest
|
Posted: Fri Oct 06, 2006 6:02 pm Post subject: |
|
|
Maybe you could also connect a beeper to some output? Then you can make really huge noise. |
|
Back to top |
|
|
rhamel Guest
|
Posted: Mon Oct 16, 2006 11:37 pm Post subject: How do I connect a beeper? |
|
|
If I solder the beeper which has 2 wires, one wire to P6 and the other to GND, will that work?
Can you point me to some sample code to turn it on and off, please?
Thanks in advance,
Richard |
|
Back to top |
|
|
pz Guest
|
Posted: Wed Oct 18, 2006 7:26 am Post subject: |
|
|
You will connect beeper between VCC and some port Px. You need 3v beeper, e.g. kpe212 23x16mm. When you set Px to zero it will beep.
You could also use something bigger with external power and use one of the opto isolated outputs to turn it on.
As for code - I would recommend to install pager application for testing. All code is there. Or you can find it in autoalarm.c
You need to:
1. select what port/output to use
2. in your code set it to be output - only once during init
3. set it 0/1
In autoalarm.c look for e.g. ALARM_OUT_BLOCK or ALARM_OUT_AIRCON (not the _EVO_ ports, these are for opto isolated outputs). |
|
Back to top |
|
|
rhamel Guest
|
Posted: Thu Oct 19, 2006 4:03 am Post subject: Am I doing this right? |
|
|
I soldered an LED into the VCC and P4. The client gave me a LED to test it with. I hope it doesn't make a difference using a LED instead of a buzzer.
When I scan, I use a multimeter to test the voltage between the LED and each of the holes P1 -> P13.
I notice a 2.97 volt difference between P9 after I scan, but 0.0 volt before I scan. Is this significant? Why is P9 responding? Shouldn't it be P4?
My code looks like
Code: |
//================
// my LED is on P4
//================
#define ALARM_OUT_AIRCON_DDR DDRC
#define ALARM_OUT_AIRCON_DDR_PIN DD4
#define ALARM_OUT_AIRCON_PORT PORTC
#define ALARM_OUT_AIRCON_PORT_PIN PORT4
void init_alarm_pins ()
{
sbi (ALARM_OUT_AIRCON_DDR, ALARM_OUT_AIRCON_DDR_PIN);
asm __volatile__ ("nop"); //wait
sbi (ALARM_OUT_AIRCON_PORT, ALARM_OUT_AIRCON_PORT_PIN);
asm __volatile__ ("nop"); //wait
}
void set_ac_on ()
{
cbi (ALARM_OUT_AIRCON_PORT, ALARM_OUT_AIRCON_PORT_PIN);
asm __volatile__ ("nop"); //wait
}
.
.
.
case ACTION_APP_INIT:
pers_mem = app_data(); // init app's data??
init_uart2i2c (MY_SLAVE_ADDRESS);
//===================================
//
// set baud rate to 9600
//
//===================================
uart2i2c_write_ubrr(51);
//==================================
//
// init alarm pins
// supposed to prime LED pin for use
//
//==================================
init_alarm_pins();
break;
.
.
.
//============================
// this is where I send the SMS and want the LED to light up
//============================
r = send_sms (barcode, nr_chars, fone, MSISDN_ADN, PARAMX, 0, NULL, NULL);
set_ac_on();
.
.
|
Thanks again,
Richard |
|
Back to top |
|
|
pz Guest
|
Posted: Fri Oct 20, 2006 8:00 am Post subject: Re: Am I doing this right? |
|
|
rhamel wrote: | I soldered an LED into the VCC and P4. The client gave me a LED to test it with. I hope it doesn't make a difference using a LED instead of a buzzer.
|
LED is fine.
Quote: |
When I scan, I use a multimeter to test the voltage between the LED and each of the holes P1 -> P13.
I notice a 2.97 volt difference between P9 after I scan, but 0.0 volt before I scan. Is this significant? Why is P9 responding? Shouldn't it be P4?
|
No, there is no relation between notations of Px ports and PORT4&so, which are ports of MCU itself. What you defined is P9 on Turbo Lite ports, OUT_USER4 as denoted in Auto Alarm.
in set_ac_off() use "sbi", i.e set_beep_on(), somedelay(), set_beep_off().
That's it.
Anyway I recommend to upload pager app just to test your circuits, soldering and then port the code. Pager is nice |
|
Back to top |
|
|
rhamel Guest
|
Posted: Fri Oct 20, 2006 5:14 pm Post subject: Ok, now it's working |
|
|
Ok, I soldered the LED to VCC and P9. Now, it turns on just as I need it.
Thanks so much for your help, Pavel.
Richard |
|
Back to top |
|
|
rhamel Guest
|
Posted: Mon May 14, 2007 10:50 pm Post subject: Need to know if the charger is disconnected |
|
|
Pavel,
The client is concerned that someone may accidentally or deliberately disconnect the charger from the phone.
Since our app polls continuously, the charger is essential.
How can we know if the charger becomes disconnected from the phone?
Does the phone communicate this to the Turbo board?
Do you have sample code that detects a disconnected charger?
He wants the board to send an SMS if the charger is disconnected.
Please advise. Thanks.
Richard |
|
Back to top |
|
|
pz Guest
|
Posted: Thu May 17, 2007 7:55 am Post subject: |
|
|
Unfortunately there is no such info from phone but you could monitor the charger on one of the inputs, i.e. no voltage -> no chrager -> report. |
|
Back to top |
|
|
rhamel Guest
|
Posted: Sun May 27, 2007 7:16 pm Post subject: Monitoring charger disconnection |
|
|
Pavel,
to which of the inputs should I connect the charger?
I noticed in turbo_lite_2-r01050902.pdf, on page 4 of 6, the warning
"Imax of one port is 10mA, overall current should not higher tham 50mA - limitation depends on mobile phone used."
This concerns me because the charger outputs 5.7V @ 800mA. I don't have any charger which outputs less that 3.7V @ 340mA, which still seems to be too high according to the warning.
My knowledge of electronics is non-existent (I'm just a programmer), so do I need to use some kind of resistor between the charger and the Turbo Lite 2 board?
I was thinking of connecting one wire from the charger to P8 and the other to GND on the board. Is this the correct thing to do? I'm very nervous of burning out the board.
Also, if I do connect the wires to P8 and GND, do you have any sample code you can point me at, which will allow me to monitor the current coming in to the board? Which will allow me to send an SMS when the current fails?
I already know how to send the SMS, but I am not sure how to monitor the current.
Thanks for your support,
Richard |
|
Back to top |
|
|
pz Guest
|
Posted: Tue May 29, 2007 9:58 am Post subject: |
|
|
Use the opto isolated input, you have 2 of them. Look into Pager v2 datasheet for details. You can connect it directly - in the worst case you will damage the optocoupler but you have two You might to use 1k resistor but shouldn't be neccessary.
The 10mA warning is for P1-P13, which go directly to mcu, no protection.
As for sample code - use the pager-210 source, all is there. You may try this application first to test/read the value. The code is also in AA application. |
|
Back to top |
|
|
rhamel Guest
|
Posted: Sat Jul 07, 2007 3:46 pm Post subject: New problem |
|
|
Pavel, I have a problem loading apps using the programmer.
Earlier this morning, I WAS able to load two apps, but now it does not load.
When I run prog_apps, I get the output :-
<pre>
adc > prog_apps
Programmer kernel version: 3.1.0
Programmer application list:
0: avrprog.trb 3.1.0
1: brum.trb 3.1.0
2: df.trb÷ 3.1.0
3: sim.trb 3.1.0
4: turboadapter.trb 3.1.0
5: df.trb 3.1.0
adc >
</pre>
sim_dump gives
<pre>
SIM mode initialized, sim.trb
SIM_ATR: 3B BB 94 00 40 14 47 47 33 53 33 39 30 53 31 30
FILE: MF 3F00
SELECT 3F00
GET_RESPONSE 00 00 02 B4 3F 00 01 01 00 55 FF 01 0C 91 06 0A 06 00 82 8A 83 8A 00 80 83
Free: 692
#DF: 6
#EF: 10
C13s: 145
#CHVs: 06
CHV1 STS: 82
UNBL CHV1 STS: 8A
CHV2 STS: 83
UNBL CHV1 STS: 8A
Admin: 80 83
FILE: DF 7F10 TELECOM
SELECT 3F00:7F10
GET_RESPONSE 00 00 00 00 7F 10 02 01 00 55 FF 01 0C 91 00 0D 06 00 82 8A 83 8A 00 80 83
Free: 0
#DF: 0
#EF: 13
FILE: DF 5F50 GRAPHICS
SELECT 3F00:7F10:5F50
File Does Not Exist
FILE: EF 6F3A ADN
SELECT 3F00:7F10:6F3A
GET_RESPONSE 00 00 19 00 6F 3A 04 01 11 F0 22 05 02 01 20
Linear file
Size: 6400
Access: 11 F0 22
Status: 05
</pre>
and continues all the way to Record 100 and more when it sticks.
When I attempt to clear apps with 'cemu --rm-apps', I get
<pre>
hello_world > cemu -v --rm-apps
Initializing device
Device initialized
Entering Application Mode
Application Mode entered
SIM mode initialized, sim.trb
SIM_ATR: 3B BB 94 00 40 14 47 47 33 53 33 39 30 53 31 30
</pre>
and it stays at that point. The SIM led on the programmer remains ON and I have to remove the USB cable from the programmer to clear it.
Attempting to load an apps with 'cemu --app helloworld.trb' produces
<pre>
hello_world > cemu --app helloworld.trb
SIM mode initialized, sim.trb
SIM_ATR: 3B BB 94 00 40 14 47 47 33 53 33 39 30 53 31 30
</pre>
and it stays at that point. The SIM led on the programmer remains ON and I have to remove the USB cable from the programmer to clear it.
I have tried it with a different SIM but had the same response.
I can upload and remove modules to/from the programmer without any problem.
Can you help me, please? Thanks.
Richard |
|
Back to top |
|
|
rhamel Guest
|
Posted: Sat Jul 07, 2007 4:06 pm Post subject: Grrr! |
|
|
Belay that last post.
All of a sudden the friggin' thing starts working again! This is not good for my blood pressure. |
|
Back to top |
|
|
pz Guest
|
Posted: Mon Jul 09, 2007 10:46 am Post subject: |
|
|
Good it recovered before I could answer. My recommendation would be to reflash TM2 kernel. But maybe it's some wrong contact? |
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|