Show Posts
Pages: 1 2 [3] 4 5 ... 11
31  Using Arduino / Microcontrollers / Re: ATMEGA 328 watchdog....new bootloader or re-code the actual ? on: May 19, 2012, 11:46:35 am
Hi Nick!!

Was that missing #define, now works great and the uP reset by itself and runs again without any issues, i will let it with the watchdog reset mechanism to test if it reset and restart correctly for a several hours.

Best Regards!
Frank
32  Using Arduino / Microcontrollers / Re: ATMEGA 328 watchdog....new bootloader or re-code the actual ? on: May 18, 2012, 09:00:48 pm
At the bootloader code and makefile i found this:

'-DWATCHDOG_MODS'

making reference to the C code:

Code:
/* main program starts here */
int main(void)
{
uint8_t ch,ch2;
uint16_t w;

#ifdef WATCHDOG_MODS
ch = MCUSR;
MCUSR = 0;

WDTCSR |= _BV(WDCE) | _BV(WDE);
WDTCSR = 0;

// Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot.
  if (! (ch &  _BV(EXTRF))) // if its a not an external reset...
app_start();  // skip bootloader
#else
asm volatile("nop\n\t");
#endif

and the makefile script:
Code:
atmega328_pro8: TARGET = atmega328_pro_8MHz
atmega328_pro8: MCU_TARGET = atmega328p
atmega328_pro8: CFLAGS += '-DMAX_TIME_COUNT=F_CPU>>4' '-DNUM_LED_FLASHES=1' -DBAUD_RATE=57600 -DDOUBLE_SPEED
atmega328_pro8: AVR_FREQ = 8000000L
atmega328_pro8: LDSECTION  = --section-start=.text=0x7800
atmega328_pro8: $(PROGRAM)_atmega328_pro_8MHz.hex

hemm... i'm confused if de -D directive is #define rigth? so at the latest line we must add '-DWATCHDOG_MODS'
i leave the make as it and add into the C this:
#define WATCHDOG_MODS true

I got the HEX so i will burn to test, I try to decode the C code comment...
// Check if the WDT was used to reset, in which case we dont bootload and skip straight to the code. woot....Means that they do not waits for the loading sketch time...because restart without bootloader is not a nice idea!

Best Regards!
Frank
33  Using Arduino / Microcontrollers / Re: ATMEGA 328 watchdog....new bootloader or re-code the actual ? on: May 18, 2012, 08:11:19 pm
I'm using this: ATmegaBOOT_168_atmega328_pro_8MHz.hex, it's inside de atmega folder.

Best Regards!
Frank
34  Using Arduino / Microcontrollers / Re: ATMEGA 328 watchdog....new bootloader or re-code the actual ? on: May 18, 2012, 03:50:56 pm
The Watchdog in itself works, at my code the timer2 reset the watchdog timer, the issue is when it do not perform the task, I mean if y comment the wdt_reset() call the watchdog acts and reset the board, but because the timer keeps counting the uP do not start again.

I think that this is because the watchdog timer do not reset itself.

I hope that is because we do not clears this counter at the boot-loader functions. It only start again if I recycle the power source.

My boot is a pro 8 Mhz and 3V3, now i will see this boot-loader code and I will change to run at 8Mhz and 3V3, I think that this is the best option.... I'm right??

Best Regards
Frank
35  Using Arduino / Microcontrollers / ATMEGA 328 watchdog....new bootloader or re-code the actual ? on: May 17, 2012, 08:39:09 pm
Hi all!

I'm working with a ATMEGA328 and the watchdog functions. My code is this:

Code:

#include <MsTimer2.h>
#include <avr/wdt.h>
#define LED_GREEN 6
#define LED_RED 7


void setup(){
      MCUSR = 0;
      wdt_disable();
      MsTimer2::set(500, SecondInt);
      MsTimer2::start();
      pinMode(LED_GREEN,OUTPUT);
      pinMode(LED_RED,OUTPUT);
      digitalWrite(LED_RED,HIGH);
     
      wdt_enable(WDTO_4S);

   
  }


void loop(){
// nothing yet!!
}

void SecondInt(){
   wdt_reset();
   digitalWrite(LED_GREEN,!digitalRead(LED_GREEN));
}


Reading a little about the WATCHDOG issue, Atmel saids that we must clear the MSUSR register, because if not the watchdog counter remains until the next power-on condition. This mean that the uP do not run-up until the power will be removed and apply it again....nice thing!! a slave reset technician is need it!  smiley-yell

So, I think that someone forget this little detail because that is what is wrong with my cpu, it do not reset until I turn it off, wait some seconds and apply power again, i check too the default fuses values and looks great. (Note: jumping into the reset button do not do nothing) smiley-razz

I think that this MSUSR = 0 must be the firts line at the bootloader.

Best Regards!
Frank
36  Using Arduino / Programming Questions / Why the watchdog at Arduino works wrong? on: April 11, 2012, 12:53:23 pm
I'm testing the watchdog code that is posted at the page.
I' using the same code & libraries into a Wiring 1.0 Mega128 STKV2 boot-loader and works great.

Now using this int a Arduuno pro (3V3-8Mhz) if i not reset the wdt it reset the CPU but when it restart the CPU goes into a infinite loop.
If I change the voltaje form 3V3 to 5V the CPU starts one time, the watchdog trigger and go again into this infinite loop.

I test to reseting the wdt at the first thing at the setup() function.

Looks like the fuses are wrong seted, some ideas to fix this detail?

Best Regards!!
Frank
37  Using Arduino / Networking, Protocols, and Devices / Carry audio via IP? on: February 29, 2012, 09:28:39 pm
Hi all!
I'm trying to use IP as link to broadcast audio. Not music only voice audio so is less complex. I work a lot with IP phones and some other audio codec as GSM and SPEEX. But now i want to do but using hardware and not a computer. What i remember is that the more simple way to digitalize voice is using G.711 codec. (u-law)

And i remember that Motorola have some chips that comes in some telecom carrier equipment. This is the MC145540 this is a ADPCM Codec.
This device can be controlled via SPI and get me the ADPCM input/output in two IC pins.

Because i don't have any experience using this processors and i read some topics about VOIP in the forum i posted this so maybe is helpfully to others.

Best Regards
Frank
38  International / Español / Re: GPRS- PDP: deact on: November 08, 2011, 09:18:02 pm
Como estas Fernando.
A mi me esta pasando lo mismo desde que cambie de claro a movistar, se conecta cuando quiere y ademas de no iniciar el entorno PDP le cuesta muchisimo iniciar GPRS.
Generalmente solo tarda algunos segundos en iniciar el entorno pero por alguna razon hace cualquier cosa sobre movistar.

Yo sospecho que es algo en el firmware de la placa, lo que no encuentro dentro del manual de la placa es como activar y desactivar el entorno PDP y GPRS para intentar nuevamente, esta muyy escueto el manual de esto amigos orientales!

Saludos
Frank
39  Using Arduino / Networking, Protocols, and Devices / Re: RFM22 and out of sequence bytes? on: October 03, 2011, 03:11:09 pm
When i started with this modules and when i do not use the Mesh library, at my library every time that i got byte to read at the RX buffer, first i ask to the module that tell me how many bytes are ready to be reeded, and only then read exactly the bytes quantity, copy then to the RX buffer. Al this task will be done at a time slot, if the data was reeded at that time slot the packet is valid.

I think that some procedure needs a little bit more time to process the buffers, remember that we are a using this FIFO with a handshake procedure, so this procedure will be fast that the procedure that fills the TX buffer.

May be including a delay at the moment when the Tx FIFO is filled, other thing is that i was using 63 bytes and not 64, and only this help a lot. In fact my RX procedure don't care about how many byte the FIFO sends, it accumulate them always that the time slot is alive using the Rx register as index for the buffer management.

At my application the library works great but for some reason after 1 hour the module desynchronise and do not receive more data. Even i reset it
using the init() function, this some times work and sometimes not. Depends too about how long is the TX buffer.

Very small issues! for this complex library, what i don't know is if using temp() or other procedure to test if the module is alive and if not use the HW reset and start over.
 
I got a non-mesh code for several of this modules and they have more than 4 month transmitting/receiving with any issue, i mean the RFM hardware do not fails, i'm using FRM22, RFM31 and RFM43 without issues.

Best Regards
Frank

40  Using Arduino / Networking, Protocols, and Devices / Re: New library for RF22, RFM22 radio modules on: August 22, 2011, 08:02:51 pm
Hi all!
Mike why you store this:

Quote
   /// Array of the last seen sequence number indexed by node address that sent it
    /// It is used for duplicate detection. Duplicated messages are re-acknowledged when received
    /// (this is generally due to lost ACKs, causing the sender to retransmit, even though we have already
    /// received that message)
    uint8_t _seenIds[256];

Why not use a TTL at the message header?, the packet that is at the netowork for more than some time will be discarted at the next node

and about the TEMP buffer, i think that you are using the same for TX/RX, but why not use a reference from the main loop?

Quote
   /// Temporary mesage buffer
    static uint8_t _tmpMessage[RF22_ROUTER_MAX_MESSAGE_LEN];

At the first will be 256 bytes less if we can think in other mechanism, and at the tmpMessage will be some too !


I will keep coding!

Best Regards
Frank
41  Using Arduino / Networking, Protocols, and Devices / Re: New library for RF22, RFM22 radio modules on: August 22, 2011, 06:19:18 pm
Solved!...a better coding and more few bytes free at Ram and now works great!

Now only to get more free memory, what is the part of the library that use more RAM?, the routing table is not...

Best Regards
Frank
42  Using Arduino / Networking, Protocols, and Devices / Re: New library for RF22, RFM22 radio modules on: August 22, 2011, 10:05:48 am
Hi all!
Have test this library with a 200 chars payload buffer?.
For some reason my client-server MESH fails, i get the ACK from server and the server can se the packet send but not the payload of this packet.

Now I'm testing all about the FIFO and if the Int() of the module recharge the next 64 bytes on the TX FIFO.

The library work is i divide this 200 byte buffer into several 64 bytes?

Best Regards
Frank smiley-razz
43  Using Arduino / Networking, Protocols, and Devices / Re: New library for RF22, RFM22 radio modules on: August 11, 2011, 01:01:53 pm
From the module, the Tx/Rx switch is inside the silicon.

Now for the atenna diversity application, the chip don't have built-in the antenna switch, you MUST build this polarization switch external to the RFM22 device.

The control from this switch is made via GPIO outputs, the inputs TX-ANT and RX-ANT is like a SDPT-SW sensor, because the radio can be used for high speed radio links, the radio must know when the SPDT switch is ready to transmit, i mean when the selected antenna is successfuly connected

Quote
8.9. Antenna Diversity
To mitigate the problem of frequency-selective fading due to multi-path propagation, some transceiver systems use a scheme known as antenna diversity. In this scheme, two antennas are used. Each time the transceiver enters RX mode the receive signal strength from each antenna is evaluated. This evaluation process takes place during the preamble portion of the packet. The antenna with the strongest received signal is then used for the remainder of that RX packet. The same antenna will also be used for the next corresponding TX packet.
This chip fully supports antenna diversity with an integrated antenna diversity control algorithm. The required signals needed to control an external SPDT RF switch (such as PIN diode or GaAs switch) are available on the GPIOx pins. The operation of these GPIO signals is programmable to allow for different antenna diversity architectures and configurations. The antdiv[2:0] bits are found in register 08h “Operating & Function Control 2.”
The GPIO pins are capable of sourcing up to 5 mA of current, so it may be used directly to forward-bias a PIN diode if desired.

This idea is widely used on high speed radios.
44  Using Arduino / Networking, Protocols, and Devices / Re: New library for RF22, RFM22 radio modules on: August 11, 2011, 09:07:56 am
I think that the two antenna outputs got a reason, and is not about who antenna transmit and who receive.

At radio systems you got a coverage problem when the frecuencies goes very high, and this situation do not correct using more power at the transmiter or at the receiver. This is an signal angle problem and is so complex that the signal loose all the power is like it pass for virtual 0 degree and loose itself.

The only way to correct this situation is use another antenna equal to the first but in a different polarization angle, at cellular systems they use a second receiver w/a second receiver antenna to correct this sum both receivers signals.

At the PDF the diversity antenna algorithm is included on the chip firmware, but the antenna switch is external via PIN/GAS diodes, this antenna switch is controlled via the GPIO PINS, that means that this SW is EXTERNAL and is not included on the RFM22/23 PCB.

Build a antenna SW at this frecuencies will be very hard!

Best Regards
Frank
45  Using Arduino / Networking, Protocols, and Devices / Re: New library for RF22, RFM22 radio modules on: August 07, 2011, 05:19:54 pm
Have you all the network operation theory writed in some document?

The only thing that i can't understand about MESH is if each node repeats each datagram, how this datagram first reach the destination node after jump several times, and how the destination NODE respond to this datagram. I think that in both cases they will not use the same node. I think that the route have different direction.

I mean, if the server wants to send a command to the last node in the network, at the firts node that repeat the datagram it will be send back to the same node that generate this datagram, how the node send to others nodes and not go back to the server?

I must read some theoryy!!

Best Regards
Frank

Pages: 1 2 [3] 4 5 ... 11