Configuring CY8C9560A EEPROM with POR default settings.

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi ,

     I connected three switches to the three GPIOs on the CY8C9560a and LEDs to the 12 of other GPIOs.

So, when ever the switches are pressed ,i'm Toggling the LEDs in different patterns.

Right now, I'm enabling the Interrupt mechanism on the CY8C9560A to generate an interrupt if any changes occur in the GPIO states , which are connected to switches.

I connected the interrupt line to Master Board(Atmel Controller), so , on interrupt i'm reading the interrupt status register and toggling the corresponding LEDs through i2c_write.

My Question is

1. Can i do all these operations without the help of Master device after programming the cypress board?

2. Can we store all the settings in EEPROM and by Power ON Reset  can these operations be handled by the cypress control unit itself.?

    If yes , what type of settings i have to do ?  How to load such settings ?

Thanks  & Regards

R Madhu.samp

0 Likes
1 Solution

Hello Madhu,

There are some corrections to be made in your sequence, as follows

i2c_write_one_byte(0x18,0x01);     // Select Port #1

i2c_write_one_byte(0x1a,0x02);     // Select PWM #2

i2c_write_one_byte(0x1c,0x02);     // Enable Output on P1_2

i2c_write_one_byte(0x28,0x02);     // Select PWM #2, as PWM #2 only can be output on P1_2

i2c_write_one_byte(0x29,0x04);     // Clock from programmable divider

i2c_write_one_byte(0x2a,0x20);     // PWM Period

i2c_write_one_byte(0x2b,0x10);     // PWM pulse Width

i2c_write_one_byte(0x2c,0x80);     // Programmable divider value

This should output around 36Hz on P1_2, with a constant duty cycle of 50%.

In order to vary the intensity of the LED, you should change the pulse width by specifying a new value

i2c_write_one_byte(0x2b,0x18);     // PWM pulse Width

and so on.

Thanks,

Sampath

View solution in original post

0 Likes
4 Replies